diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-07-12 11:32:34 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-07-12 11:32:34 -0400 |
commit | 0ca7b53b4235c2fbabfbb6a4e2df2f7a369df6f2 (patch) | |
tree | 7afb656369eb8a2e49621a012003bd28f8c0d0e5 /test/sql/test_selectable.py | |
parent | 269a166b73a84914b8601b3a714d682ef7eb87f5 (diff) | |
download | sqlalchemy-0ca7b53b4235c2fbabfbb6a4e2df2f7a369df6f2.tar.gz |
Fixed bug where the expression system relied upon the ``str()``
form of a some expressions when referring to the ``.c`` collection
on a ``select()`` construct, but the ``str()`` form isn't available
since the element relies on dialect-specific compilation constructs,
notably the ``__getitem__()`` operator as used with a Postgresql
``ARRAY`` element. The fix also adds a new exception class
:class:`.UnsupportedCompilationError` which is raised in those cases
where a compiler is asked to compile something it doesn't know
how to. Also in 0.8.3.
[ticket:2780]
Diffstat (limited to 'test/sql/test_selectable.py')
-rw-r--r-- | test/sql/test_selectable.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py index 335083ce1..df174fb25 100644 --- a/test/sql/test_selectable.py +++ b/test/sql/test_selectable.py @@ -148,6 +148,19 @@ class SelectableTest(fixtures.TestBase, AssertsExecutionResults, AssertsCompiled s = select([t])._clone() assert c in s.c.bar.proxy_set + + def test_no_error_on_unsupported_expr_key(self): + from sqlalchemy.dialects.postgresql import ARRAY + + t = table('t', column('x', ARRAY(Integer))) + + expr = t.c.x[5] + s = select([t, expr]) + eq_( + s.c.keys(), + ['x', expr.anon_label] + ) + def test_cloned_intersection(self): t1 = table('t1', column('x')) t2 = table('t2', column('x')) |