Commits

Mike Bayer committed 9f0be85

reduced bind param size in query._get to appease the picky oracle
[ticket:244]

Comments (0)

Files changed (2)

 aware of their "inherited" status if so.
 - eager loads explicitly disallowed on self-referential relationships, or
 relationships to an inheriting mapper (which is also self-referential)
+- reduced bind param size in query._get to appease the picky oracle 
+[ticket:244]
 
 0.2.5
 - fixed endless loop bug in select_by(), if the traversal hit

lib/sqlalchemy/orm/query.py

         if not hasattr(self.mapper, '_get_clause'):
             _get_clause = sql.and_()
             for primary_key in self.mapper.pks_by_table[self.table]:
-                _get_clause.clauses.append(primary_key == sql.bindparam("pk_"+primary_key._label, type=primary_key.type))
+                _get_clause.clauses.append(primary_key == sql.bindparam(primary_key._label, type=primary_key.type))
             self.mapper._get_clause = _get_clause
         self._get_clause = self.mapper._get_clause
     def _get_session(self):
         i = 0
         params = {}
         for primary_key in self.mapper.pks_by_table[self.table]:
-            params["pk_"+primary_key._label] = ident[i]
+            params[primary_key._label] = ident[i]
             # if there are not enough elements in the given identifier, then 
             # use the previous identifier repeatedly.  this is a workaround for the issue 
             # in [ticket:185], where a mapper that uses joined table inheritance needs to specify
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.