:versions: 1.0.0
Enabled "multivalues insert" for SQL Server 2008. Pull request
- courtesy Albert Cervin.
+ courtesy Albert Cervin. Also expanded the checks for "IDENTITY INSERT"
+ mode to include when the identity key is present in the
+ VALUEs clause of the statement.
.. change::
:tags: feature, engine
if insert_has_sequence:
self._enable_identity_insert = \
- seq_column.key in self.compiled_parameters[0]
+ seq_column.key in self.compiled_parameters[0] or \
+ (
+ self.compiled.statement.parameters and (
+ (
+ self.compiled.statement._has_multi_parameters
+ and
+ seq_column.key in
+ self.compiled.statement.parameters[0]
+ ) or (
+ not
+ self.compiled.statement._has_multi_parameters
+ and
+ seq_column.key in
+ self.compiled.statement.parameters
+ )
+ )
+ )
else:
self._enable_identity_insert = False
def unicode_ddl(self):
"""Target driver must support some degree of non-ascii symbol names."""
# TODO: expand to exclude MySQLdb versions w/ broken unicode
+
return skip_if([
no_support('oracle', 'FIXME: no support in database?'),
no_support('sybase', 'FIXME: guessing, needs confirmation'),
no_support('mssql+pymssql', 'no FreeTDS support'),
-
+ LambdaPredicate(
+ lambda config: against(config, 'mssql+pyodbc') and
+ config.db.dialect.freetds and
+ config.db.dialect.freetds_driver_version < "0.91",
+ "older freetds doesn't support unicode DDL"
+ ),
exclude('mysql', '<', (4, 1, 1), 'no unicode connection support'),
- ])
+ ])
@property
def sane_rowcount(self):
assert col in result._metadata._keymap
@testing.skip_if("oracle", "oracle's cranky")
+ @testing.skip_if("mssql", "can't query EXISTS in the columns "
+ "clause w/o subquery")
def test_a_atobalias_balias_c_w_exists(self):
super(JoinExecTest, self).test_a_atobalias_balias_c_w_exists()
def test_native_unicode(self):
"""assert expected values for 'native unicode' mode"""
- if (testing.against('mssql+pyodbc') and
- not testing.db.dialect.freetds) \
- or testing.against('mssql+mxodbc'):
+ if testing.against('mssql+pyodbc'):
+ eq_(
+ testing.db.dialect.returns_unicode_strings,
+ 'conditional'
+ )
+
+ elif testing.against('mssql+mxodbc'):
eq_(
testing.db.dialect.returns_unicode_strings,
'conditional'