diff --git a/synapse/storage/profile.py b/synapse/storage/profile.py index 12e2d44406..fcf3af7e5b 100644 --- a/synapse/storage/profile.py +++ b/synapse/storage/profile.py @@ -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 ?" ")"