Take the 2-minute tour ×


  `b` int(11) DEFAULT NULL,

If in on one connection, I execute something like INSERT INTO test VALUES (0, sleep(60)) and in a second process, INSERT INTO test VALUES (1, 0), the second insert will wait for the first to complete. Note that innodb_table_locks is off. Is there something I'm missing, or is this just not possible?


As Randy points out below, I created a MyISAM table during testing and then assumed that concurrent inserts weren't possible for my other tables (which are InnoDB). I actually don't have a problem with InnoDB tables.

share|improve this question
concurrent inserts should never be a problem on a database. however, why are you doing a sleep60? This sounds like a threading problem, not a database problem. Is it necessary for you to do the sleep first? –  jcolebrand Feb 2 '11 at 17:08
Some database engines don't support concurrent inserts. Some support concurrent inserts only with a given set of configuration parameters. In any case, the sleep was simply to ensure that the first insert was still running while the second insert executed, purely to show that concurrent inserts weren't working. –  Michael Mior Feb 2 '11 at 21:14

1 Answer 1

up vote 3 down vote accepted

You might notice the problem is :


Try changing that to:

share|improve this answer
Wow...that's embarrassing. Forget I asked the question. It was obviously too late a night. Thanks though Randy :) Apparently I can't vote down my own post, everyone else feel free to. –  Michael Mior Feb 2 '11 at 21:12
Hey bro, we all been there! –  randy melder Feb 2 '11 at 21:49
@Michael Mior This is all the reason to leave it up. Somebody else will likely facepalm as well and then you'll get the credit (unadvertised of course) for helping them. –  jcolebrand Feb 2 '11 at 22:10

Your Answer


