Commit eb3a3937 authored by Julien Muchembled's avatar Julien Muchembled

mysql: add missing spaces in SQL + tiny optimization

The spaces are optional so it's cosmetics.
parent dc257fc7
......@@ -458,16 +458,16 @@ class MySQLDatabaseManager(MVCCDatabaseManager):
return self.query("SELECT * FROM pt")
def _getLastTID(self, partition, max_tid=None):
x = "WHERE `partition`=%s" % partition
sql = ("SELECT MAX(tid) as t FROM trans FORCE INDEX (PRIMARY)"
" WHERE `partition`=%s") % partition
if max_tid:
x += " AND tid<=%s" % max_tid
(tid,), = self.query(
"SELECT MAX(tid) as t FROM trans FORCE INDEX (PRIMARY)" + x)
sql += " AND tid<=%s" % max_tid
(tid,), = self.query(sql)
return tid
def _getLastIDs(self, partition):
q = self.query
x = "WHERE `partition`=%s" % partition
x = " WHERE `partition`=%s" % partition
(oid,), = q("SELECT MAX(oid) FROM obj FORCE INDEX (PRIMARY)" + x)
(tid,), = q("SELECT MAX(tid) FROM obj FORCE INDEX (tid)" + x)
return tid, oid
......
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