File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
1313 can_introspect_small_integer_field = True
1414 can_return_columns_from_insert = True
1515 can_return_id_from_insert = True
16- can_return_rows_from_bulk_insert = True
16+ can_return_rows_from_bulk_insert = False
1717 can_rollback_ddl = True
1818 can_use_chunked_reads = False
1919 for_update_after_from = True
Original file line number Diff line number Diff line change 1515 "PASSWORD" : "MyPassword42" ,
1616 "HOST" : "localhost" ,
1717 "PORT" : "1433" ,
18- "OPTIONS" : {"driver" : "ODBC Driver 17 for SQL Server" , },
18+ "OPTIONS" : {"driver" : "ODBC Driver 17 for SQL Server" , "return_rows_bulk_insert" : True },
1919 },
2020 'other' : {
2121 "ENGINE" : "mssql" ,
2424 "PASSWORD" : "MyPassword42" ,
2525 "HOST" : "localhost" ,
2626 "PORT" : "1433" ,
27- "OPTIONS" : {"driver" : "ODBC Driver 17 for SQL Server" , },
27+ "OPTIONS" : {"driver" : "ODBC Driver 17 for SQL Server" , "return_rows_bulk_insert" : True },
2828 },
2929}
3030
Original file line number Diff line number Diff line change 77class TestTableWithTrigger (TransactionTestCase ):
88 def test_insert_into_table_with_trigger (self ):
99 connection = connections ['default' ]
10- # Change can_return_rows_from_bulk_insert to be the same as when
11- # has_trigger = True
12- connection .features_class .can_return_rows_from_bulk_insert = False
13-
1410 with connection .schema_editor () as cursor :
1511 cursor .execute ("""
1612 CREATE TRIGGER TestTrigger
@@ -21,9 +17,14 @@ def test_insert_into_table_with_trigger(self):
2117 """ )
2218
2319 try :
20+ # Change can_return_rows_from_bulk_insert to be the same as when
21+ # has_trigger = True
22+ old_return_rows_flag = connection .features_class .can_return_rows_from_bulk_insert
23+ connection .features_class .can_return_rows_from_bulk_insert = False
2424 Author .objects .create (name = 'Foo' )
2525 except django .db .utils .ProgrammingError as e :
2626 self .fail ('Check for regression of issue #130. Insert with trigger failed with exception: %s' % e )
2727 finally :
2828 with connection .schema_editor () as cursor :
2929 cursor .execute ("DROP TRIGGER TestTrigger" )
30+ connection .features_class .can_return_rows_from_bulk_insert = old_return_rows_flag
You can’t perform that action at this time.
0 commit comments