Skip to content

Commit

Permalink
Revert "introduce runTestsParallel to TestLongData"
Browse files Browse the repository at this point in the history
This reverts commit d3ed0b2.
  • Loading branch information
shogo82148 committed Oct 7, 2023
1 parent d3ed0b2 commit 008e97a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ func TestUint64(t *testing.T) {
}

func TestLongData(t *testing.T) {
runTestsParallel(t, dsn+"&maxAllowedPacket=0", func(dbt *DBTest, tbl string) {
runTests(t, dsn+"&maxAllowedPacket=0", func(dbt *DBTest) {
var maxAllowedPacketSize int
err := dbt.db.QueryRow("select @@max_allowed_packet").Scan(&maxAllowedPacketSize)
if err != nil {
Expand All @@ -1249,7 +1249,7 @@ func TestLongData(t *testing.T) {
maxAllowedPacketSize = 1 << 25
}

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

in := strings.Repeat(`a`, maxAllowedPacketSize+1)
var out string
Expand All @@ -1258,8 +1258,8 @@ func TestLongData(t *testing.T) {
// Long text data
const nonDataQueryLen = 28 // length query w/o value
inS := in[:maxAllowedPacketSize-nonDataQueryLen]
dbt.mustExec("INSERT INTO " + tbl + " VALUES('" + inS + "')")
rows = dbt.mustQuery("SELECT value FROM " + tbl)
dbt.mustExec("INSERT INTO test VALUES('" + inS + "')")
rows = dbt.mustQuery("SELECT value FROM test")
defer rows.Close()
if rows.Next() {
rows.Scan(&out)
Expand All @@ -1274,11 +1274,11 @@ func TestLongData(t *testing.T) {
}

// Empty table
dbt.mustExec("TRUNCATE TABLE " + tbl)
dbt.mustExec("TRUNCATE TABLE test")

// Long binary data
dbt.mustExec("INSERT INTO "+tbl+" VALUES(?)", in)
rows = dbt.mustQuery("SELECT value FROM "+tbl+" WHERE 1=?", 1)
dbt.mustExec("INSERT INTO test VALUES(?)", in)
rows = dbt.mustQuery("SELECT value FROM test WHERE 1=?", 1)
defer rows.Close()
if rows.Next() {
rows.Scan(&out)
Expand Down

0 comments on commit 008e97a

Please sign in to comment.