Commit 6b3579a8 authored by marko's avatar marko

branches/zip: Clean up some non-inlined functions.

dtuple_create_for_mysql(), dtuple_free_for_mysql(): Remove.

ha_innobase::records_in_range(): Use mem_heap_create(), mem_heap_free(),
and dtuple_create() instead of the removed functions above.  Since r1587,
InnoDB C++ functions can invoke inlined C functions.
parent 03a7cb22
......@@ -100,32 +100,6 @@ dtuple_coll_cmp(
return(0);
}
/*************************************************************************
Creates a dtuple for use in MySQL. */
dtuple_t*
dtuple_create_for_mysql(
/*====================*/
/* out, own created dtuple */
void** heap, /* out: created memory heap */
ulint n_fields) /* in: number of fields */
{
*heap = (void*)mem_heap_create(500);
return(dtuple_create(*((mem_heap_t**)heap), n_fields));
}
/*************************************************************************
Frees a dtuple used in MySQL. */
void
dtuple_free_for_mysql(
/*==================*/
void* heap) /* in: memory heap where tuple was created */
{
mem_heap_free((mem_heap_t*)heap);
}
/*************************************************************************
Sets number of fields used in a tuple. Normally this is set in
dtuple_create, but if you want later to set it smaller, you can use this. */
......
......@@ -5497,8 +5497,7 @@ ha_innobase::records_in_range(
ib_longlong n_rows;
ulint mode1;
ulint mode2;
void* heap1;
void* heap2;
mem_heap_t* heap;
DBUG_ENTER("records_in_range");
......@@ -5520,10 +5519,13 @@ ha_innobase::records_in_range(
/* MySQL knows about this index and so we must be able to find it.*/
ut_a(index);
range_start = dtuple_create_for_mysql(&heap1, key->key_parts);
heap = mem_heap_create(2 * (key->key_parts * sizeof(dfield_t)
+ sizeof(dtuple_t)));
range_start = dtuple_create(heap, key->key_parts);
dict_index_copy_types(range_start, index, key->key_parts);
range_end = dtuple_create_for_mysql(&heap2, key->key_parts);
range_end = dtuple_create(heap, key->key_parts);
dict_index_copy_types(range_end, index, key->key_parts);
row_sel_convert_mysql_key_to_innobase(
......@@ -5550,8 +5552,7 @@ ha_innobase::records_in_range(
n_rows = btr_estimate_n_rows_in_range(index, range_start,
mode1, range_end, mode2);
dtuple_free_for_mysql(heap1);
dtuple_free_for_mysql(heap2);
mem_heap_free(heap);
my_free(key_val_buff2, MYF(0));
......
......@@ -226,22 +226,6 @@ dtuple_from_fields(
ulint n_fields); /* in: number of fields */
/*************************************************************************
Creates a dtuple for use in MySQL. */
dtuple_t*
dtuple_create_for_mysql(
/*====================*/
/* out, own created dtuple */
void** heap, /* out: created memory heap */
ulint n_fields); /* in: number of fields */
/*************************************************************************
Frees a dtuple used in MySQL. */
void
dtuple_free_for_mysql(
/*==================*/
void* heap);
/*************************************************************************
Sets number of fields used in a tuple. Normally this is set in
dtuple_create, but if you want later to set it smaller, you can use this. */
......
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