From a19cec2de3e3560cb981c4e7040ebefc5b68846a Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 1 May 2007 18:11:24 +0000 Subject: [PATCH] some notes on a labeling issue that arises when label truncation doesnt match col truncation --- test/sql/labels.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/test/sql/labels.py b/test/sql/labels.py index d69a67ef4f..7b9e05715d 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() -- 2.47.2