summaryrefslogtreecommitdiff
path: root/test/sql/test_selectable.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-11-12 15:48:40 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-11-12 15:48:40 -0500
commit6397a4ff4bce537487a3b30552622544868da9a0 (patch)
treeec7e985ee344749c47bd8a1f5e44c3851713960f /test/sql/test_selectable.py
parent37c943233a4b01428cf4b67d766d2685309ab0e8 (diff)
downloadsqlalchemy-6397a4ff4bce537487a3b30552622544868da9a0.tar.gz
Fixed bug in type_coerce() whereby typing information
could be lost if the statement were used as a subquery inside of another statement, as well as other similar situations. Among other things, would cause typing information to be lost when the Oracle/mssql dialects would apply limit/offset wrappings. [ticket:2603]
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r--test/sql/test_selectable.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py
index 53c9018cd..65dc65470 100644
--- a/test/sql/test_selectable.py
+++ b/test/sql/test_selectable.py
@@ -228,6 +228,15 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled
"table1.col3, table1.colx FROM table1) AS anon_1"
)
+ def test_type_coerce_preserve_subq(self):
+ class MyType(TypeDecorator):
+ impl = Integer
+
+ stmt = select([type_coerce(column('x'), MyType).label('foo')])
+ stmt2 = stmt.select()
+ assert isinstance(stmt._raw_columns[0].type, MyType)
+ assert isinstance(stmt.c.foo.type, MyType)
+ assert isinstance(stmt2.c.foo.type, MyType)
def test_select_on_table(self):
sel = select([table1, table2], use_labels=True)