InnoDB locks during updates and deletes

Zardosht Kasheff <[email protected]>
Newsgroups gmane.comp.db.mysql.devel
Message-ID <[email protected]>
Hello all,

Suppose I have a table with NO indexes:
create table foo (a int, b int, c int) engine=InnoDB;

and then I run:
begin;
update foo set c=5 where b=1; <-- updates one row


Because there is no index, InnoDB must read the entire table to find
the single row to update.

Here is my question: what type of lock is grabbed for each row read?
Is it a shared (read) lock or an exclusive (write) lock? I know the
row that is modified gets a write lock, but what about the rest of the
rows and the gaps in between the rows that are read but not modified?
Are those exclusive locks or shared locks?

Also, I assume the behavior is similar with respect to deletes?

Thanks
-Zardosht

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.