Bug #58689 | MyISAM Selects locks inserts inside procedure only | ||
---|---|---|---|
Submitted: | 3 Dec 2010 6:02 | Modified: | 31 Jul 2012 1:44 |
Reporter: | sam munkes | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Locking | Severity: | S3 (Non-critical) |
Version: | 5.0, 5.1, 5.6.1 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | insert, locks, myisam, PROCEDURE, SELECT |
[3 Dec 2010 6:02]
sam munkes
[15 Dec 2010 20:24]
Sveta Smirnova
Thank you for the report. Verified as described. Test case for MTR: CREATE TABLE Foo ( ID INT NOT NULL AUTO_INCREMENT, Bar VARCHAR(200), PRIMARY KEY(ID)) ENGINE=MyISAM; INSERT into Foo (Bar) SELECT RAND() FROM information_schema.COLUMNS g, information_schema.COLUMNS g3; INSERT into Foo (Bar) SELECT RAND() FROM information_schema.COLUMNS g, information_schema.COLUMNS g3; INSERT into Foo (Bar) select Bar from Foo; INSERT into Foo (Bar) select Bar from Foo; INSERT into Foo (Bar) select Bar from Foo; INSERT into Foo (Bar) select Bar from Foo; DELIMITER $$; DROP PROCEDURE IF EXISTS InsertProc$$ CREATE PROCEDURE InsertProc(IN vBar VARCHAR(255)) BEGIN INSERT Foo(Bar) VALUES (vBar); END$$ DELIMITER ;$$ --send SELECT Count(*) FROM Foo WHERE INSTR(Bar, 'abcdefg') > 0 sleep 1; connect (addconroot, localhost, root,,); connection addconroot; select now(); INSERT Foo(Bar) VALUES ('xyz1234'); select now(); CALL InsertProc('xyz1234'); select now();
[31 Jul 2012 1:44]
Paul DuBois
Noted in 5.7.0 changelog. Concurrent inserts were blocked by selects if the inserts were generated from within a stored procedure.