我似乎无法在 32 位 x86 Debian 上安装 MySQL 5.0.32 以支持事务隔离级别。
我已将我的问题简化为最简单的形式,并使用 mysql 命令行客户端进行了测试:
-- 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!!!
可能相关,我注意到即使在回滚后该行仍然存在!
所以我的问题是自动提交并没有真正被禁用,因此事务隔离级别实际上被忽略了吗?
再见, 谢尔顿。
最佳答案
默认情况下,您的表似乎是在 MyISAM
中创建的。
它不支持事务。
请运行以下命令:
SELECT @@storage_engine
关于MySQL 事务隔离级别被破坏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1328652/