mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
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.
This commit is contained in:
parent
34ab0c0523
commit
2646e38c58
3 changed files with 7 additions and 48 deletions
|
@ -100,32 +100,6 @@ dtuple_coll_cmp(
|
||||||
return(0);
|
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
|
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. */
|
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;
|
ib_longlong n_rows;
|
||||||
ulint mode1;
|
ulint mode1;
|
||||||
ulint mode2;
|
ulint mode2;
|
||||||
void* heap1;
|
mem_heap_t* heap;
|
||||||
void* heap2;
|
|
||||||
|
|
||||||
DBUG_ENTER("records_in_range");
|
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.*/
|
/* MySQL knows about this index and so we must be able to find it.*/
|
||||||
ut_a(index);
|
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);
|
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);
|
dict_index_copy_types(range_end, index, key->key_parts);
|
||||||
|
|
||||||
row_sel_convert_mysql_key_to_innobase(
|
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,
|
n_rows = btr_estimate_n_rows_in_range(index, range_start,
|
||||||
mode1, range_end, mode2);
|
mode1, range_end, mode2);
|
||||||
dtuple_free_for_mysql(heap1);
|
mem_heap_free(heap);
|
||||||
dtuple_free_for_mysql(heap2);
|
|
||||||
|
|
||||||
my_free(key_val_buff2, MYF(0));
|
my_free(key_val_buff2, MYF(0));
|
||||||
|
|
||||||
|
|
|
@ -226,22 +226,6 @@ dtuple_from_fields(
|
||||||
ulint n_fields); /* in: number of 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
|
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. */
|
dtuple_create, but if you want later to set it smaller, you can use this. */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue