mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-20 10:55:09 +03:00
Use COALESCE rather than IFNULL
as this works on sqlite and postgres (postgres doesn't have IFNULL)
This commit is contained in:
parent
4d55b16faa
commit
3a62cacfb0
1 changed files with 1 additions and 1 deletions
|
@ -88,7 +88,7 @@ class ProfileWorkerStore(SQLBaseStore):
|
||||||
def f(txn):
|
def f(txn):
|
||||||
sql = (
|
sql = (
|
||||||
"UPDATE profiles SET batch = "
|
"UPDATE profiles SET batch = "
|
||||||
"(SELECT IFNULL(MAX(batch), -1) + 1 FROM profiles) "
|
"(SELECT COALESCE(MAX(batch), -1) + 1 FROM profiles) "
|
||||||
"WHERE user_id in ("
|
"WHERE user_id in ("
|
||||||
" SELECT user_id FROM profiles WHERE batch is NULL limit ?"
|
" SELECT user_id FROM profiles WHERE batch is NULL limit ?"
|
||||||
")"
|
")"
|
||||||
|
|
Loading…
Reference in a new issue