Mike, I tried to apply the new patch but it was rejected (working on windows 7 and using patch from GnuWin32); it seems that the target lines in you patch are misaligned with those in my SA source files. I tried to make the changes by hand, but I could not get it working. I still get the 'postfetch' error.
On 18 Ago, 19:34, Michael Bayer <mike...@zzzcomputing.com> wrote: > On Aug 18, 2011, at 1:19 PM, Massi wrote: > > > > > > > > > > > I got: > > > File "C:\Python26\lib\site-packages\sqlalchemy-0.7.2-py2.6-win32.egg > > \sqlalchemy\engine\base.py", line 2285, in execute > > return connection.execute(statement, *multiparams, **params) > > File "C:\Python26\lib\site-packages\sqlalchemy-0.7.2-py2.6-win32.egg > > \sqlalchemy\engine\base.py", line 1399, in execute > > params) > > File "C:\Python26\lib\site-packages\sqlalchemy-0.7.2-py2.6-win32.egg > > \sqlalchemy\engine\base.py", line 1532, in _execute_clauseelement > > compiled_sql, distilled_params > > File "C:\Python26\lib\site-packages\sqlalchemy-0.7.2-py2.6-win32.egg > > \sqlalchemy\engine\base.py", line 1599, in _execute_context > > None, None) > > File "C:\Python26\lib\site-packages\sqlalchemy-0.7.2-py2.6-win32.egg > > \sqlalchemy\engine\base.py", line 1595, in _execute_context > > context = constructor(dialect, self, conn, *args) > > File "C:\Python26\lib\site-packages\sqlalchemy-0.7.2-py2.6-win32.egg > > \sqlalchemy\engine\default.py", line 433, in _init_compiled > > self.postfetch_cols = self.compiled.postfetch > > StatementError: 'MSSQLCompiler' object has no attribute > > 'postfetch' (original cause: AttributeError: 'MSSQLCompiler' object > > has no attribute 'postfetch') 'INSERT INTO...' > > here's another patch that should default all that stuff appropriately: > > diff -r 113a7ed95335 lib/sqlalchemy/dialects/mssql/base.py > --- a/lib/sqlalchemy/dialects/mssql/base.py Thu Aug 18 13:03:30 2011 -0400 > +++ b/lib/sqlalchemy/dialects/mssql/base.py Thu Aug 18 13:31:16 2011 -0400 > @@ -655,7 +655,9 @@ > seq_column = tbl._autoincrement_column > insert_has_sequence = seq_column is not None > > - if insert_has_sequence: > + if getattr(self.compiled._mssql_requires_identity_insert, False): > + self._enable_identity_insert = True > + elif insert_has_sequence: > self._enable_identity_insert = \ > seq_column.key in self.compiled_parameters[0] > else: > diff -r 113a7ed95335 lib/sqlalchemy/sql/compiler.py > --- a/lib/sqlalchemy/sql/compiler.py Thu Aug 18 13:03:30 2011 -0400 > +++ b/lib/sqlalchemy/sql/compiler.py Thu Aug 18 13:31:16 2011 -0400 > @@ -198,6 +198,10 @@ > # driver/DB enforces this > ansi_bind_rules = False > > + postfetch = () > + prefetch = () > + returning = () > + > def __init__(self, dialect, statement, column_keys=None, > inline=False, **kwargs): > """Construct a new ``DefaultCompiler`` object. > diff -r 113a7ed95335 lib/sqlalchemy/sql/expression.py > --- a/lib/sqlalchemy/sql/expression.py Thu Aug 18 13:03:30 2011 -0400 > +++ b/lib/sqlalchemy/sql/expression.py Thu Aug 18 13:31:16 2011 -0400 > @@ -4792,6 +4792,8 @@ > Executable._execution_options.union({'autocommit': True}) > kwargs = util.immutabledict() > > + _returning = None > + > def _process_colparams(self, parameters): > if isinstance(parameters, (list, tuple)): > pp = {} -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.