From: Mike Bayer Date: Tue, 1 May 2007 18:11:24 +0000 (+0000) Subject: some notes on a labeling issue that arises when label truncation doesnt match col... X-Git-Tag: rel_0_3_8~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a19cec2de3e3560cb981c4e7040ebefc5b68846a;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git some notes on a labeling issue that arises when label truncation doesnt match col truncation --- 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()