Skip to content

Commit a360be7

Browse files
committed
parallelize TestLongData
1 parent 2242274 commit a360be7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

driver_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ func TestUint64(t *testing.T) {
12411241
}
12421242

12431243
func TestLongData(t *testing.T) {
1244-
runTests(t, dsn+"&maxAllowedPacket=0", func(dbt *DBTest) {
1244+
runTestsParallel(t, dsn+"&maxAllowedPacket=0", func(dbt *DBTest, tbl string) {
12451245
var maxAllowedPacketSize int
12461246
err := dbt.db.QueryRow("select @@max_allowed_packet").Scan(&maxAllowedPacketSize)
12471247
if err != nil {
@@ -1254,7 +1254,7 @@ func TestLongData(t *testing.T) {
12541254
maxAllowedPacketSize = 1 << 25
12551255
}
12561256

1257-
dbt.mustExec("CREATE TABLE test (value LONGBLOB)")
1257+
dbt.mustExec("CREATE TABLE " + tbl + " (value LONGBLOB)")
12581258

12591259
in := strings.Repeat(`a`, maxAllowedPacketSize+1)
12601260
var out string
@@ -1263,8 +1263,8 @@ func TestLongData(t *testing.T) {
12631263
// Long text data
12641264
const nonDataQueryLen = 28 // length query w/o value
12651265
inS := in[:maxAllowedPacketSize-nonDataQueryLen]
1266-
dbt.mustExec("INSERT INTO test VALUES('" + inS + "')")
1267-
rows = dbt.mustQuery("SELECT value FROM test")
1266+
dbt.mustExec("INSERT INTO " + tbl + " VALUES('" + inS + "')")
1267+
rows = dbt.mustQuery("SELECT value FROM " + tbl)
12681268
defer rows.Close()
12691269
if rows.Next() {
12701270
rows.Scan(&out)
@@ -1279,11 +1279,11 @@ func TestLongData(t *testing.T) {
12791279
}
12801280

12811281
// Empty table
1282-
dbt.mustExec("TRUNCATE TABLE test")
1282+
dbt.mustExec("TRUNCATE TABLE " + tbl)
12831283

12841284
// Long binary data
1285-
dbt.mustExec("INSERT INTO test VALUES(?)", in)
1286-
rows = dbt.mustQuery("SELECT value FROM test WHERE 1=?", 1)
1285+
dbt.mustExec("INSERT INTO "+tbl+" VALUES(?)", in)
1286+
rows = dbt.mustQuery("SELECT value FROM "+tbl+" WHERE 1=?", 1)
12871287
defer rows.Close()
12881288
if rows.Next() {
12891289
rows.Scan(&out)

0 commit comments

Comments
 (0)