summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-04-24 21:51:40 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-04-24 21:51:40 +0000
commit38c6c7ffdfb848ced4e0846f649c21e2d440edbb (patch)
tree15492723dc8f8ce9ab67fd3eba9ef34e7336c661
parenta86398fdcfb9f3336fb2c63de1f712b38e6d5860 (diff)
downloadsqlalchemy-38c6c7ffdfb848ced4e0846f649c21e2d440edbb.tar.gz
- added a col label to help sqlite with order by
-rw-r--r--CHANGES3
-rw-r--r--test/sql/query.py6
2 files changed, 6 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 56517e556..b9f63c399 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 3ea9ec7ea..a3088ba2f 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')]