From 3a62cacfb0e8832ef01aadabb29452fa0308ebdc Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 1 May 2018 17:54:03 +0100 Subject: [PATCH] Use COALESCE rather than IFNULL as this works on sqlite and postgres (postgres doesn't have IFNULL) --- synapse/storage/profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/storage/profile.py b/synapse/storage/profile.py index 12e2d4440..fcf3af7e5 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 ?" ")"