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

Fix a few FIXMEs

btr_cur_optimistic_update(), btr_cur_pessimistic_update():
Convert the page to flexible format if needed.

dtuple_convert_big_rec(): Use the least efficient format.
parent c5998d99
......@@ -4452,9 +4452,10 @@ btr_cur_optimistic_update(
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
if (page_is_comp(page) && index->dual_format()) {
/* The page must be converted into ROW_FORMAT=REDUNDANT
in a pessimistic operation. */
return DB_OVERFLOW;
/* Convert to flexible format */
btr_page_reorganize(btr_cur_get_page_cur(cursor), index, mtr);
/* FIXME: handle page overflow */
ut_ad(!page_is_comp(page));
}
if (UNIV_LIKELY(!update->is_metadata())
......@@ -4834,11 +4835,12 @@ btr_cur_pessimistic_update(
return(err);
}
#if 1 // FIXME: convert to ROW_FORMAT=REDUNDANT
if (page_is_comp(page) && page_is_leaf(page) && index->dual_format()) {
return DB_TOO_BIG_RECORD;
/* Convert to flexible format */
btr_page_reorganize(btr_cur_get_page_cur(cursor), index, mtr);
/* FIXME: handle page overflow */
ut_ad(!page_is_comp(page));
}
#endif
rec = btr_cur_get_rec(cursor);
......
......@@ -627,6 +627,9 @@ dtuple_convert_big_rec(
ut_ad(entry->n_fields >= index->first_user_field() + mblob);
ut_ad(entry->n_fields - mblob <= index->n_fields);
const bool comp = index->table->not_redundant()
&& !index->table->dual_format();
if (mblob) {
longest_i = index->first_user_field();
dfield = dtuple_get_nth_field(entry, longest_i);
......@@ -643,10 +646,12 @@ dtuple_convert_big_rec(
local_len = BTR_EXTERN_FIELD_REF_SIZE;
}
while (page_zip_rec_needs_ext(rec_get_converted_size(REC_FMT_LEAF,//FIXME
index, entry,
*n_ext),
dict_table_is_comp(index->table),//FIXME: block
while (page_zip_rec_needs_ext(rec_get_converted_size(
comp
? REC_FMT_LEAF
: REC_FMT_LEAF_FLEXIBLE,
index, entry, *n_ext),
comp,
index->n_fields,
dict_table_page_size(index->table))) {
longest_i = 0;
......
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