diff options
author | apostle <vladkakurin007@gmail.com> | 2022-05-26 22:32:47 +0000 |
---|---|---|
committer | apostle <vladkakurin007@gmail.com> | 2022-05-26 22:32:47 +0000 |
commit | 97d6a6a58c9deac4ebe748370f24a47e372e8d64 (patch) | |
tree | 70ef891aa964ecb72c81e7fe8b2562f566dfb1ab | |
parent | ba8b0a9c8d9d5b7545393c19e73e45ecd1819804 (diff) | |
download | mariadb-git-97d6a6a58c9deac4ebe748370f24a47e372e8d64.tar.gz |
add offsets errors handling
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 898604b9057..55939ab0af8 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -9527,7 +9527,8 @@ ha_innobase::sample_next( mtr.start(); dict_index_t* index= innobase_get_index(MAX_KEY); bool res= btr_pcur_open_at_rnd_pos(index, BTR_SEARCH_LEAF, pcur, &mtr); - if(!res) { + if(!res) + { mtr.commit(); return HA_ERR_KEY_NOT_FOUND; } @@ -9537,6 +9538,13 @@ ha_innobase::sample_next( mem_heap_t* heap= NULL; offsets= rec_get_offsets(rec, index, offsets, index->n_core_fields, ULINT_UNDEFINED, &heap); ut_ad(offsets); + if (!offsets) + { + mtr.commit(); + if (heap) + mem_heap_free(heap); + return HA_ERR_INTERNAL_ERROR; + } res= row_sel_store_mysql_rec( buf, m_prebuilt, rec, NULL, true, |