Bug #6747 | innodb_locks_unsafe_for_binlog still uses next-key locking | ||
---|---|---|---|
Submitted: | 22 Nov 2004 5:59 | Modified: | 30 Nov 2004 11:58 |
Reporter: | Yoshinori Matsunobu | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 4.1.7 | OS: | Linux (RedHat Enterprise Linux AS 3.0) |
Assigned to: | Bugs System | CPU Architecture: | Any |
[22 Nov 2004 5:59]
Yoshinori Matsunobu
[22 Nov 2004 7:52]
Yoshinori Matsunobu
Thank you for your quick reply. I understand that insert uses next-key locking. But, from innodb_lock_monitor result, update using index seems to use next-key locking. --SQL statement start transaction; update table2 set col1=110 where col1=102; --The result of innodb_lock_monitor ---TRANSACTION 0 5891, ACTIVE 28 sec, process no 19598, OS thread id 40971 4 lock struct(s), heap size 320, undo log entries 1 MySQL thread id 2, query id 13 192.168.0.1 root TABLE LOCK table `oss1/table2` trx id 0 5891 lock mode IX RECORD LOCKS space id 0 page no 210 n bits 80 index `col1` of table `oss1/table2 ` trx id 0 5891 lock_mode X locks rec but not gap Record lock, heap no 4 PHYSICAL RECORD: n_fields 2; 1-byte offs TRUE; info bits 32 0: len 4; hex 80000066; asc f;; 1: len 6; hex 00000007d107; asc ;; RECORD LOCKS space id 0 page no 192 n bits 80 index `GEN_CLUST_INDEX` of table ` oss1/table2` trx id 0 5891 lock_mode X locks rec but not gap Record lock, heap no 4 PHYSICAL RECORD: n_fields 4; 1-byte offs TRUE; info bits 0 0: len 6; hex 00000007d107; asc ;; 1: len 6; hex 000000001703; asc ;; 2: len 7; hex 00000000ce0737; asc 7;; 3: len 4; hex 8000006e; asc n; ; RECORD LOCKS space id 0 page no 210 n bits 80 index `col1` of table `oss1/table2 ` trx id 0 5891 lock_mode X locks gap before rec Record lock, heap no 5 PHYSICAL RECORD: n_fields 2; 1-byte offs TRUE; info bits 0 0: len 4; hex 80000067; asc g;; 1: len 6; hex 00000007d108; asc ;; The last record says "lock_mode X locks gap before rec". It means that update(using index) uses next-key locking , isn't it?
[22 Nov 2004 8:43]
Jan Lindström
Thank you for your example. I could repeat this problem using 4.1.8. I'm currently working on patch to fix this problem.
[30 Nov 2004 11:58]
Jan Lindström
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html