]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- added a col label to help sqlite with order by
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 24 Apr 2007 21:51:40 +0000 (21:51 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 24 Apr 2007 21:51:40 +0000 (21:51 +0000)
CHANGES
test/sql/query.py

diff --git a/CHANGES b/CHANGES
index 56517e556c26ef434db1e9af0128f8200f693a71..b9f63c39935c3d6ff398482fa21d29d61fb4c033 100644 (file)
--- 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
index 3ea9ec7ea594367d69a6f5b60928bca8abcdeff7..a3088ba2ffe4fe5722888dfe494fa858bd587ac6 100644 (file)
@@ -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')]