Commit b3f82af5 authored by Marko Mäkelä's avatar Marko Mäkelä

dtuple_convert_big_rec(): Convert the metadata record correctly

parent e71ff91c
...@@ -637,8 +637,12 @@ dtuple_convert_big_rec( ...@@ -637,8 +637,12 @@ dtuple_convert_big_rec(
n_fields = 0; n_fields = 0;
ulint longest_i; ulint longest_i;
if (entry->is_alter_metadata()) { const bool mblob = entry->is_alter_metadata();
longest_i = index->n_uniq + DATA_ROLL_PTR; ut_ad(entry->n_fields >= index->first_user_field() + mblob);
ut_ad(entry->n_fields - mblob <= index->n_fields);
if (mblob) {
longest_i = index->first_user_field();
dfield = dtuple_get_nth_field(entry, longest_i); dfield = dtuple_get_nth_field(entry, longest_i);
local_len = BTR_EXTERN_FIELD_REF_SIZE; local_len = BTR_EXTERN_FIELD_REF_SIZE;
goto ext_write; goto ext_write;
...@@ -659,11 +663,10 @@ dtuple_convert_big_rec( ...@@ -659,11 +663,10 @@ dtuple_convert_big_rec(
dict_index_get_n_fields(index), dict_index_get_n_fields(index),
dict_table_page_size(index->table))) { dict_table_page_size(index->table))) {
longest_i = 0; longest_i = 0;
for (ulint i = index->first_user_field(), longest = 0; for (ulint i = index->first_user_field(), longest = 0;
i < entry->n_fields; i++) { i + mblob < entry->n_fields; i++) {
ulint savings; ulint savings;
dfield = dtuple_get_nth_field(entry, i); dfield = dtuple_get_nth_field(entry, i + mblob);
const dict_field_t* ifield = dict_index_get_nth_field( const dict_field_t* ifield = dict_index_get_nth_field(
index, i); index, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment