From: Mike Bayer Date: Mon, 26 Apr 2010 22:31:05 +0000 (-0400) Subject: - Added a label to the query used within has_table() and X-Git-Tag: rel_0_6_1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=893f8de6dfc149903ad1a746441a27458e8eeb22;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Added a label to the query used within has_table() and has_sequence() to work with older versions of Firebird that don't provide labels for result columns. [ticket:1521] --- diff --git a/CHANGES b/CHANGES index 9cdae0c81b..1428326c6f 100644 --- a/CHANGES +++ b/CHANGES @@ -25,6 +25,11 @@ CHANGES in which case the incompatible "output type handler" won't be used. This will impact decimal accuracy and some unicode handling issues. [ticket:1775] + +- firebird + - Added a label to the query used within has_table() and + has_sequence() to work with older versions of Firebird + that don't provide labels for result columns. [ticket:1521] 0.6.0 ===== diff --git a/lib/sqlalchemy/dialects/firebird/base.py b/lib/sqlalchemy/dialects/firebird/base.py index 70318157cb..4980800399 100644 --- a/lib/sqlalchemy/dialects/firebird/base.py +++ b/lib/sqlalchemy/dialects/firebird/base.py @@ -358,7 +358,7 @@ class FBDialect(default.DefaultDialect): """Return ``True`` if the given table exists, ignoring the `schema`.""" tblqry = """ - SELECT 1 FROM rdb$database + SELECT 1 AS has_table FROM rdb$database WHERE EXISTS (SELECT rdb$relation_name FROM rdb$relations WHERE rdb$relation_name=?) @@ -370,7 +370,7 @@ class FBDialect(default.DefaultDialect): """Return ``True`` if the given sequence (generator) exists.""" genqry = """ - SELECT 1 FROM rdb$database + SELECT 1 AS has_sequence FROM rdb$database WHERE EXISTS (SELECT rdb$generator_name FROM rdb$generators WHERE rdb$generator_name=?)