diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-10-19 21:45:18 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-10-19 21:45:18 +0200 |
commit | 76f0b94bb0b2994d639353530c5b251d0f1a204b (patch) | |
tree | 9ed50628aac34f89a37637bab2fc4915b86b5eb4 /sql/sql_admin.cc | |
parent | 4e46d8e5bff140f2549841167dc4b65a3c0a645d (diff) | |
parent | 5dc1a2231f55bacc9aaf0e24816f3d9c2ee1f21d (diff) | |
download | mariadb-git-76f0b94bb0b2994d639353530c5b251d0f1a204b.tar.gz |
merge with 5.3
sql/sql_insert.cc:
CREATE ... IF NOT EXISTS may do nothing, but
it is still not a failure. don't forget to my_ok it.
******
CREATE ... IF NOT EXISTS may do nothing, but
it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
small cleanup
******
small cleanup
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r-- | sql/sql_admin.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 709d1b9a701..5c529e99fac 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -309,6 +309,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, int result_code; bool need_repair_or_alter= 0; DBUG_ENTER("mysql_admin_table"); + DBUG_PRINT("enter", ("extra_open_options: %u", extra_open_options)); field_list.push_back(item = new Item_empty_string("Table", NAME_CHAR_LEN*2)); item->maybe_null = 1; @@ -332,9 +333,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, bool open_error; DBUG_PRINT("admin", ("table: '%s'.'%s'", table->db, table->table_name)); - DBUG_PRINT("admin", ("extra_open_options: %u", extra_open_options)); strxmov(table_name, db, ".", table->table_name, NullS); - thd->open_options|= extra_open_options; table->lock_type= lock_type; /* To make code safe for re-execution we need to reset type of MDL @@ -365,6 +364,13 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, if (view_operator_func == NULL) table->required_type=FRMTYPE_TABLE; + if (lex->sql_command == SQLCOM_CHECK || + lex->sql_command == SQLCOM_REPAIR || + lex->sql_command == SQLCOM_ANALYZE || + lex->sql_command == SQLCOM_OPTIMIZE) + thd->prepare_derived_at_open= TRUE; + + thd->open_options|= extra_open_options; if (!thd->locked_tables_mode && repair_table_use_frm) { /* @@ -397,10 +403,11 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, open_error= open_and_lock_tables(thd, table, TRUE, 0); } + thd->open_options&= ~extra_open_options; + thd->prepare_derived_at_open= FALSE; table->next_global= save_next_global; table->next_local= save_next_local; - thd->open_options&= ~extra_open_options; /* If open_and_lock_tables() failed, close_thread_tables() will close |