From 2451d8d61e40109dff11cbe50cf8729c1cc67ad5 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 23 Jun 2023 13:34:16 +0100 Subject: [PATCH] Fix old sqlite --- synapse/storage/background_updates.py | 2 +- tests/storage/test_background_update.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/synapse/storage/background_updates.py b/synapse/storage/background_updates.py index 26b7d72e581a..a38eff0eaefe 100644 --- a/synapse/storage/background_updates.py +++ b/synapse/storage/background_updates.py @@ -1105,7 +1105,7 @@ def run_validate_constraint_and_delete_rows_schema_delta( # PRIMARY KEY), and so don't need to be recreated. txn.execute( """ - SELECT sql FROM sqlite_schema + SELECT sql FROM sqlite_master WHERE tbl_name = ? AND type != 'table' AND sql IS NOT NULL """, (table,), diff --git a/tests/storage/test_background_update.py b/tests/storage/test_background_update.py index 3d1e405f92fb..6ca546f3f76a 100644 --- a/tests/storage/test_background_update.py +++ b/tests/storage/test_background_update.py @@ -526,7 +526,7 @@ def delta(txn: LoggingTransaction) -> None: # Ensure the index exists in the schema. self.get_success( self.store.db_pool.simple_select_one_onecol( - table="sqlite_schema", + table="sqlite_master", keyvalues={"tbl_name": "test_constraint"}, retcol="name", )