[Sqlalchemy-commits] sqlalchemy: Hardcoded ident_seed and ident_increment query had b...
Brought to you by:
zzzeek
From: <co...@sq...> - 2010-03-18 17:48:58
|
details: http://hg.sqlalchemy.org/sqlalchemy/sqlalchemy/rev/9f3dcac966d4 changeset: 6289:9f3dcac966d4 user: bradallen <bra...@gm...> date: Thu Mar 18 11:47:45 2010 -0600 description: Hardcoded ident_seed and ident_increment query had bind markers noncompliant with SQL-92, which caused mxODBC failures. This was corrected by using string substitution in building the statement, and removing the bind params. diffstat: lib/sqlalchemy/dialects/mssql/base.py | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diffs (19 lines): diff -r e78b63749a63 -r 9f3dcac966d4 lib/sqlalchemy/dialects/mssql/base.py --- a/lib/sqlalchemy/dialects/mssql/base.py Thu Mar 18 11:20:45 2010 -0600 +++ b/lib/sqlalchemy/dialects/mssql/base.py Thu Mar 18 11:47:45 2010 -0600 @@ -1326,12 +1326,10 @@ if ic is not None and self.server_version_info >= MS_2005_VERSION: table_fullname = "%s.%s" % (current_schema, tablename) cursor = connection.execute( - sql.text("select ident_seed(:tname), ident_incr(:tname)", - bindparams=[ - sql.bindparam('tname', table_fullname) - ] + "select ident_seed('%s'), ident_incr('%s')" + % (tablename, tablename) ) - ) + row = cursor.first() if not row is None: colmap[ic]['sequence'].update({ |