mariadb/storage/innobase/btr
Marko Mäkelä 76e064e209 Bug#13807811 BTR_PCUR_RESTORE_POSITION() CAN SKIP A RECORD
This bug has been there at least since MySQL 4.0.9. (Before 4.0.9, the
code probably was even more severely broken.)

btr_pcur_restore_position(): When cursor restoration fails, before
invoking btr_pcur_store_position() move to the previous or next record
unless cursor->rel_pos==BTR_PCUR_ON or the record was not a user
record.

This bug can cause skipped records when btr_pcur_store_position() is
called on the last record of a page. A symptom would be record count
mismatch in CHECK TABLE, or failure to find a record to delete-mark or
update or purge. The following operations should be affected by the
bug:

* row_search_for_mysql(): SELECT, UPDATE, REPLACE, CHECK TABLE,
  (almost anything else than INSERT)

* foreign key CASCADE operations

* row_merge_read_clustered_index(): index creation (since MySQL 5.1
  InnoDB Plugin)

* multi-threaded purge (after MySQL 5.5): not sure, but it might fail
  to purge some records

Not all callers of btr_pcur_restore_position() should be affected.
Anything that asserts or checks that restoration succeeds is
unaffected. For example, cursor restoration on the change buffer tree
should always succeed, because access is being protected by additional
latches. Likewise, rollback, or any code accesses data dictionary
tables while holding dict_sys->mutex should be safe.

rb:967 approved by Jimmy Yang
2012-03-08 14:56:22 +02:00
..
btr0btr.c Revert revno:3452.71.32 (Bug#12612184 fix). 2011-10-26 12:23:57 +03:00
btr0cur.c btr_cur_search_to_nth_level(): Add a debug assertion 2012-01-25 10:15:27 +02:00
btr0pcur.c Bug#13807811 BTR_PCUR_RESTORE_POSITION() CAN SKIP A RECORD 2012-03-08 14:56:22 +02:00
btr0sea.c (partially) Fix Bug#55227 Fix compiler warnings in innodb with gcc 4.6 2010-09-14 11:39:34 +03:00