@@ -95,6 +95,7 @@ func runTestsWithMultiStatement(t *testing.T, dsn string, tests ...func(dbt *DBT
95
95
for _ , test := range tests {
96
96
test (dbt )
97
97
dbt .db .Exec ("DROP TABLE IF EXISTS test" )
98
+ dbt .db .Exec ("DROP TABLE IF EXISTS test2" )
98
99
}
99
100
}
100
101
@@ -110,6 +111,7 @@ func runTests(t *testing.T, dsn string, tests ...func(dbt *DBTest)) {
110
111
defer db .Close ()
111
112
112
113
db .Exec ("DROP TABLE IF EXISTS test" )
114
+ db .Exec ("DROP TABLE IF EXISTS test2" )
113
115
114
116
dsn2 := dsn + "&interpolateParams=true"
115
117
var db2 * sql.DB
@@ -137,13 +139,16 @@ func runTests(t *testing.T, dsn string, tests ...func(dbt *DBTest)) {
137
139
for _ , test := range tests {
138
140
test (dbt )
139
141
dbt .db .Exec ("DROP TABLE IF EXISTS test" )
142
+ dbt .db .Exec ("DROP TABLE IF EXISTS test2" )
140
143
if db2 != nil {
141
144
test (dbt2 )
142
145
dbt2 .db .Exec ("DROP TABLE IF EXISTS test" )
146
+ dbt2 .db .Exec ("DROP TABLE IF EXISTS test2" )
143
147
}
144
148
if db3 != nil {
145
149
test (dbt3 )
146
150
dbt3 .db .Exec ("DROP TABLE IF EXISTS test" )
151
+ dbt3 .db .Exec ("DROP TABLE IF EXISTS test2" )
147
152
}
148
153
}
149
154
}
@@ -445,6 +450,14 @@ func TestFloat64Placeholder(t *testing.T) {
445
450
})
446
451
}
447
452
453
+ func TestMultiStatementStrict (t * testing.T ) {
454
+ runTestsWithMultiStatement (t , dsn , func (dbt * DBTest ) {
455
+ dbt .mustExec ("CREATE TABLE test (id INT(11) UNSIGNED NOT NULL, PRIMARY KEY (id))" )
456
+ dbt .mustExec ("CREATE TABLE test2 (id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY (id))" )
457
+ dbt .mustExec ("INSERT INTO test VALUES (71398); INSERT INTO test2 VALUES (71398);" )
458
+ })
459
+ }
460
+
448
461
func TestString (t * testing.T ) {
449
462
runTests (t , dsn , func (dbt * DBTest ) {
450
463
types := [6 ]string {"CHAR(255)" , "VARCHAR(255)" , "TINYTEXT" , "TEXT" , "MEDIUMTEXT" , "LONGTEXT" }
0 commit comments