]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Always include a schema name in SQLite PRAGMA
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 2 Aug 2019 17:03:29 +0000 (13:03 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 2 Aug 2019 21:41:47 +0000 (17:41 -0400)
commitbe985bd41ecd0eeff90c1a817167a34eb02aeed1
treec644273def311dc048436bbb1b537345f0173e69
parent972026784fcac9d1356dd128f3bf19fbbf4ab422
Always include a schema name in SQLite PRAGMA

Fixed bug where usage of "PRAGMA table_info" in SQLite dialect meant that
reflection features to detect for table existence, list of table columns,
and list of foreign keys, would default to any table in any attached
database, when no schema name was given and the table did not exist in the
base schema.  The fix explicitly runs PRAGMA for the 'main' schema and then
the 'temp' schema if the 'main' returned no rows, to maintain the behavior
of tables + temp tables in the "no schema" namespace, attached tables only
in the "schema" namespace.

Fixes: #4793
Change-Id: I75bc03ef42581c46b98987510d2d2e701df07412
(cherry picked from commit e091775f1c4c817093e9a936a3abc79b5e311f93)
doc/build/changelog/unreleased_13/4793.rst [new file with mode: 0644]
doc/build/orm/tutorial.rst
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/testing/suite/test_reflection.py
test/dialect/test_sqlite.py