]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
some notes on a labeling issue that arises when label truncation doesnt match col...
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 1 May 2007 18:11:24 +0000 (18:11 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 1 May 2007 18:11:24 +0000 (18:11 +0000)
test/sql/labels.py

index d69a67ef4f200e1caec5cdfdd89d040515478ed5..7b9e05715d2ecf1188ae4660ba92a611592601cd 100644 (file)
@@ -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()