From: Mike Bayer Date: Wed, 19 Jul 2006 20:38:43 +0000 (+0000) Subject: reduced bind param size in query._get to appease the picky oracle X-Git-Tag: rel_0_2_6~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=219730da27622f86e60db5be1dc179168614e5bc;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git reduced bind param size in query._get to appease the picky oracle [ticket:244] --- diff --git a/CHANGES b/CHANGES index f96d321c5e..86a65d7284 100644 --- a/CHANGES +++ b/CHANGES @@ -42,6 +42,8 @@ do_init() method is called on all properties now which are more 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 diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 5006b8ad4d..8e87ac09a7 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -26,7 +26,7 @@ class Query(object): 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): @@ -280,7 +280,7 @@ class Query(object): 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