]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
tentative fix for oracle row_number over syntax
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 24 Feb 2006 17:12:02 +0000 (17:12 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 24 Feb 2006 17:12:02 +0000 (17:12 +0000)
CHANGES
lib/sqlalchemy/databases/oracle.py

diff --git a/CHANGES b/CHANGES
index 0399f0015c2fd80f3e1960cb54417b8256556c8c..6b85598d9ec2c0a755d5f07a06da6ac3df09cb74 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,5 @@
 0.1.3
+- fix to Oracle "row_number over" clause with mulitple tables
 - mapper.get() was not selecting multiple-keyed objects if the mapper's table was a join,
 such as in an inheritance relationship, this is fixed.
 0.1.2
index eba04a27f85fb46056c934c457d408f40310bac2..2b91c176d87fb08ecf22f9b001008774b64b49f1 100644 (file)
@@ -212,7 +212,8 @@ class OracleCompiler(ansisql.ANSICompiler):
             if hasattr(select, "order_by_clause"):
                 orderby = self.strings[select.order_by_clause]
             else:
-                orderby = "rowid ASC"
+                # TODO: try to get "oid_column" to be used here
+                orderby = "%s.rowid ASC" % select.froms[0].id
             select.append_column(sql.ColumnClause("ROW_NUMBER() OVER (ORDER BY %s)" % orderby).label("ora_rn"))
             limitselect = sql.select([c for c in select.c if c.key!='ora_rn'])
             if select.offset is not None: