mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
branches/zip: Clean up fast index creation.
row_merge_dict_table_get_index(): Add function comment. Use inlined versions of mem_alloc() and mem_free().
This commit is contained in:
parent
f69417c2fe
commit
01a6c8c4cb
1 changed files with 9 additions and 6 deletions
|
@ -116,20 +116,23 @@ struct merge_block_struct {
|
||||||
|
|
||||||
typedef struct merge_block_struct merge_block_t;
|
typedef struct merge_block_struct merge_block_t;
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
Search an index object by name and column names. If several indexes match,
|
||||||
|
return the index with the max id. */
|
||||||
static
|
static
|
||||||
dict_index_t*
|
dict_index_t*
|
||||||
row_merge_dict_table_get_index(
|
row_merge_dict_table_get_index(
|
||||||
/*===========================*/
|
/*===========================*/
|
||||||
dict_table_t* table,
|
/* out: matching index,
|
||||||
const merge_index_def_t*
|
NULL if not found */
|
||||||
index_def)
|
dict_table_t* table, /* in: table */
|
||||||
|
const merge_index_def_t*index_def) /* in: index definition */
|
||||||
{
|
{
|
||||||
ulint i;
|
ulint i;
|
||||||
dict_index_t* index;
|
dict_index_t* index;
|
||||||
const char** column_names;
|
const char** column_names;
|
||||||
|
|
||||||
column_names = (const char**) mem_alloc_noninline(
|
column_names = mem_alloc(index_def->n_fields * sizeof *column_names);
|
||||||
index_def->n_fields * sizeof(char*));
|
|
||||||
|
|
||||||
for (i = 0; i < index_def->n_fields; ++i) {
|
for (i = 0; i < index_def->n_fields; ++i) {
|
||||||
column_names[i] = index_def->fields[i].field_name;
|
column_names[i] = index_def->fields[i].field_name;
|
||||||
|
@ -138,7 +141,7 @@ row_merge_dict_table_get_index(
|
||||||
index = dict_table_get_index_by_max_id(
|
index = dict_table_get_index_by_max_id(
|
||||||
table, index_def->name, column_names, index_def->n_fields);
|
table, index_def->name, column_names, index_def->n_fields);
|
||||||
|
|
||||||
mem_free_noninline(column_names);
|
mem_free(column_names);
|
||||||
|
|
||||||
return(index);
|
return(index);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue