@@ -2944,8 +2944,8 @@ func TestContextBeginIsolationLevel(t *testing.T) {
2944
2944
}
2945
2945
2946
2946
func TestContextBeginReadOnly (t * testing.T ) {
2947
- runTests (t , dsn , func (dbt * DBTest ) {
2948
- dbt .mustExec ("CREATE TABLE test (v INTEGER)" )
2947
+ runTestsParallel (t , dsn , func (dbt * DBTest , tbl string ) {
2948
+ dbt .mustExec ("CREATE TABLE " + tbl + " (v INTEGER)" )
2949
2949
ctx , cancel := context .WithCancel (context .Background ())
2950
2950
defer cancel ()
2951
2951
@@ -2960,14 +2960,14 @@ func TestContextBeginReadOnly(t *testing.T) {
2960
2960
}
2961
2961
2962
2962
// INSERT queries fail in a READ ONLY transaction.
2963
- _ , err = tx .ExecContext (ctx , "INSERT INTO test VALUES (1)" )
2963
+ _ , err = tx .ExecContext (ctx , "INSERT INTO " + tbl + " VALUES (1)" )
2964
2964
if _ , ok := err .(* MySQLError ); ! ok {
2965
2965
dbt .Errorf ("expected MySQLError, got %v" , err )
2966
2966
}
2967
2967
2968
2968
// SELECT queries can be executed.
2969
2969
var v int
2970
- row := tx .QueryRowContext (ctx , "SELECT COUNT(*) FROM test" )
2970
+ row := tx .QueryRowContext (ctx , "SELECT COUNT(*) FROM " + tbl )
2971
2971
if err := row .Scan (& v ); err != nil {
2972
2972
dbt .Fatal (err )
2973
2973
}
0 commit comments