Use COALESCE rather than IFNULL

as this works on sqlite and postgres (postgres doesn't have IFNULL)
This commit is contained in:
David Baker 2018-05-01 17:54:03 +01:00
parent 4d55b16faa
commit 3a62cacfb0

View file

@ -88,7 +88,7 @@ class ProfileWorkerStore(SQLBaseStore):
def f(txn):
sql = (
"UPDATE profiles SET batch = "
"(SELECT IFNULL(MAX(batch), -1) + 1 FROM profiles) "
"(SELECT COALESCE(MAX(batch), -1) + 1 FROM profiles) "
"WHERE user_id in ("
" SELECT user_id FROM profiles WHERE batch is NULL limit ?"
")"