Is MySQL transaction isolation levels broken?
I can't seem to get MySQL 5.0.32 on Debian 32-bit Debian to protect transaction isolation levels.
I reduced my problem to its simplest form, tested it using the mysql command line client:
-- On node writer:
--
DROP TABLE test;
CREATE TABLE test (
name VARCHAR(255)
);
set autocommit=0;
set transaction isolation level read committed;
begin;
-- On node reader:
--
set autocommit=0;
set transaction isolation level read committed;
begin;
-- On node writer:
--
INSERT INTO test VALUES ('bob');
-- On node reader:
--
SELECT * from test;
-- Returns the row with bob in it!!!
Probably related, I noticed the row stays even after rollback!
So my problem is that autocommit is really not disabled and therefore transaction isolation levels are effectively ignored?
Ciao, Sheldon.
+2
sheldonh
source
to share
2 answers
By default, your tables are created in MyISAM
.
It doesn't support transactions.
Could you please run the following:
SELECT @@storage_engine
+4
Quassnoi
source
to share
Sorry for the question, but are you sure you are using the innodb table? You should check your default storage engine.
0
lg.
source
to share