Skip to content

mysql tester crashes when transactions is not started and we commit #30

@Alkaagr81

Description

@Alkaagr81
connect (con1,localhost,root,,test);

connection con1;
COMMIT;

so error message is

WARN[0000] Create new db&{0 {root:@tcp(127.0.0.1:4001)/test?strict=true&time_zone=%27Asia%2FShanghai%27 0x1059168} 0 {0 0} [0xc0001ee630] map[] 0 1 0xc000026240 false map[0xc0001ee630:map[0xc0001ee630:true]] map[] 0 0 0 0 <nil> 0 0 0 0 0x49cfa0} 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x4e6a06]

goroutine 7 [running]:
database/sql.(*Tx).Commit(0x0, 0x8edf28, 0x1)
	/usr/local/go/src/database/sql/sql.go:2151 +0x26
main.(*tester).commit(...)
	/home/morgo/go/pkg/mod/github.com/pingcap/mysql-tester@v0.0.0-20211026071309-3ee4da8b351d/src/main.go:673
main.(*tester).stmtExecute(0xc0001ee510, 0xc000024b57, 0x6, 0xc000024b57, 0x7, 0x2b, 0x2, 0x8fd648, 0xc00012e100, 0x1, ...)
	/home/morgo/go/pkg/mod/github.com/pingcap/mysql-tester@v0.0.0-20211026071309-3ee4da8b351d/src/main.go:566 +0xb6
main.(*tester).execute(0xc0001ee510, 0xc000024b57, 0x6, 0xc000024b57, 0x7, 0x2b, 0x2, 0x0, 0x0)
	/home/morgo/go/pkg/mod/github.com/pingcap/mysql-tester@v0.0.0-20211026071309-3ee4da8b351d/src/main.go:621 +0x13d
main.(*tester).Run(0xc0001ee510, 0x0, 0x0)
	/home/morgo/go/pkg/mod/github.com/pingcap/mysql-tester@v0.0.0-20211026071309-3ee4da8b351d/src/main.go:307 +0x666
main.testBatch.Run(0xc00000c1e0, 0x1, 0x1e)
	/home/morgo/go/pkg/mod/github.com/pingcap/mysql-tester@v0.0.0-20211026071309-3ee4da8b351d/src/main.go:928 +0xb3
created by main.executeTests
	/home/morgo/go/pkg/mod/github.com/pingcap/mysql-tester@v0.0.0-20211026071309-3ee4da8b351d/src/main.go:958 +0xc5
+ echo 'tidb-server(PID: 295933) stopped'
tidb-server(PID: 295933) stopped
+ kill -9 295933

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions