Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

btilly (5037)

  (email not shown publicly)

Journal of btilly (5037)

Friday March 23, 2007
11:57 PM

MySQL has row-level locking? Really?

[ #32785 ]

One of the DBAs here was playing around with MySQL. He'd heard that the InnoDB engine has rowlevel locking. So he created an InoDB table called cjg (his initials) with two columns, col1 is a number and col2 is text. He inserted a few rows. He set autocommit off. He then ran:

update cjg
set col1 = 2
where col2 = 1;

Then in another session he tried to insert the value (3, test) into cjg. It blocked.

He tried a variety of things, but was unable to get MySQL 5 to demonstrate that it knew how to do row-level locking.

So..can anyone come up with a demonstration where MySQL clearly does row-level locking? And can you explain why the example he tried to run locked the whole table?


The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.