summaryrefslogtreecommitdiff
path: root/test/sql/labels.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-05-01 18:11:24 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-05-01 18:11:24 +0000
commita19cec2de3e3560cb981c4e7040ebefc5b68846a (patch)
tree3e0503f04683a273b64ae4e68a2e45bc9b039bab /test/sql/labels.py
parent546518d75c259d122b69d2874d8c00d71388aa61 (diff)
downloadsqlalchemy-a19cec2de3e3560cb981c4e7040ebefc5b68846a.tar.gz
some notes on a labeling issue that arises when label truncation doesnt match col truncation
Diffstat (limited to 'test/sql/labels.py')
-rw-r--r--test/sql/labels.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/sql/labels.py b/test/sql/labels.py
index d69a67ef4..7b9e05715 100644
--- a/test/sql/labels.py
+++ b/test/sql/labels.py
@@ -70,7 +70,18 @@ class LongLabelsTest(testbase.PersistTest):
def test_subquery(self):
q = table1.select(table1.c.this_is_the_primarykey_column == 4, use_labels=True)
x = select([q])
- print str(x)
-
+ print x.execute().fetchall()
+
+ def test_subquery2(self):
+ # this is the test that fails if the "max identifier length" is shorter than the
+ # length of the actual columns created, because the column names get truncated.
+ # if you try to separate "physical columns" from "labels", and only truncate the labels,
+ # the ansisql.visit_select() logic which auto-labels columns in a subquery (for the purposes of sqlite compat) breaks the code,
+ # since it is creating "labels" on the fly but not affecting derived columns, which think they are
+ # still "physical"
+ q = table1.select(table1.c.this_is_the_primarykey_column == 4).alias('foo')
+ x = select([q])
+ print x.execute().fetchall()
+
if __name__ == '__main__':
testbase.main()