diff options
| -rw-r--r-- | CHANGES | 11 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 2 | ||||
| -rw-r--r-- | test/sql/select.py | 3 |
3 files changed, 13 insertions, 3 deletions
@@ -5,6 +5,9 @@ CHANGES ======= 0.5beta3 ======== + - 0.5beta3 includes all bugfixes listed under release + "0.4.7". + - orm - Added a new SessionExtension hook called after_attach(). This is called at the point of attachment for objects @@ -12,8 +15,8 @@ CHANGES 0.5beta2 ======== - - 0.5beta2 includes all bugfixes listed under release - "0.4.7". + - 0.5beta2 includes some of the bugfixes listed under + release "0.4.7". - orm - In addition to expired attributes, deferred attributes @@ -193,6 +196,10 @@ CHANGES flag is always True with a "transactional" (in 0.5 a non-"autocommit") Session. +- sql + - Fixed bug when calling select([literal('foo')]) + or select([bindparam('foo')]). + - schema - create_all(), drop_all(), create(), drop() all raise an error if the table name or schema name contains diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index 05b3f550d..1edf04ee1 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -459,7 +459,7 @@ class DefaultCompiler(engine.Compiled): column.table is not None and \ not isinstance(column.table, sql.Select): return column.label(column.name) - elif not isinstance(column, (sql._UnaryExpression, sql._TextClause)) and (not hasattr(column, 'name') or isinstance(column, sql._Function)): + elif not isinstance(column, (sql._UnaryExpression, sql._TextClause, sql._BindParamClause)) and (not hasattr(column, 'name') or isinstance(column, sql._Function)): return column.label(column.anon_label) else: return column diff --git a/test/sql/select.py b/test/sql/select.py index b6a1f7ccc..ddd8ede42 100644 --- a/test/sql/select.py +++ b/test/sql/select.py @@ -739,6 +739,9 @@ FROM mytable, myothertable WHERE foo.id = foofoo(lala) AND datetime(foo) = Today def test_literal(self): + + self.assert_compile(select([literal('foo')]), "SELECT :param_1") + self.assert_compile(select([literal("foo") + literal("bar")], from_obj=[table1]), "SELECT :param_1 || :param_2 AS anon_1 FROM mytable") |
