Commit 2c4aaa9e authored by marko's avatar marko

branches/zip: Minor cleanup.

row_create_index_graph_for_mysql(): Move from row0mysql.c to row0merge.c
and rename to row_merge_create_index_graph().  Also change the function
comment to say that the function will create and execute the query graph
for creating the index.

row_merge_create_index(): Remove redundant assignment to trx->error_state.
parent acf84dfb
......@@ -489,16 +489,6 @@ row_check_table_for_mysql(
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
handle */
#endif /* !UNIV_HOTBACKUP */
/*************************************************************************
Create query graph for a index creation */
ulint
row_create_index_graph_for_mysql(
/*=============================*/
/* out: DB_SUCCESS or error code */
trx_t* trx, /* in: trx */
dict_table_t* table, /* in: table */
dict_index_t* index); /* in: index */
/* A struct describing a place for an individual column in the MySQL
row format which is presented to the table handler in ha_innobase.
......
......@@ -2091,6 +2091,43 @@ row_merge_rename_tables(
return(err);
}
/*************************************************************************
Create and execute a query graph for creating an index. */
static
ulint
row_merge_create_index_graph(
/*=========================*/
/* out: DB_SUCCESS or error code */
trx_t* trx, /* in: trx */
dict_table_t* table, /* in: table */
dict_index_t* index) /* in: index */
{
ind_node_t* node; /* Index creation node */
mem_heap_t* heap; /* Memory heap */
que_thr_t* thr; /* Query thread */
ulint err;
ut_ad(trx);
ut_ad(table);
ut_ad(index);
heap = mem_heap_create(512);
index->table = table;
node = ind_create_graph_create(index, heap);
thr = pars_complete_graph_for_exec(node, trx, heap);
ut_a(thr == que_fork_start_command(que_node_get_parent(thr)));
que_run_threads(thr);
err = trx->error_state;
que_graph_free((que_t*) que_node_get_parent(thr));
return(err);
}
/*************************************************************************
Create the index and load in to the dictionary. */
......@@ -2134,7 +2171,7 @@ row_merge_create_index(
/* Add the index to SYS_INDEXES, this will use the prototype
to create an entry in SYS_INDEXES. */
err = row_create_index_graph_for_mysql(trx, table, index);
err = row_merge_create_index_graph(trx, table, index);
if (err == DB_SUCCESS) {
......@@ -2150,7 +2187,6 @@ row_merge_create_index(
index->trx_id = trx->id;
#endif /* ROW_MERGE_IS_INDEX_USABLE */
} else {
trx->error_state = err;
index = NULL;
}
......
......@@ -4080,39 +4080,4 @@ row_check_table_for_mysql(
return(ret);
}
/*************************************************************************
Create query graph for an index creation */
ulint
row_create_index_graph_for_mysql(
/*=============================*/
/* out: DB_SUCCESS or error code */
trx_t* trx, /* in: trx */
dict_table_t* table, /* in: table */
dict_index_t* index) /* in: index */
{
ind_node_t* node; /* Index creation node */
mem_heap_t* heap; /* Memory heap */
que_thr_t* thr; /* Query thread */
ulint err;
ut_ad(trx && index);
heap = mem_heap_create(512);
index->table = table;
node = ind_create_graph_create(index, heap);
thr = pars_complete_graph_for_exec(node, trx, heap);
ut_a(thr == que_fork_start_command(que_node_get_parent(thr)));
que_run_threads(thr);
err = trx->error_state;
que_graph_free((que_t*) que_node_get_parent(thr));
return(err);
}
#endif /* !UNIV_HOTBACKUP */
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