Commit ed3cfda9 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Call setPTID() instead of execute the REPLACE SQL statement that do nothing if

there is no previous record.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@903 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 89aa471a
...@@ -26,6 +26,7 @@ from struct import pack, unpack ...@@ -26,6 +26,7 @@ from struct import pack, unpack
from neo.storage.database import DatabaseManager from neo.storage.database import DatabaseManager
from neo.exception import DatabaseFailure from neo.exception import DatabaseFailure
from neo.protocol import DISCARDED_STATE from neo.protocol import DISCARDED_STATE
from neo.util import dump
LOG_QUERIES = False LOG_QUERIES = False
...@@ -388,7 +389,7 @@ class MySQLDatabaseManager(DatabaseManager): ...@@ -388,7 +389,7 @@ class MySQLDatabaseManager(DatabaseManager):
ON DUPLICATE KEY UPDATE state = %d""" \ ON DUPLICATE KEY UPDATE state = %d""" \
% (offset, uuid, state, state)) % (offset, uuid, state, state))
ptid = e(ptid) ptid = e(ptid)
q("""UPDATE config SET value = '%s' WHERE name = 'ptid'""" % ptid) self.setPTID(ptid)
except: except:
self.rollback() self.rollback()
raise raise
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment