2009-08-25 181 views
2

我似乎無法獲得32位x86 Debian上的MySQL 5.0.32以履行事務隔離級別。MySQL事務隔離級別破壞?

我已經減少了我的問題,以最簡單的形式,與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!!! 

可能與,我注意到,該行甚至回滾後仍然!

所以我的問題是,autocommit並沒有真正禁用,並且事務隔離級別因此被有效忽略?

Ciao, Sheldon。

回答

4

默認情況下,您的表似乎是在MyISAM中創建的。

它不支持交易。

能否請您運行以下命令:

SELECT @@storage_engine 
+0

看起來像最可能的解釋。 – MarkR 2009-08-25 20:09:05

0

對不起,我的問題,但你確定你是usign InnoDB表?你必須檢查你的默認存儲引擎。