diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-01-19 20:11:29 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-01-19 20:11:29 +0000 |
commit | bd3a65252d2f9155b7f2c1c6284074ba6e555d1f (patch) | |
tree | 00d2369aea4ae48c95b9d6314aa39258fd1fb7eb /test/dialect/oracle.py | |
parent | 840a2fabb8999b4b3807dfa55d771627656ab1db (diff) | |
download | sqlalchemy-bd3a65252d2f9155b7f2c1c6284074ba6e555d1f.tar.gz |
- Oracle assembles the correct columns in the result set
column mapping when generating a LIMIT/OFFSET subquery,
allows columns to map properly to result sets even
if long-name truncation kicks in [ticket:941]
Diffstat (limited to 'test/dialect/oracle.py')
-rw-r--r-- | test/dialect/oracle.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/dialect/oracle.py b/test/dialect/oracle.py index cc171af5f..9436d1915 100644 --- a/test/dialect/oracle.py +++ b/test/dialect/oracle.py @@ -41,12 +41,21 @@ class CompileTest(SQLCompileTest): def test_limit(self): t = table('sometable', column('col1'), column('col2')) + s = select([t]) + c = s.compile(dialect=oracle.OracleDialect()) + assert t.c.col1 in set(c.result_map['col1'][1]) + s = select([t]).limit(10).offset(20) self.assert_compile(s, "SELECT col1, col2 FROM (SELECT sometable.col1 AS col1, sometable.col2 AS col2, " "ROW_NUMBER() OVER (ORDER BY sometable.rowid) AS ora_rn FROM sometable) WHERE ora_rn>20 AND ora_rn<=30" ) + # assert that despite the subquery, the columns from the table, + # not the select, get put into the "result_map" + c = s.compile(dialect=oracle.OracleDialect()) + assert t.c.col1 in set(c.result_map['col1'][1]) + s = select([s.c.col1, s.c.col2]) self.assert_compile(s, "SELECT col1, col2 FROM (SELECT col1, col2 FROM (SELECT sometable.col1 AS col1, " |