summaryrefslogtreecommitdiff
path: root/storage/xtradb/row/row0ins.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb/row/row0ins.cc')
-rw-r--r--storage/xtradb/row/row0ins.cc32
1 files changed, 27 insertions, 5 deletions
diff --git a/storage/xtradb/row/row0ins.cc b/storage/xtradb/row/row0ins.cc
index fb719266a16..ae63f0c323b 100644
--- a/storage/xtradb/row/row0ins.cc
+++ b/storage/xtradb/row/row0ins.cc
@@ -2350,7 +2350,7 @@ row_ins_clust_index_entry_low(
{
btr_cur_t cursor;
ulint* offsets = NULL;
- dberr_t err;
+ dberr_t err = DB_SUCCESS;
big_rec_t* big_rec = NULL;
mtr_t mtr;
mem_heap_t* offsets_heap = NULL;
@@ -2380,9 +2380,16 @@ row_ins_clust_index_entry_low(
the function will return in both low_match and up_match of the
cursor sensible values */
- btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, mode,
+ err = btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, mode,
&cursor, 0, __FILE__, __LINE__, &mtr);
+ if (err != DB_SUCCESS) {
+ index->table->is_encrypted = true;
+ index->table->ibd_file_missing = true;
+ mtr_commit(&mtr);
+ goto func_exit;
+ }
+
#ifdef UNIV_DEBUG
{
page_t* page = btr_cur_get_page(&cursor);
@@ -2696,9 +2703,22 @@ row_ins_sec_index_entry_low(
search_mode |= BTR_IGNORE_SEC_UNIQUE;
}
- btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
- search_mode,
- &cursor, 0, __FILE__, __LINE__, &mtr);
+ err = btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
+ search_mode,
+ &cursor, 0, __FILE__, __LINE__, &mtr);
+
+ if (err != DB_SUCCESS) {
+ if (err == DB_DECRYPTION_FAILED) {
+ ib_push_warning(trx->mysql_thd,
+ DB_DECRYPTION_FAILED,
+ "Table %s is encrypted but encryption service or"
+ " used key_id is not available. "
+ " Can't continue reading table.",
+ index->table->name);
+ index->table->is_encrypted = true;
+ }
+ goto func_exit;
+ }
if (cursor.flag == BTR_CUR_INSERT_TO_IBUF) {
/* The insert was buffered during the search: we are done */
@@ -2765,6 +2785,8 @@ row_ins_sec_index_entry_low(
goto func_exit;
}
+ DEBUG_SYNC_C("row_ins_sec_index_entry_dup_locks_created");
+
/* We did not find a duplicate and we have now
locked with s-locks the necessary records to
prevent any insertion of a duplicate by another