- Fixed bug when calling select([literal('foo')])

or select([bindparam('foo')]).
This commit is contained in:
Mike Bayer
2008-07-15 15:04:43 +00:00
parent af38982273
commit deaff3e97f
3 changed files with 13 additions and 3 deletions
+9 -2
View File
@@ -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
+1 -1
View File
@@ -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
+3
View File
@@ -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")