mariadb/storage/innobase/fts
Vlad Lesin c0eda62aec MDEV-27927 row_sel_try_search_shortcut_for_mysql() does not latch a page, violating read view isolation
btr_search_guess_on_hash() would only acquire an index page latch if it
is invoked with ahi_latch=NULL. If it's invoked from
row_sel_try_search_shortcut_for_mysql() with ahi_latch!=NULL, a page
will not be latched, and row_search_mvcc() will get a pointer to the
record, which can be changed by some other transaction before the record
was stored in result buffer with row_sel_store_mysql_rec() call.

ahi_latch argument of btr_cur_search_to_nth_level_func() and
btr_pcur_open_with_no_init_func() is used only for
row_sel_try_search_shortcut_for_mysql().
btr_cur_search_to_nth_level_func(..., ahi_latch !=0, ...) is invoked
only from btr_pcur_open_with_no_init_func(..., ahi_latch !=0, ...),
which, in turns, is invoked only from
row_sel_try_search_shortcut_for_mysql().

I suppose that separate case with ahi_latch!=0 was intentionally
implemented to protect row_sel_store_mysql_rec() call in
row_search_mvcc() just after row_sel_try_search_shortcut_for_mysql()
call. After the ahi_latch was moved from row_seach_mvcc() to
row_sel_try_search_shortcut_for_mysql(), there is no need in it at all
if btr_search_guess_on_hash() latches a page unconditionally. And if
btr_search_guess_on_hash() latched the page, any access to the record in
row_sel_try_search_shortcut_for_mysql() after btr_pcur_open_with_no_init()
call will be protected with the page latch.

The fix is to remove ahi_latch argument from
btr_pcur_open_with_no_init_func(), btr_cur_search_to_nth_level_func()
and btr_search_guess_on_hash().

There will not be test, as to test it we need to freeze some SELECT
execution in the point between row_sel_try_search_shortcut_for_mysql()
and row_sel_store_mysql_rec() calls in row_search_mvcc(), and to change
the record in some other transaction to let row_sel_store_mysql_rec() to
store changed record in result buffer. Buf we can't do this with the
fix, as the page will be latched in btr_search_guess_on_hash() call.
2022-10-05 17:35:21 +03:00
..
fts0ast.cc Bug #31228694 FTS QUERY WITH LIMIT HIT AN ASSERT 2020-10-26 13:32:30 +02:00
fts0blex.cc Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
fts0blex.l Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
fts0config.cc Merge 10.2 into 10.3 2021-08-18 12:26:58 +03:00
fts0fts.cc MDEV-27927 row_sel_try_search_shortcut_for_mysql() does not latch a page, violating read view isolation 2022-10-05 17:35:21 +03:00
fts0opt.cc MDEV-25975 innodb_disallow_writes causes shutdown to hang 2022-04-06 08:06:49 +03:00
fts0pars.cc Merge 10.1 into 10.2 2018-08-02 08:19:57 +03:00
fts0pars.y Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
fts0plugin.cc Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
fts0que.cc MDEV-27282 InnoDB: Failing assertion: !query->intersection 2022-08-03 20:35:12 +05:30
fts0sql.cc Merge 10.2 into 10.3 2021-08-18 12:26:58 +03:00
fts0tlex.cc Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
fts0tlex.l Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
make_parser.sh Update FSF address 2019-05-11 19:25:02 +03:00
Makefile.query Merge 10.1 into 10.2 2019-04-02 09:14:15 +03:00