Hi Heikki, All,
Isn't it time that MySQL's naive locking scheme was cleaned up?
Based on this bug: http://bugs.mysql.com/bug.php?id=16229
It seems like it would make more sense to reverse the locking procedures
in MySQL and their handling by the storage engines. As I understand it,
currently MySQL asks for a table lock in all cases and the storage
engine (InnoDB, in this case) may downgrade that to a row lock.
Wouldn't it make far more sense for MySQL to ask for a row lock, and the
storage engine (MyISAM, in this case) to upgrade that to a page lock,
table lock, etc. as support is available? Basically MySQL should ask
the storage engine for the most granular lock possible, and the storage
engine should upgrade that lock if it is unable to lock with that
It seems like as new features are added, more "stupid" mistakes like
this will occur, if the current locking scheme is kept. It also seems
that storage engines downgrading locks on a whim may introduce more
serious bugs in the future.
MySQL Geek, Yahoo! Inc.
Desk: 408 349 5104