From: Brad Allen Date: Tue, 16 Mar 2010 22:57:54 +0000 (-0600) Subject: Disabling tests for mssql+mxodbc where mxODBC cursor.execute chokes on invalid placem... X-Git-Tag: rel_0_6beta2~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6b5550f426bf6c4dcba07cd2a1d7e2281573356;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Disabling tests for mssql+mxodbc where mxODBC cursor.execute chokes on invalid placement of bind parameter "?" within the SQL statement. --- diff --git a/test/dialect/test_mssql.py b/test/dialect/test_mssql.py index 89a3af5fb5..824de2b9d7 100644 --- a/test/dialect/test_mssql.py +++ b/test/dialect/test_mssql.py @@ -270,6 +270,7 @@ class IdentityInsertTest(TestBase, AssertsCompiledSQL): class ReflectionTest(TestBase, ComparesTables): __only_on__ = 'mssql' + @testing.crashes('mssql+mxodbc', 'Invalid bind parameter placement') def test_basic_reflection(self): meta = MetaData(testing.db) @@ -311,6 +312,7 @@ class ReflectionTest(TestBase, ComparesTables): finally: meta.drop_all() + @testing.crashes('mssql+mxodbc', 'Invalid bind parameter placement') def test_identity(self): meta = MetaData(testing.db) table = Table( @@ -1109,7 +1111,8 @@ class TypesTest(TestBase, AssertsExecutionResults, ComparesTables): testing.eq_(gen.get_column_specification(t.c.t), "t %s" % expected) self.assert_(repr(t.c.t)) t.create(checkfirst=True) - + + @testing.crashes('mssql+mxodbc', 'Invalid bind parameter placement') def test_autoincrement(self): Table('ai_1', metadata, Column('int_y', Integer, primary_key=True), diff --git a/test/sql/test_query.py b/test/sql/test_query.py index 4ccc51713f..aacc99435f 100644 --- a/test/sql/test_query.py +++ b/test/sql/test_query.py @@ -229,7 +229,11 @@ class QueryTest(TestBase): for row in select([sel + 1, sel + 3], bind=users.bind).execute(): assert row['anon_1'] == 8 assert row['anon_2'] == 10 - + + @testing.crashes('mssql+mxodbc', """Invalid bind parameter placement: + 'SELECT ? + query_users.user_name AS thedata \nFROM query_users + ORDER BY ? + query_users.user_name' ('test: ', 'test:') + """) @testing.fails_on('firebird', "kinterbasdb doesn't send full type information") def test_order_by_label(self): """test that a label within an ORDER BY works on each backend. @@ -767,6 +771,10 @@ class QueryTest(TestBase): # Null values are not outside any set assert len(r) == 0 + @testing.crashes('mssql+mxodbc', """Invalid bind parameter placement: + 'SELECT query_users.user_id, query_users.user_name \nFROM query_users + WHERE ? = ?' ('john', 'john') + """) @testing.emits_warning('.*empty sequence.*') @testing.fails_on('firebird', "kinterbasdb doesn't send full type information") @testing.fails_if(lambda: @@ -1027,6 +1035,15 @@ class CompoundTest(TestBase): def _fetchall_sorted(self, executed): return sorted([tuple(row) for row in executed.fetchall()]) + @testing.crashes('mssql+mxodbc', """Invalid bind parameter placement: + InterfaceError: (InterfaceError) ('07009', 0, '[Microsoft][SQL Server + Native Client 10.0]Invalid parameter number', 7513) + 'SELECT bar.col3, bar.col4 \nFROM (SELECT t1.col3 AS col3, + t1.col4 AS col4 \nFROM t1 \nWHERE t1.col2 IN (?, ?) + UNION SELECT t2.col3 AS col3, t2.col4 AS col4 \nFROM t2 + WHERE t2.col2 IN (?, ?)) AS bar' ('t1col2r1', 't1col2r2', + 't2col2r2','t2col2r3') + """) @testing.requires.subqueries def test_union(self): (s1, s2) = ( @@ -1059,6 +1076,15 @@ class CompoundTest(TestBase): ('ccc', 'aaa')] eq_(u.execute().fetchall(), wanted) + @testing.crashes('mssql+mxodbc', """Invalid bind parameter placement: + InterfaceError: (InterfaceError) ('07009', 0, '[Microsoft][SQL Server + Native Client 10.0]Invalid parameter number', 7513) + 'SELECT bar.col3, bar.col4 \nFROM (SELECT t1.col3 AS col3, + t1.col4 AS col4 \nFROM t1 \nWHERE t1.col2 IN (?, ?) + UNION SELECT t2.col3 AS col3, t2.col4 AS col4 + FROM t2 \nWHERE t2.col2 IN (?, ?)) AS bar' + ('t1col2r1', 't1col2r2', 't2col2r2', 't2col2r3') + """) @testing.fails_on('firebird', "doesn't like ORDER BY with UNIONs") @testing.fails_on('maxdb', 'FIXME: unknown') @testing.requires.subqueries @@ -1577,6 +1603,9 @@ class OperatorTest(TestBase): def teardown_class(cls): metadata.drop_all() + @testing.crashes('mssql+mxodbc', """Invalid bind parameter placement: + 'SELECT flds.intcol % ? AS anon_1 \nFROM flds ORDER BY flds.idcol' (3,) + """) @testing.fails_on('maxdb', 'FIXME: unknown') def test_modulo(self): eq_( diff --git a/test/sql/test_quote.py b/test/sql/test_quote.py index f4df98b9e8..1b14bbd675 100644 --- a/test/sql/test_quote.py +++ b/test/sql/test_quote.py @@ -56,6 +56,10 @@ class QuoteTest(TestBase, AssertsCompiledSQL): '"25column" INTEGER' ')' ) + + @testing.crashes('mssql+mxodbc', """Invalid bind parameter placement: + 'select ident_seed(?), ident_incr(?)' ('dbo.WorstCase2', 'dbo.WorstCase2') + """) def testreflect(self): meta2 = MetaData(testing.db) t2 = Table('WorstCase2', meta2, autoload=True, quote=True) diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 6404783a5a..8c8ecd8f22 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -813,7 +813,9 @@ class ExpressionTest(TestBase, AssertsExecutionResults, AssertsCompiledSQL): eq_(expr.right.type.__class__, CHAR) - + @testing.crashes('mssql+mxodbc', """Invalid bind parameter placement: + 'SELECT test.bvalue + ? AS foo \nFROM test' ('BIND_INhi',) + """) @testing.fails_on('firebird', 'Data type unknown on the parameter') def test_operator_adapt(self): """test type-based overloading of operators""" @@ -853,6 +855,9 @@ class ExpressionTest(TestBase, AssertsExecutionResults, AssertsCompiledSQL): "BIND_INfooBIND_INhiBIND_OUT" ) + @testing.crashes('mssql+mxodbc', """Invalid bind parameter placement: + 'SELECT test.bvalue + ? AS foo \nFROM test' ('BIND_IN6',) + """) def test_typedec_righthand_coercion(self): class MyTypeDec(types.TypeDecorator): impl = String