diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-11-05 04:22:30 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-11-05 04:22:30 -0500 |
commit | edec583b459e955a30d40b5c5d8baaed0a2ec1c6 (patch) | |
tree | fab94a50db294b0fd9ac8df493861f6505d533ce /test/sql/test_generative.py | |
parent | 7bf5ac9c1e814c999d4930941935e1d5cfd236bf (diff) | |
download | sqlalchemy-edec583b459e955a30d40b5c5d8baaed0a2ec1c6.tar.gz |
- Fixed bug regarding expression mutations which could express
itself as a "Could not locate column" error when using
:class:`.Query` to select from multiple, anonymous column
entities when querying against SQLite, as a side effect of the
"join rewriting" feature used by the SQLite dialect.
fixes #3241
Diffstat (limited to 'test/sql/test_generative.py')
-rw-r--r-- | test/sql/test_generative.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sql/test_generative.py b/test/sql/test_generative.py index 6044cecb0..6b86614e6 100644 --- a/test/sql/test_generative.py +++ b/test/sql/test_generative.py @@ -132,6 +132,19 @@ class TraversalTest(fixtures.TestBase, AssertsExecutionResults): assert struct == s2 assert struct.is_other(s2) + def test_clone_anon_label(self): + from sqlalchemy.sql.elements import Grouping + c1 = Grouping(literal_column('q')) + s1 = select([c1]) + + class Vis(CloningVisitor): + def visit_grouping(self, elem): + pass + + vis = Vis() + s2 = vis.traverse(s1) + eq_(list(s2.inner_columns)[0].anon_label, c1.anon_label) + def test_change_in_place(self): struct = B(A("expr1"), A("expr2"), B(A("expr1b"), A("expr2b")), A("expr3")) |