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