From 19530671362021b2ef53f4926c278e346406997b Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 25 Jan 2019 10:46:49 +0000 Subject: [PATCH 1/2] Disable native upserts for sqlite, as they don't work --- synapse/storage/engines/sqlite.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/synapse/storage/engines/sqlite.py b/synapse/storage/engines/sqlite.py index c64d73ff2..206919fcd 100644 --- a/synapse/storage/engines/sqlite.py +++ b/synapse/storage/engines/sqlite.py @@ -34,10 +34,14 @@ class Sqlite3Engine(object): @property def can_native_upsert(self): """ - Do we support native UPSERTs? This requires SQLite3 3.24+, plus some - more work we haven't done yet to tell what was inserted vs updated. + Do we support native UPSERTs? """ - return sqlite_version_info >= (3, 24, 0) + # SQLite3 3.24+ supports them, but empirically the unit tests don't work + # when its enabled. + # FIXME: Figure out what is wrong so we can re-enable native upserts + + # return sqlite_version_info >= (3, 24, 0) + return False def check_database(self, txn): pass From 8dcfa6e75cb1c8e5afc62c1d964e1c752dd1917b Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 25 Jan 2019 10:48:00 +0000 Subject: [PATCH 2/2] Newsfile --- changelog.d/4306.misc | 2 +- changelog.d/4471.misc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/4471.misc diff --git a/changelog.d/4306.misc b/changelog.d/4306.misc index 58130b619..7f48b02fb 100644 --- a/changelog.d/4306.misc +++ b/changelog.d/4306.misc @@ -1 +1 @@ -Synapse will now take advantage of native UPSERT functionality in PostgreSQL 9.5+ and SQLite 3.24+. +Synapse will now take advantage of native UPSERT functionality in PostgreSQL 9.5+. diff --git a/changelog.d/4471.misc b/changelog.d/4471.misc new file mode 100644 index 000000000..7f48b02fb --- /dev/null +++ b/changelog.d/4471.misc @@ -0,0 +1 @@ +Synapse will now take advantage of native UPSERT functionality in PostgreSQL 9.5+.