diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-28 20:47:27 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-28 20:47:27 +0200 |
commit | 3a393f8c8422f52934f54f000068a13764a7d599 (patch) | |
tree | 1e4d48b1bbf2d979643b5bdd87b624fd6f25c1ae /storage/innobase/btr/btr0pcur.cc | |
parent | 3fe03693092ad0191437d9dd92fa4a714c7b0445 (diff) | |
download | mariadb-git-3a393f8c8422f52934f54f000068a13764a7d599.tar.gz |
Merge dict_index_copy_rec_order_prefix() to its only caller
btr_pcur_store_position(): Merge the code from
dict_index_copy_rec_order_prefix().
Diffstat (limited to 'storage/innobase/btr/btr0pcur.cc')
-rw-r--r-- | storage/innobase/btr/btr0pcur.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/storage/innobase/btr/btr0pcur.cc b/storage/innobase/btr/btr0pcur.cc index ac28cd1e665..3f898f7d033 100644 --- a/storage/innobase/btr/btr0pcur.cc +++ b/storage/innobase/btr/btr0pcur.cc @@ -174,10 +174,25 @@ btr_pcur_store_position( cursor->rel_pos = BTR_PCUR_ON; } - cursor->old_rec = dict_index_copy_rec_order_prefix( - index, rec, &cursor->old_n_fields, - &cursor->old_rec_buf, &cursor->buf_size); + if (index->is_ibuf()) { + ut_ad(!index->table->not_redundant()); + cursor->old_n_fields = rec_get_n_fields_old(rec); + } else if (page_rec_is_leaf(rec)) { + cursor->old_n_fields = dict_index_get_n_unique_in_tree(index); + } else if (index->is_spatial()) { + ut_ad(dict_index_get_n_unique_in_tree_nonleaf(index) + == DICT_INDEX_SPATIAL_NODEPTR_SIZE); + /* For R-tree, we have to compare + the child page numbers as well. */ + cursor->old_n_fields = DICT_INDEX_SPATIAL_NODEPTR_SIZE + 1; + } else { + cursor->old_n_fields = dict_index_get_n_unique_in_tree(index); + } + cursor->old_rec = rec_copy_prefix_to_buf(rec, index, + cursor->old_n_fields, + &cursor->old_rec_buf, + &cursor->buf_size); cursor->block_when_stored = block; /* Function try to check if block is S/X latch. */ |