diff options
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index d036750de7f..bcca3906266 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -774,14 +774,14 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, interval= sql_field->interval= typelib(stmt_root, sql_field->interval_list); - List_iterator<String> it(sql_field->interval_list); + List_iterator<String> int_it(sql_field->interval_list); String conv, *tmp; char comma_buf[2]; int comma_length= cs->cset->wc_mb(cs, ',', (uchar*) comma_buf, (uchar*) comma_buf + sizeof(comma_buf)); DBUG_ASSERT(comma_length > 0); - for (uint i= 0; (tmp= it++); i++) + for (uint i= 0; (tmp= int_it++); i++) { uint lengthsp; if (String::needs_conversion(tmp->length(), tmp->charset(), @@ -2156,7 +2156,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT *), int (view_operator_func)(THD *, TABLE_LIST*)) { - TABLE_LIST *table, *save_next_global, *save_next_local; + TABLE_LIST *table; SELECT_LEX *select= &thd->lex->select_lex; List<Item> field_list; Item *item; @@ -2187,30 +2187,33 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, strxmov(table_name, db, ".", table->table_name, NullS); thd->open_options|= extra_open_options; table->lock_type= lock_type; - /* open only one table from local list of command */ - save_next_global= table->next_global; - table->next_global= 0; - save_next_local= table->next_local; - table->next_local= 0; - select->table_list.first= (byte*)table; - /* - Time zone tables and SP tables can be add to lex->query_tables list, - so it have to be prepared. - TODO: Investigate if we can put extra tables into argument instead of - using lex->query_tables - */ - lex->query_tables= table; - lex->query_tables_last= &table->next_global; - lex->query_tables_own_last= 0; - thd->no_warnings_for_error= no_warnings_for_error; - if (view_operator_func == NULL) - table->required_type=FRMTYPE_TABLE; - open_and_lock_tables(thd, table); - thd->no_warnings_for_error= 0; - table->next_global= save_next_global; - table->next_local= save_next_local; - thd->open_options&= ~extra_open_options; + /* open only one table from local list of command */ + { + TABLE_LIST *save_next_global, *save_next_local; + save_next_global= table->next_global; + table->next_global= 0; + save_next_local= table->next_local; + table->next_local= 0; + select->table_list.first= (byte*)table; + /* + Time zone tables and SP tables can be add to lex->query_tables list, + so it have to be prepared. + TODO: Investigate if we can put extra tables into argument instead of + using lex->query_tables + */ + lex->query_tables= table; + lex->query_tables_last= &table->next_global; + lex->query_tables_own_last= 0; + thd->no_warnings_for_error= no_warnings_for_error; + if (view_operator_func == NULL) + table->required_type=FRMTYPE_TABLE; + open_and_lock_tables(thd, table); + thd->no_warnings_for_error= 0; + table->next_global= save_next_global; + table->next_local= save_next_local; + thd->open_options&= ~extra_open_options; + } if (prepare_func) { switch ((*prepare_func)(thd, table, check_opt)) { |