Bug #42493 | Transactions broken when using Batch Commands | ||
---|---|---|---|
Submitted: | 30 Jan 2009 21:36 | Modified: | 11 Feb 2009 17:12 |
Reporter: | Ael Malinka | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S1 (Critical) |
Version: | 5.1.2 & 5.2.2 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | AllowBatch, transaction |
[30 Jan 2009 21:36]
Ael Malinka
[11 Feb 2009 16:57]
Tonci Grgin
Hi Ael and thanks for your report. There *is* something fishy happening and it's not completely due to AllowBatch... 6 Connect root@localhost on test 6 Query SHOW VARIABLES 6 Query SHOW COLLATION 6 Query SET character_set_results=NULL 6 Init DB test 6 Query SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ 6 Query BEGIN 6 Query CREATE TABLE IF NOT EXISTS bug42493(id INT AUTO_INCREMENT PRIMARY KEY,val VARCHAR(255));INSERT INTO bug42493 VALUES(NULL, 'test');SELECT * FROM bug42493 6 Query ROLLBACK 6 Quit Produces following: mysql> select * from bug42493; +----+------+ | id | val | +----+------+ | 1 | test | +----+------+ 1 row in set (0.00 sec) mysql> show create table bug42493; +----------+-------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------+ | Table | Create Table | +----------+-------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------+ | bug42493 | CREATE TABLE `bug42493` ( `id` int(11) NOT NULL AUTO_INCREMENT, `val` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 | +----------+-------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------+ 1 row in set (0.00 sec) Verified as described with test case attached with MySQL server 5.1.30 on w2k8 x64 localhost using latest c/NET 5.2 sources.
[11 Feb 2009 17:15]
Tonci Grgin
http://dev.mysql.com/doc/refman/5.1/en/implicit-commit.html: CREATE finished previous transaction Now this is first part of your problem. Second part would be using autocommit. Please check this with mysql cl. client: mysql> show variables like "%auto%"; +-----------------------------+-------+ | Variable_name | Value | +-----------------------------+-------+ -- | autocommit | ON | -- +-----------------------------+-------+ 7 rows in set (0.00 sec) So this is actually expected behavior and not a bug.