diff options
Diffstat (limited to 'storage/innobase/row/row0sel.cc')
-rw-r--r-- | storage/innobase/row/row0sel.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 5f5c6fe6c44..13af09361be 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -4770,7 +4770,7 @@ wait_table_again: } else if (dtuple_get_n_fields(search_tuple) > 0) { pcur->old_rec = nullptr; - if (dict_index_is_spatial(index)) { + if (index->is_spatial()) { if (!prebuilt->rtr_info) { prebuilt->rtr_info = rtr_create_rtr_info( set_also_gap_locks, true, thr, @@ -4786,10 +4786,14 @@ wait_table_again: prebuilt->rtr_info->search_tuple = search_tuple; prebuilt->rtr_info->search_mode = mode; } - } - err = btr_pcur_open_with_no_init(search_tuple, mode, - BTR_SEARCH_LEAF, pcur, &mtr); + err = rtr_search_leaf(pcur, thr, search_tuple, mode, + &mtr); + } else { + err = btr_pcur_open_with_no_init(search_tuple, mode, + BTR_SEARCH_LEAF, + pcur, &mtr); + } if (err != DB_SUCCESS) { page_corrupted: @@ -5766,8 +5770,7 @@ next_rec_after_check: if (spatial_search) { /* No need to do store restore for R-tree */ - mtr.commit(); - mtr.start(); + mtr.rollback_to_savepoint(0); } else if (mtr_extra_clust_savepoint) { /* We must release any clustered index latches if we are moving to the next non-clustered |