File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2762,10 +2762,10 @@ func TestContextCancelPrepare(t *testing.T) {
2762
2762
}
2763
2763
2764
2764
func TestContextCancelStmtExec (t * testing.T ) {
2765
- runTests (t , dsn , func (dbt * DBTest ) {
2766
- dbt .mustExec ("CREATE TABLE test (v INTEGER)" )
2765
+ runTestsParallel (t , dsn , func (dbt * DBTest , tbl string ) {
2766
+ dbt .mustExec ("CREATE TABLE " + tbl + " (v INTEGER)" )
2767
2767
ctx , cancel := context .WithCancel (context .Background ())
2768
- stmt , err := dbt .db .PrepareContext (ctx , "INSERT INTO test VALUES (SLEEP(1))" )
2768
+ stmt , err := dbt .db .PrepareContext (ctx , "INSERT INTO " + tbl + " VALUES (SLEEP(1))" )
2769
2769
if err != nil {
2770
2770
dbt .Fatalf ("unexpected error: %v" , err )
2771
2771
}
@@ -2787,7 +2787,7 @@ func TestContextCancelStmtExec(t *testing.T) {
2787
2787
2788
2788
// Check how many times the query is executed.
2789
2789
var v int
2790
- if err := dbt .db .QueryRow ("SELECT COUNT(*) FROM test" ).Scan (& v ); err != nil {
2790
+ if err := dbt .db .QueryRow ("SELECT COUNT(*) FROM " + tbl ).Scan (& v ); err != nil {
2791
2791
dbt .Fatalf ("%s" , err .Error ())
2792
2792
}
2793
2793
if v != 1 { // TODO: need to kill the query, and v should be 0.
You can’t perform that action at this time.
0 commit comments