--- /dev/null
+.. change::
+ :tags: bug, sqlite
+ :tickets: 8969
+ :versions: 2.0.0b5
+
+ Fixed regression caused by new support for reflection of partial indexes on
+ SQLite added in 1.4.45 for :ticket:`8804`, where the ``index_list`` pragma
+ command in very old versions of SQLite (possibly prior to 3.8.9) does not
+ return the current expected number of columns, leading to exceptions raised
+ when reflecting tables and indexes.
],
)
+ @testing.requires.sqlite_partial_indexes
def test_reflect_partial_indexes(self, connection):
connection.exec_driver_sql(
"create table foo_with_partial_index (x integer, y integer)"
def sqlite_memory(self):
return only_on(self._sqlite_memory_db)
+ def _sqlite_partial_idx(self, config):
+ if not against(config, "sqlite"):
+ return False
+ else:
+ with config.db.connect() as conn:
+ connection = conn.connection
+ cursor = connection.cursor()
+ try:
+ cursor.execute("SELECT * FROM pragma_index_info('idx52')")
+ except:
+ return False
+ else:
+ return (
+ cursor.description is not None
+ and len(cursor.description) >= 3
+ )
+ finally:
+ cursor.close()
+
+ @property
+ def sqlite_partial_indexes(self):
+
+ return only_on(self._sqlite_partial_idx)
+
@property
def reflects_json_type(self):
return only_on(