From 38c6c7ffdfb848ced4e0846f649c21e2d440edbb Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 24 Apr 2007 21:51:40 +0000 Subject: [PATCH] - added a col label to help sqlite with order by --- CHANGES | 3 +++ test/sql/query.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 56517e556c..b9f63c3993 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,9 @@ same as always, but if none found will fall back to trying pkg_resources to load an external module [ticket:521] - sql: + - keys() of result set columns are not lowercased, come back + exactly as they're expressed in cursor.description. note this + causes colnames to be all caps in oracle. - preliminary support for unicode table names, column names and SQL statements added, for databases which can support them. Works with sqlite and postgres so far. Mysql *mostly* works diff --git a/test/sql/query.py b/test/sql/query.py index 3ea9ec7ea5..a3088ba2ff 100644 --- a/test/sql/query.py +++ b/test/sql/query.py @@ -422,10 +422,10 @@ class CompoundTest(PersistTest): def test_union(self): (s1, s2) = ( - select([t1.c.col3, t1.c.col4], t1.c.col2.in_("t1col2r1", "t1col2r2")), - select([t2.c.col3, t2.c.col4], t2.c.col2.in_("t2col2r2", "t2col2r3")) + select([t1.c.col3.label('col3'), t1.c.col4], t1.c.col2.in_("t1col2r1", "t1col2r2")), + select([t2.c.col3.label('col3'), t2.c.col4], t2.c.col2.in_("t2col2r2", "t2col2r3")) ) - u = union(s1, s2, order_by=[s1.c.col3]) + u = union(s1, s2, order_by=['col3']) assert u.execute().fetchall() == [('aaa', 'aaa'), ('bbb', 'bbb'), ('bbb', 'ccc'), ('ccc', 'aaa')] assert u.alias('bar').select().execute().fetchall() == [('aaa', 'aaa'), ('bbb', 'bbb'), ('bbb', 'ccc'), ('ccc', 'aaa')] -- 2.47.2