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 @@ -2797,10 +2797,10 @@ func TestContextCancelStmtExec(t *testing.T) {
2797
2797
}
2798
2798
2799
2799
func TestContextCancelStmtQuery (t * testing.T ) {
2800
- runTests (t , dsn , func (dbt * DBTest ) {
2801
- dbt .mustExec ("CREATE TABLE test (v INTEGER)" )
2800
+ runTestsParallel (t , dsn , func (dbt * DBTest , tbl string ) {
2801
+ dbt .mustExec ("CREATE TABLE " + tbl + " (v INTEGER)" )
2802
2802
ctx , cancel := context .WithCancel (context .Background ())
2803
- stmt , err := dbt .db .PrepareContext (ctx , "INSERT INTO test VALUES (SLEEP(1))" )
2803
+ stmt , err := dbt .db .PrepareContext (ctx , "INSERT INTO " + tbl + " VALUES (SLEEP(1))" )
2804
2804
if err != nil {
2805
2805
dbt .Fatalf ("unexpected error: %v" , err )
2806
2806
}
@@ -2822,7 +2822,7 @@ func TestContextCancelStmtQuery(t *testing.T) {
2822
2822
2823
2823
// Check how many times the query is executed.
2824
2824
var v int
2825
- if err := dbt .db .QueryRow ("SELECT COUNT(*) FROM test" ).Scan (& v ); err != nil {
2825
+ if err := dbt .db .QueryRow ("SELECT COUNT(*) FROM " + tbl ).Scan (& v ); err != nil {
2826
2826
dbt .Fatalf ("%s" , err .Error ())
2827
2827
}
2828
2828
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