diff --git a/tests3/sqlservertests.py b/tests3/sqlservertests.py index fcaedeee..8884ab60 100644 --- a/tests3/sqlservertests.py +++ b/tests3/sqlservertests.py @@ -1583,6 +1583,26 @@ def test_columns(self): assert row.type_name == 'varchar' assert row.column_size == 4, row.column_size + # + for i in range(8, 16): + table_name = 'pyodbc_89abcdef'[:i] + + self.cursor.execute("""\ + BEGIN TRY + DROP TABLE {0}; + END TRY + BEGIN CATCH + END CATCH + CREATE TABLE {0} (id INT PRIMARY KEY); + """.format(table_name)) + + col_count = len([col.column_name for col in self.cursor.columns(table_name)]) + # print('table [{}] ({} characters): {} columns{}'.format(table_name, i, col_count, ' <-' if col_count == 0 else '')) + self.assertEqual(col_count, 1) + + self.cursor.execute("DROP TABLE {};".format(table_name)) + # + def test_cancel(self): # I'm not sure how to reliably cause a hang to cancel, so for now we'll settle with # making sure SQLCancel is called correctly.