From 1b0ac7e43b715b9050cb5f45d4a180bfc203c8a9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 9 Jul 2006 17:58:01 +0000 Subject: added workaround for funny pragma behavior on windows pysqlite singletonthreadpool has a dispose() method, used by proxy_engine test to better clean up after itself on windows --- lib/sqlalchemy/databases/sqlite.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sqlalchemy/databases/sqlite.py') diff --git a/lib/sqlalchemy/databases/sqlite.py b/lib/sqlalchemy/databases/sqlite.py index b2aeb75fd..d96c0eda1 100644 --- a/lib/sqlalchemy/databases/sqlite.py +++ b/lib/sqlalchemy/databases/sqlite.py @@ -154,6 +154,10 @@ class SQLiteDialect(ansisql.ANSIDialect): def has_table(self, connection, table_name): cursor = connection.execute("PRAGMA table_info(" + table_name + ")", {}) row = cursor.fetchone() + + # consume remaining rows, to work around: http://www.sqlite.org/cvstrac/tktview?tn=1884 + while cursor.fetchone() is not None:pass + return (row is not None) def reflecttable(self, connection, table): -- cgit v1.2.1