Commit 37298128 authored by osku's avatar osku

Add dict_table_get_col_name() in preparation for getting rid of

dict_col_t::name, and use it instead of col->name everywhere.
parent 799dfe0f
...@@ -129,6 +129,7 @@ dict_create_sys_columns_tuple( ...@@ -129,6 +129,7 @@ dict_create_sys_columns_tuple(
dict_col_t* column; dict_col_t* column;
dfield_t* dfield; dfield_t* dfield;
byte* ptr; byte* ptr;
const char* col_name;
ut_ad(table && heap); ut_ad(table && heap);
...@@ -155,7 +156,8 @@ dict_create_sys_columns_tuple( ...@@ -155,7 +156,8 @@ dict_create_sys_columns_tuple(
/* 4: NAME ---------------------------*/ /* 4: NAME ---------------------------*/
dfield = dtuple_get_nth_field(entry, 2); dfield = dtuple_get_nth_field(entry, 2);
dfield_set_data(dfield, column->name, ut_strlen(column->name)); col_name = dict_table_get_col_name(table, i);
dfield_set_data(dfield, col_name, ut_strlen(col_name));
/* 5: MTYPE --------------------------*/ /* 5: MTYPE --------------------------*/
dfield = dtuple_get_nth_field(entry, 3); dfield = dtuple_get_nth_field(entry, 3);
......
...@@ -143,6 +143,7 @@ dict_index_copy( ...@@ -143,6 +143,7 @@ dict_index_copy(
/*============*/ /*============*/
dict_index_t* index1, /* in: index to copy to */ dict_index_t* index1, /* in: index to copy to */
dict_index_t* index2, /* in: index to copy from */ dict_index_t* index2, /* in: index to copy from */
dict_table_t* table, /* in: table */
ulint start, /* in: first position to copy */ ulint start, /* in: first position to copy */
ulint end); /* in: last position to copy */ ulint end); /* in: last position to copy */
/*********************************************************************** /***********************************************************************
...@@ -191,6 +192,7 @@ static ...@@ -191,6 +192,7 @@ static
void void
dict_col_print_low( dict_col_print_low(
/*===============*/ /*===============*/
dict_table_t* table, /* in: table */
dict_col_t* col); /* in: column */ dict_col_t* col); /* in: column */
/************************************************************************** /**************************************************************************
Prints an index data. */ Prints an index data. */
...@@ -373,6 +375,25 @@ dict_table_get_index_noninline( ...@@ -373,6 +375,25 @@ dict_table_get_index_noninline(
return(dict_table_get_index(table, name)); return(dict_table_get_index(table, name));
} }
/**************************************************************************
Returns a column's name. */
const char*
dict_table_get_col_name(
/*====================*/
/* out: column name. NOTE: not guaranteed to
stay valid if table is modified in any way
(columns added, etc.). */
dict_table_t* table, /* in: table */
ulint i) /* in: column number */
{
ut_ad(table);
ut_ad(i < table->n_def);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
return(dict_table_get_nth_col(table, i)->name);
}
/************************************************************************ /************************************************************************
Initializes the autoinc counter. It is not an error to initialize an already Initializes the autoinc counter. It is not an error to initialize an already
initialized counter. */ initialized counter. */
...@@ -1474,10 +1495,9 @@ dict_index_find_cols( ...@@ -1474,10 +1495,9 @@ dict_index_find_cols(
dict_field_t* field = dict_index_get_nth_field(index, i); dict_field_t* field = dict_index_get_nth_field(index, i);
for (j = 0; j < table->n_cols; j++) { for (j = 0; j < table->n_cols; j++) {
dict_col_t* col = dict_table_get_nth_col(table, j); if (!strcmp(dict_table_get_col_name(table, j),
field->name)) {
if (!strcmp(col->name, field->name)) { field->col = dict_table_get_nth_col(table, j);
field->col = col;
goto found; goto found;
} }
...@@ -1498,12 +1518,16 @@ void ...@@ -1498,12 +1518,16 @@ void
dict_index_add_col( dict_index_add_col(
/*===============*/ /*===============*/
dict_index_t* index, /* in: index */ dict_index_t* index, /* in: index */
dict_table_t* table, /* in: table */
dict_col_t* col, /* in: column */ dict_col_t* col, /* in: column */
ulint prefix_len) /* in: column prefix length */ ulint prefix_len) /* in: column prefix length */
{ {
dict_field_t* field; dict_field_t* field;
const char* col_name;
col_name = dict_table_get_col_name(table, dict_col_get_no(col));
dict_mem_index_add_field(index, col->name, prefix_len); dict_mem_index_add_field(index, col_name, prefix_len);
field = dict_index_get_nth_field(index, index->n_def - 1); field = dict_index_get_nth_field(index, index->n_def - 1);
...@@ -1535,6 +1559,7 @@ dict_index_copy( ...@@ -1535,6 +1559,7 @@ dict_index_copy(
/*============*/ /*============*/
dict_index_t* index1, /* in: index to copy to */ dict_index_t* index1, /* in: index to copy to */
dict_index_t* index2, /* in: index to copy from */ dict_index_t* index2, /* in: index to copy from */
dict_table_t* table, /* in: table */
ulint start, /* in: first position to copy */ ulint start, /* in: first position to copy */
ulint end) /* in: last position to copy */ ulint end) /* in: last position to copy */
{ {
...@@ -1546,7 +1571,8 @@ dict_index_copy( ...@@ -1546,7 +1571,8 @@ dict_index_copy(
for (i = start; i < end; i++) { for (i = start; i < end; i++) {
field = dict_index_get_nth_field(index2, i); field = dict_index_get_nth_field(index2, i);
dict_index_add_col(index1, field->col, field->prefix_len); dict_index_add_col(index1, table, field->col,
field->prefix_len);
} }
} }
...@@ -1647,7 +1673,7 @@ dict_index_build_internal_clust( ...@@ -1647,7 +1673,7 @@ dict_index_build_internal_clust(
new_index->id = index->id; new_index->id = index->id;
/* Copy the fields of index */ /* Copy the fields of index */
dict_index_copy(new_index, index, 0, index->n_fields); dict_index_copy(new_index, index, table, 0, index->n_fields);
if (UNIV_UNLIKELY(index->type & DICT_UNIVERSAL)) { if (UNIV_UNLIKELY(index->type & DICT_UNIVERSAL)) {
/* No fixed number of fields determines an entry uniquely */ /* No fixed number of fields determines an entry uniquely */
...@@ -1682,19 +1708,21 @@ dict_index_build_internal_clust( ...@@ -1682,19 +1708,21 @@ dict_index_build_internal_clust(
#endif #endif
if (!(index->type & DICT_UNIQUE)) { if (!(index->type & DICT_UNIQUE)) {
dict_index_add_col(new_index, dict_index_add_col(new_index, table,
dict_table_get_sys_col dict_table_get_sys_col(
(table, DATA_ROW_ID), 0); table, DATA_ROW_ID),
0);
trx_id_pos++; trx_id_pos++;
} }
dict_index_add_col(new_index, dict_index_add_col(new_index, table,
dict_table_get_sys_col dict_table_get_sys_col(table, DATA_TRX_ID),
(table, DATA_TRX_ID), 0); 0);
dict_index_add_col(new_index, dict_index_add_col(new_index, table,
dict_table_get_sys_col dict_table_get_sys_col(table,
(table, DATA_ROLL_PTR), 0); DATA_ROLL_PTR),
0);
for (i = 0; i < trx_id_pos; i++) { for (i = 0; i < trx_id_pos; i++) {
...@@ -1745,7 +1773,7 @@ dict_index_build_internal_clust( ...@@ -1745,7 +1773,7 @@ dict_index_build_internal_clust(
ut_ad(col->type.mtype != DATA_SYS); ut_ad(col->type.mtype != DATA_SYS);
if (!indexed[col->ind]) { if (!indexed[col->ind]) {
dict_index_add_col(new_index, col, 0); dict_index_add_col(new_index, table, col, 0);
} }
} }
...@@ -1805,7 +1833,7 @@ dict_index_build_internal_non_clust( ...@@ -1805,7 +1833,7 @@ dict_index_build_internal_non_clust(
new_index->id = index->id; new_index->id = index->id;
/* Copy fields from index to new_index */ /* Copy fields from index to new_index */
dict_index_copy(new_index, index, 0, index->n_fields); dict_index_copy(new_index, index, table, 0, index->n_fields);
/* Remember the table columns already contained in new_index */ /* Remember the table columns already contained in new_index */
indexed = mem_alloc(table->n_cols * sizeof *indexed); indexed = mem_alloc(table->n_cols * sizeof *indexed);
...@@ -1833,7 +1861,7 @@ dict_index_build_internal_non_clust( ...@@ -1833,7 +1861,7 @@ dict_index_build_internal_non_clust(
field = dict_index_get_nth_field(clust_index, i); field = dict_index_get_nth_field(clust_index, i);
if (!indexed[field->col->ind]) { if (!indexed[field->col->ind]) {
dict_index_add_col(new_index, field->col, dict_index_add_col(new_index, table, field->col,
field->prefix_len); field->prefix_len);
} }
} }
...@@ -1976,6 +2004,7 @@ dict_foreign_find_index( ...@@ -1976,6 +2004,7 @@ dict_foreign_find_index(
only has an effect if types_idx != NULL */ only has an effect if types_idx != NULL */
{ {
dict_index_t* index; dict_index_t* index;
dict_field_t* field;
const char* col_name; const char* col_name;
ulint i; ulint i;
...@@ -1985,10 +2014,12 @@ dict_foreign_find_index( ...@@ -1985,10 +2014,12 @@ dict_foreign_find_index(
if (dict_index_get_n_fields(index) >= n_cols) { if (dict_index_get_n_fields(index) >= n_cols) {
for (i = 0; i < n_cols; i++) { for (i = 0; i < n_cols; i++) {
col_name = dict_index_get_nth_field(index, i) field = dict_index_get_nth_field(index, i);
->col->name;
if (dict_index_get_nth_field(index, i) col_name = dict_table_get_col_name(
->prefix_len != 0) { table, dict_col_get_no(field->col));
if (field->prefix_len != 0) {
/* We do not accept column prefix /* We do not accept column prefix
indexes here */ indexes here */
...@@ -2400,7 +2431,6 @@ dict_scan_col( ...@@ -2400,7 +2431,6 @@ dict_scan_col(
const char** name) /* out,own: the column name; NULL if no name const char** name) /* out,own: the column name; NULL if no name
was scannable */ was scannable */
{ {
dict_col_t* col;
ulint i; ulint i;
*success = FALSE; *success = FALSE;
...@@ -2418,14 +2448,15 @@ dict_scan_col( ...@@ -2418,14 +2448,15 @@ dict_scan_col(
} else { } else {
for (i = 0; i < dict_table_get_n_cols(table); i++) { for (i = 0; i < dict_table_get_n_cols(table); i++) {
col = dict_table_get_nth_col(table, i); const char* col_name = dict_table_get_col_name(
table, i);
if (0 == innobase_strcasecmp(col->name, *name)) { if (0 == innobase_strcasecmp(col_name, *name)) {
/* Found */ /* Found */
*success = TRUE; *success = TRUE;
*column = col; *column = dict_table_get_nth_col(table, i);
strcpy((char*) *name, col->name); strcpy((char*) *name, col_name);
break; break;
} }
...@@ -3022,8 +3053,10 @@ dict_create_foreign_constraints_low( ...@@ -3022,8 +3053,10 @@ dict_create_foreign_constraints_low(
foreign->foreign_col_names = mem_heap_alloc(foreign->heap, foreign->foreign_col_names = mem_heap_alloc(foreign->heap,
i * sizeof(void*)); i * sizeof(void*));
for (i = 0; i < foreign->n_fields; i++) { for (i = 0; i < foreign->n_fields; i++) {
foreign->foreign_col_names[i] = mem_heap_strdup foreign->foreign_col_names[i] = mem_heap_strdup(
(foreign->heap, columns[i]->name); foreign->heap,
dict_table_get_col_name(table,
dict_col_get_no(columns[i])));
} }
ptr = dict_scan_table_name(cs, ptr, &referenced_table, name, ptr = dict_scan_table_name(cs, ptr, &referenced_table, name,
...@@ -3935,7 +3968,7 @@ dict_table_print_low( ...@@ -3935,7 +3968,7 @@ dict_table_print_low(
(ulong) table->stat_n_rows); (ulong) table->stat_n_rows);
for (i = 0; i + 1 < (ulint) table->n_cols; i++) { for (i = 0; i + 1 < (ulint) table->n_cols; i++) {
dict_col_print_low(dict_table_get_nth_col(table, i)); dict_col_print_low(table, dict_table_get_nth_col(table, i));
fputs("; ", stderr); fputs("; ", stderr);
} }
...@@ -3969,6 +4002,7 @@ static ...@@ -3969,6 +4002,7 @@ static
void void
dict_col_print_low( dict_col_print_low(
/*===============*/ /*===============*/
dict_table_t* table, /* in: table */
dict_col_t* col) /* in: column */ dict_col_t* col) /* in: column */
{ {
dtype_t* type; dtype_t* type;
...@@ -3978,7 +4012,8 @@ dict_col_print_low( ...@@ -3978,7 +4012,8 @@ dict_col_print_low(
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
type = dict_col_get_type(col); type = dict_col_get_type(col);
fprintf(stderr, "%s: ", col->name); fprintf(stderr, "%s: ", dict_table_get_col_name(table,
dict_col_get_no(col)));
dtype_print(type); dtype_print(type);
} }
......
...@@ -26,6 +26,25 @@ Created 4/24/1996 Heikki Tuuri ...@@ -26,6 +26,25 @@ Created 4/24/1996 Heikki Tuuri
#include "srv0start.h" #include "srv0start.h"
#include "srv0srv.h" #include "srv0srv.h"
/********************************************************************
Returns TRUE if index's i'th column's name is 'name' .*/
static
ibool
name_of_col_is(
/*===========*/
/* out: */
dict_table_t* table, /* in: table */
dict_index_t* index, /* in: index */
ulint i, /* in: */
const char* name) /* in: name to compare to */
{
ulint tmp = dict_col_get_no(dict_field_get_col(
dict_index_get_nth_field(
index, i)));
return(strcmp(name, dict_table_get_col_name(table, tmp)) == 0);
}
/************************************************************************ /************************************************************************
Finds the first table name in the given database. */ Finds the first table name in the given database. */
...@@ -371,8 +390,7 @@ dict_load_columns( ...@@ -371,8 +390,7 @@ dict_load_columns(
ut_ad(len == 4); ut_ad(len == 4);
ut_a(i == mach_read_from_4(field)); ut_a(i == mach_read_from_4(field));
ut_a(!strcmp("NAME", dict_field_get_col ut_a(name_of_col_is(sys_columns, sys_index, 4, "NAME"));
(dict_index_get_nth_field(sys_index, 4))->name));
field = rec_get_nth_field_old(rec, 4, &len); field = rec_get_nth_field_old(rec, 4, &len);
name = mem_heap_strdupl(heap, (char*) field, len); name = mem_heap_strdupl(heap, (char*) field, len);
...@@ -407,8 +425,7 @@ dict_load_columns( ...@@ -407,8 +425,7 @@ dict_load_columns(
field = rec_get_nth_field_old(rec, 7, &len); field = rec_get_nth_field_old(rec, 7, &len);
col_len = mach_read_from_4(field); col_len = mach_read_from_4(field);
ut_a(!strcmp("PREC", dict_field_get_col ut_a(name_of_col_is(sys_columns, sys_index, 8, "PREC"));
(dict_index_get_nth_field(sys_index, 8))->name));
dict_mem_table_add_col(table, name, mtype, prtype, col_len); dict_mem_table_add_col(table, name, mtype, prtype, col_len);
btr_pcur_move_to_next_user_rec(&pcur, &mtr); btr_pcur_move_to_next_user_rec(&pcur, &mtr);
...@@ -521,8 +538,7 @@ dict_load_fields( ...@@ -521,8 +538,7 @@ dict_load_fields(
prefix_len = 0; prefix_len = 0;
} }
ut_a(!strcmp("COL_NAME", dict_field_get_col ut_a(name_of_col_is(sys_fields, sys_index, 4, "COL_NAME"));
(dict_index_get_nth_field(sys_index, 4))->name));
field = rec_get_nth_field_old(rec, 4, &len); field = rec_get_nth_field_old(rec, 4, &len);
...@@ -626,8 +642,7 @@ dict_load_indexes( ...@@ -626,8 +642,7 @@ dict_load_indexes(
ut_ad(len == 8); ut_ad(len == 8);
id = mach_read_from_8(field); id = mach_read_from_8(field);
ut_a(!strcmp("NAME", dict_field_get_col ut_a(name_of_col_is(sys_indexes, sys_index, 4, "NAME"));
(dict_index_get_nth_field(sys_index, 4))->name));
field = rec_get_nth_field_old(rec, 4, &name_len); field = rec_get_nth_field_old(rec, 4, &name_len);
name_buf = mem_heap_strdupl(heap, (char*) field, name_len); name_buf = mem_heap_strdupl(heap, (char*) field, name_len);
...@@ -641,8 +656,7 @@ dict_load_indexes( ...@@ -641,8 +656,7 @@ dict_load_indexes(
field = rec_get_nth_field_old(rec, 7, &len); field = rec_get_nth_field_old(rec, 7, &len);
space = mach_read_from_4(field); space = mach_read_from_4(field);
ut_a(!strcmp("PAGE_NO", dict_field_get_col ut_a(name_of_col_is(sys_indexes, sys_index, 8, "PAGE_NO"));
(dict_index_get_nth_field(sys_index, 8))->name));
field = rec_get_nth_field_old(rec, 8, &len); field = rec_get_nth_field_old(rec, 8, &len);
page_no = mach_read_from_4(field); page_no = mach_read_from_4(field);
...@@ -780,8 +794,7 @@ dict_load_table( ...@@ -780,8 +794,7 @@ dict_load_table(
goto err_exit; goto err_exit;
} }
ut_a(!strcmp("SPACE", dict_field_get_col ut_a(name_of_col_is(sys_tables, sys_index, 9, "SPACE"));
(dict_index_get_nth_field(sys_index, 9))->name));
field = rec_get_nth_field_old(rec, 9, &len); field = rec_get_nth_field_old(rec, 9, &len);
space = mach_read_from_4(field); space = mach_read_from_4(field);
...@@ -814,8 +827,7 @@ dict_load_table( ...@@ -814,8 +827,7 @@ dict_load_table(
} }
} }
ut_a(!strcmp("N_COLS", dict_field_get_col ut_a(name_of_col_is(sys_tables, sys_index, 4, "N_COLS"));
(dict_index_get_nth_field(sys_index, 4))->name));
field = rec_get_nth_field_old(rec, 4, &len); field = rec_get_nth_field_old(rec, 4, &len);
n_cols = mach_read_from_4(field); n_cols = mach_read_from_4(field);
...@@ -832,8 +844,7 @@ dict_load_table( ...@@ -832,8 +844,7 @@ dict_load_table(
table->ibd_file_missing = ibd_file_missing; table->ibd_file_missing = ibd_file_missing;
ut_a(!strcmp("ID", dict_field_get_col ut_a(name_of_col_is(sys_tables, sys_index, 3, "ID"));
(dict_index_get_nth_field(sys_index, 3))->name));
field = rec_get_nth_field_old(rec, 3, &len); field = rec_get_nth_field_old(rec, 3, &len);
table->id = mach_read_from_8(field); table->id = mach_read_from_8(field);
......
...@@ -1146,7 +1146,7 @@ ibuf_dummy_index_add_col( ...@@ -1146,7 +1146,7 @@ ibuf_dummy_index_add_col(
dtype_get_mtype(type), dtype_get_mtype(type),
dtype_get_prtype(type), dtype_get_prtype(type),
dtype_get_len(type)); dtype_get_len(type));
dict_index_add_col(index, dict_index_add_col(index, index->table,
dict_table_get_nth_col(index->table, i), len); dict_table_get_nth_col(index->table, i), len);
} }
/************************************************************************ /************************************************************************
...@@ -1164,6 +1164,11 @@ ibuf_dummy_index_free( ...@@ -1164,6 +1164,11 @@ ibuf_dummy_index_free(
dict_mem_table_free(table); dict_mem_table_free(table);
} }
void
dict_index_print_low(
/*=================*/
dict_index_t* index); /* in: index */
/************************************************************************* /*************************************************************************
Builds the entry to insert into a non-clustered index when we have the Builds the entry to insert into a non-clustered index when we have the
corresponding record in an ibuf index. */ corresponding record in an ibuf index. */
......
...@@ -363,6 +363,17 @@ dict_table_get_index_noninline( ...@@ -363,6 +363,17 @@ dict_table_get_index_noninline(
dict_table_t* table, /* in: table */ dict_table_t* table, /* in: table */
const char* name); /* in: index name */ const char* name); /* in: index name */
/************************************************************************** /**************************************************************************
Returns a column's name. */
const char*
dict_table_get_col_name(
/*====================*/
/* out: column name. NOTE: not guaranteed to
stay valid if table is modified in any way
(columns added, etc.). */
dict_table_t* table, /* in: table */
ulint i); /* in: column number */
/**************************************************************************
Prints a table definition. */ Prints a table definition. */
void void
...@@ -702,6 +713,7 @@ void ...@@ -702,6 +713,7 @@ void
dict_index_add_col( dict_index_add_col(
/*===============*/ /*===============*/
dict_index_t* index, /* in: index */ dict_index_t* index, /* in: index */
dict_table_t* table, /* in: table */
dict_col_t* col, /* in: column */ dict_col_t* col, /* in: column */
ulint prefix_len); /* in: column prefix length */ ulint prefix_len); /* in: column prefix length */
/*********************************************************************** /***********************************************************************
......
...@@ -547,8 +547,10 @@ mlog_parse_index( ...@@ -547,8 +547,10 @@ mlog_parse_index(
? DATA_BINARY : DATA_FIXBINARY, ? DATA_BINARY : DATA_FIXBINARY,
len & 0x8000 ? DATA_NOT_NULL : 0, len & 0x8000 ? DATA_NOT_NULL : 0,
len & 0x7fff); len & 0x7fff);
dict_index_add_col
(ind, dict_table_get_nth_col(table, i), 0); dict_index_add_col(ind, table,
dict_table_get_nth_col(table, i),
0);
} }
ptr += 2; ptr += 2;
} }
......
...@@ -450,7 +450,6 @@ pars_resolve_exp_columns( ...@@ -450,7 +450,6 @@ pars_resolve_exp_columns(
sym_node_t* sym_node; sym_node_t* sym_node;
dict_table_t* table; dict_table_t* table;
sym_node_t* t_node; sym_node_t* t_node;
dict_col_t* col;
ulint n_cols; ulint n_cols;
ulint i; ulint i;
...@@ -490,10 +489,12 @@ pars_resolve_exp_columns( ...@@ -490,10 +489,12 @@ pars_resolve_exp_columns(
n_cols = dict_table_get_n_cols(table); n_cols = dict_table_get_n_cols(table);
for (i = 0; i < n_cols; i++) { for (i = 0; i < n_cols; i++) {
col = dict_table_get_nth_col(table, i); dict_col_t* col = dict_table_get_nth_col(table, i);
const char* col_name = dict_table_get_col_name(
table, i);
if ((sym_node->name_len == ut_strlen(col->name)) if ((sym_node->name_len == ut_strlen(col_name))
&& (0 == ut_memcmp(sym_node->name, col->name, && (0 == ut_memcmp(sym_node->name, col_name,
sym_node->name_len))) { sym_node->name_len))) {
/* Found */ /* Found */
sym_node->resolved = TRUE; sym_node->resolved = TRUE;
...@@ -592,7 +593,6 @@ pars_select_all_columns( ...@@ -592,7 +593,6 @@ pars_select_all_columns(
sym_node_t* col_node; sym_node_t* col_node;
sym_node_t* table_node; sym_node_t* table_node;
dict_table_t* table; dict_table_t* table;
dict_col_t* col;
ulint i; ulint i;
select_node->select_list = NULL; select_node->select_list = NULL;
...@@ -603,15 +603,15 @@ pars_select_all_columns( ...@@ -603,15 +603,15 @@ pars_select_all_columns(
table = table_node->table; table = table_node->table;
for (i = 0; i < dict_table_get_n_user_cols(table); i++) { for (i = 0; i < dict_table_get_n_user_cols(table); i++) {
const char* col_name = dict_table_get_col_name(
col = dict_table_get_nth_col(table, i); table, i);
col_node = sym_tab_add_id(pars_sym_tab_global, col_node = sym_tab_add_id(pars_sym_tab_global,
(byte*)col->name, (byte*)col_name,
ut_strlen(col->name)); ut_strlen(col_name));
select_node->select_list
= que_node_list_add_last select_node->select_list = que_node_list_add_last(
(select_node->select_list, col_node); select_node->select_list, col_node);
} }
table_node = que_node_get_next(table_node); table_node = que_node_get_next(table_node);
......
...@@ -1782,9 +1782,8 @@ row_create_table_for_mysql( ...@@ -1782,9 +1782,8 @@ row_create_table_for_mysql(
/* Check that no reserved column names are used. */ /* Check that no reserved column names are used. */
for (i = 0; i < dict_table_get_n_user_cols(table); i++) { for (i = 0; i < dict_table_get_n_user_cols(table); i++) {
dict_col_t* col = dict_table_get_nth_col(table, i); if (dict_col_name_is_reserved(
dict_table_get_col_name(table, i))) {
if (dict_col_name_is_reserved(col->name)) {
dict_mem_table_free(table); dict_mem_table_free(table);
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
......
...@@ -903,7 +903,7 @@ srv_init(void) ...@@ -903,7 +903,7 @@ srv_init(void)
srv_sys->dummy_ind1 = dict_mem_index_create srv_sys->dummy_ind1 = dict_mem_index_create
("SYS_DUMMY1", "SYS_DUMMY1", DICT_HDR_SPACE, 0, 1); ("SYS_DUMMY1", "SYS_DUMMY1", DICT_HDR_SPACE, 0, 1);
dict_index_add_col(srv_sys->dummy_ind1, dict_index_add_col(srv_sys->dummy_ind1, table,
dict_table_get_nth_col(table, 0), 0); dict_table_get_nth_col(table, 0), 0);
srv_sys->dummy_ind1->table = table; srv_sys->dummy_ind1->table = table;
/* create dummy table and index for new-style infimum and supremum */ /* create dummy table and index for new-style infimum and supremum */
...@@ -913,7 +913,7 @@ srv_init(void) ...@@ -913,7 +913,7 @@ srv_init(void)
DATA_ENGLISH | DATA_NOT_NULL, 8); DATA_ENGLISH | DATA_NOT_NULL, 8);
srv_sys->dummy_ind2 = dict_mem_index_create srv_sys->dummy_ind2 = dict_mem_index_create
("SYS_DUMMY2", "SYS_DUMMY2", DICT_HDR_SPACE, 0, 1); ("SYS_DUMMY2", "SYS_DUMMY2", DICT_HDR_SPACE, 0, 1);
dict_index_add_col(srv_sys->dummy_ind2, dict_index_add_col(srv_sys->dummy_ind2, table,
dict_table_get_nth_col(table, 0), 0); dict_table_get_nth_col(table, 0), 0);
srv_sys->dummy_ind2->table = table; srv_sys->dummy_ind2->table = table;
......
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