- Added test coverage for unknown type reflection. Fixed sqlite/mysql
handling of type reflection for unknown types.
- - oracle uses plain "rowid" name when limiting against subqueries,
- since this is the "rowid" of the enclosing query. if this raises
- issues in the wild please file tickets !
-
- misc
- Removed unused util.hash().
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 rowid) AS ora_rn FROM sometable) WHERE ora_rn>20 AND ora_rn<=30"
+ "ROW_NUMBER() OVER (ORDER BY sometable.rowid) AS ora_rn FROM sometable) WHERE ora_rn>20 AND ora_rn<=30"
)
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, "
- "sometable.col2 AS col2, ROW_NUMBER() OVER (ORDER BY rowid) AS ora_rn FROM sometable) WHERE ora_rn>20 AND ora_rn<=30)")
+ "sometable.col2 AS col2, ROW_NUMBER() OVER (ORDER BY sometable.rowid) AS ora_rn FROM sometable) WHERE ora_rn>20 AND ora_rn<=30)")
# testing this twice to ensure oracle doesn't modify the original statement
self.assert_compile(s, "SELECT col1, col2 FROM (SELECT col1, col2 FROM (SELECT sometable.col1 AS col1, "
- "sometable.col2 AS col2, ROW_NUMBER() OVER (ORDER BY rowid) AS ora_rn FROM sometable) WHERE ora_rn>20 AND ora_rn<=30)")
+ "sometable.col2 AS col2, ROW_NUMBER() OVER (ORDER BY sometable.rowid) AS ora_rn FROM sometable) WHERE ora_rn>20 AND ora_rn<=30)")
+
+ s = select([t]).limit(10).offset(20).order_by(t.c.col2)
+
+ self.assert_compile(s, "SELECT col1, col2 FROM (SELECT sometable.col1 AS col1, "
+ "sometable.col2 AS col2, ROW_NUMBER() OVER (ORDER BY sometable.col2) AS ora_rn FROM sometable ORDER BY sometable.col2) WHERE ora_rn>20 AND ora_rn<=30")
def test_outer_join(self):
table1 = table('mytable',