pingcap / mysql-tester

A Golang implementation of MySQL Test Framework
Apache License 2.0
61 stars 62 forks source link

*: get rid of the 'begin .. query .. commit' behaviour #105

Closed tiancaiamao closed 11 months ago

tiancaiamao commented 11 months ago
select @@tidb_current_ts;
set @@autocommit = 0;
select @@tidb_current_ts;

The expected result is 0, but current result is non-zero.

This is because currently, the run query is based on transaction, rather than conn. There is a tester.tx variable and if tx is nil, it execute

t.tx = Begin()
t.executeStatement()
t.Commit()

https://github.com/pingcap/mysql-tester/compare/master...tiancaiamao:conn?expand=1#diff-9e185f29fa355d7dd8fdd9c9ff1d0723b85206aa7d37c4eec93997005dc291ebL685-L702

This behaviour is a significant drawback that makes us impossible to write transaction related tests with mysql-tester.

tiancaiamao commented 11 months ago

/hold

tiancaiamao commented 11 months ago

/unhold