Commit 46468a5a authored by marko's avatar marko

branches/zip: ibuf_insert_low(): Add the parameter entry_size in order to

avoid repeated invocation of the costly function rec_get_converted_size().
parent 20951b8e
......@@ -2553,6 +2553,8 @@ ibuf_insert_low(
/* out: DB_SUCCESS, DB_FAIL, DB_STRONG_FAIL */
ulint mode, /* in: BTR_MODIFY_PREV or BTR_MODIFY_TREE */
const dtuple_t* entry, /* in: index entry to insert */
ulint entry_size,
/* in: rec_get_converted_size(index, entry) */
dict_index_t* index, /* in: index where to insert; must not be
unique or clustered */
ulint space, /* in: space id where to insert */
......@@ -2561,7 +2563,6 @@ ibuf_insert_low(
que_thr_t* thr) /* in: query thread */
{
big_rec_t* dummy_big_rec;
ulint entry_size;
btr_pcur_t pcur;
btr_cur_t* cursor;
dtuple_t* ibuf_entry;
......@@ -2649,8 +2650,6 @@ ibuf_insert_low(
ibuf_enter();
}
entry_size = rec_get_converted_size(index, entry, 0);
heap = mem_heap_create(512);
/* Build the entry which contains the space id and the page number as
......@@ -2823,6 +2822,7 @@ ibuf_insert(
que_thr_t* thr) /* in: query thread */
{
ulint err;
ulint entry_size;
ut_a(trx_sys_multiple_tablespace_format);
ut_ad(dtuple_check_typed(entry));
......@@ -2830,17 +2830,19 @@ ibuf_insert(
ut_a(!dict_index_is_clust(index));
if (rec_get_converted_size(index, entry, 0)
entry_size = rec_get_converted_size(index, entry, 0);
if (entry_size
>= (page_get_free_space_of_empty(dict_table_is_comp(index->table))
/ 2)) {
return(FALSE);
}
err = ibuf_insert_low(BTR_MODIFY_PREV, entry, index,
space, zip_size, page_no, thr);
err = ibuf_insert_low(BTR_MODIFY_PREV, entry, entry_size,
index, space, zip_size, page_no, thr);
if (err == DB_FAIL) {
err = ibuf_insert_low(BTR_MODIFY_TREE, entry, index,
space, zip_size, page_no, thr);
err = ibuf_insert_low(BTR_MODIFY_TREE, entry, entry_size,
index, space, zip_size, page_no, thr);
}
if (err == DB_SUCCESS) {
......
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