diff options
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e7abef13c75..1d215f5aa40 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -918,6 +918,7 @@ void intern_close_table(TABLE *table) delete table->triggers; if (table->file) // Not true if placeholder (void) closefrm(table, 1); // close file + table->alias.free(); DBUG_VOID_RETURN; } @@ -4839,10 +4840,11 @@ bool open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags, } /* - temporary mem_root for new .frm parsing. - TODO: variables for size + Initialize temporary MEM_ROOT for new .FRM parsing. Do not allocate + anything yet, to avoid penalty for statements which don't use views + and thus new .FRM format. */ - init_sql_alloc(&new_frm_mem, 8024, 8024); + init_sql_alloc(&new_frm_mem, 8024, 0); thd->current_tablenr= 0; restart: @@ -8160,7 +8162,7 @@ bool setup_tables(THD *thd, Name_resolution_context *context, Item *item= table_list->jtbm_subselect->optimizer; if (table_list->jtbm_subselect->optimizer->fix_fields(thd, &item)) { - my_error(ER_TOO_MANY_TABLES,MYF(0),MAX_TABLES); /* psergey-todo: WHY ER_TOO_MANY_TABLES ???*/ + my_error(ER_TOO_MANY_TABLES,MYF(0), static_cast<int>(MAX_TABLES)); /* psergey-todo: WHY ER_TOO_MANY_TABLES ???*/ DBUG_RETURN(1); } DBUG_ASSERT(item == table_list->jtbm_subselect->optimizer); @@ -8704,9 +8706,11 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values, Item *value, *fld; Item_field *field; TABLE *table= 0, *vcol_table= 0; - bool abort_on_warning_saved= thd->abort_on_warning; + bool save_abort_on_warning= thd->abort_on_warning; + bool save_no_errors= thd->no_errors; DBUG_ENTER("fill_record"); + thd->no_errors= ignore_errors; /* Reset the table->auto_increment_field_not_null as it is valid for only one row. @@ -8769,10 +8773,12 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values, goto err; } } - thd->abort_on_warning= abort_on_warning_saved; + thd->abort_on_warning= save_abort_on_warning; + thd->no_errors= save_no_errors; DBUG_RETURN(thd->is_error()); err: - thd->abort_on_warning= abort_on_warning_saved; + thd->abort_on_warning= save_abort_on_warning; + thd->no_errors= save_no_errors; if (table) table->auto_increment_field_not_null= FALSE; DBUG_RETURN(TRUE); |