diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-06-01 08:40:59 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-06-01 08:40:59 +0300 |
commit | 950a2200603d5b4a8f7e978624f38a46bca896bc (patch) | |
tree | 70f3201421051f85e198e6c557d020327ccc8469 /sql | |
parent | 1e5ebf3762abdb8108620b46e76d4ebdde8472f7 (diff) | |
parent | 2fb4407827ecd6cbf52e210a8d9370b4560ddd5b (diff) | |
download | mariadb-git-950a2200603d5b4a8f7e978624f38a46bca896bc.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_partition.cc | 21 | ||||
-rw-r--r-- | sql/ha_partition.h | 7 | ||||
-rw-r--r-- | sql/handler.h | 2 | ||||
-rw-r--r-- | sql/sql_admin.cc | 9 | ||||
-rw-r--r-- | sql/sql_base.cc | 17 | ||||
-rw-r--r-- | sql/sql_base.h | 2 | ||||
-rw-r--r-- | sql/sql_delete.cc | 2 | ||||
-rw-r--r-- | sql/sql_update.cc | 2 |
8 files changed, 32 insertions, 30 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index bf9d6af997f..2e0bf57492c 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2005, 2019, Oracle and/or its affiliates. - Copyright (c) 2009, 2020, MariaDB + Copyright (c) 2009, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2305,25 +2305,6 @@ void ha_partition::change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) } } -/* - Change comments specific to handler - - SYNOPSIS - update_table_comment() - comment Original comment - - RETURN VALUE - new comment - - DESCRIPTION - No comment changes so far -*/ - -char *ha_partition::update_table_comment(const char *comment) -{ - return (char*) comment; /* Nothing to change */ -} - /** Handle delete and rename table diff --git a/sql/ha_partition.h b/sql/ha_partition.h index b16675e868f..3f6dc3254ab 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -3,7 +3,7 @@ /* Copyright (c) 2005, 2012, Oracle and/or its affiliates. - Copyright (c) 2009, 2013, Monty Program Ab & SkySQL Ab. + Copyright (c) 2009, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -519,10 +519,6 @@ public: Meta data routines to CREATE, DROP, RENAME table and often used at ALTER TABLE (update_create_info used from ALTER TABLE and SHOW ..). - update_table_comment is used in SHOW TABLE commands to provide a - chance for the handler to add any interesting comments to the table - comments not provided by the users comment. - create_partitioning_metadata is called before opening a new handler object with openfrm to call create. It is used to create any local handler object needed in opening the object in openfrm @@ -535,7 +531,6 @@ public: virtual int create_partitioning_metadata(const char *name, const char *old_name, int action_flag); virtual void update_create_info(HA_CREATE_INFO *create_info); - virtual char *update_table_comment(const char *comment); virtual int change_partitions(HA_CREATE_INFO *create_info, const char *path, ulonglong * const copied, diff --git a/sql/handler.h b/sql/handler.h index 29683b54c80..d318dc57cdd 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -3729,8 +3729,6 @@ public: /* end of the list of admin commands */ virtual int indexes_are_disabled(void) {return 0;} - virtual char *update_table_comment(const char * comment) - { return (char*) comment;} virtual void append_create_info(String *packet) {} /** If index == MAX_KEY then a check for table is made and if index < diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 45c2314fef4..a61aaa0f893 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -520,8 +520,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, DBUG_PRINT("admin", ("table: '%s'.'%s'", db, table->table_name.str)); DEBUG_SYNC(thd, "admin_command_kill_before_modify"); - if (thd->is_killed()) - break; strxmov(table_name, db, ".", table->table_name.str, NullS); thd->open_options|= extra_open_options; table->lock_type= lock_type; @@ -536,6 +534,13 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, : lock_type >= TL_WRITE_ALLOW_WRITE ? MDL_SHARED_WRITE : MDL_SHARED_READ); + if (thd->check_killed()) + { + fatal_error= true; + result_code= HA_ADMIN_FAILED; + goto send_result; + } + /* open only one table from local list of command */ while (1) { diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e80a78ff802..be3736cdc40 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -9129,6 +9129,23 @@ int dynamic_column_error_message(enum_dyncol_func_result rc) return rc; } + +/** + Turn on the SELECT_DESCRIBE flag for the primary SELECT_LEX of the statement + being processed in case the statement is EXPLAIN UPDATE/DELETE. + + @param lex current LEX +*/ + +void promote_select_describe_flag_if_needed(LEX *lex) +{ + if (lex->describe) + { + lex->select_lex.options |= SELECT_DESCRIBE; + } +} + + /** @} (end of group Data_Dictionary) */ diff --git a/sql/sql_base.h b/sql/sql_base.h index c9fb9bc6a62..3a31518840d 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -512,6 +512,8 @@ bool extend_table_list(THD *thd, TABLE_LIST *tables, Prelocking_strategy *prelocking_strategy, bool has_prelocking_list); +void promote_select_describe_flag_if_needed(LEX *lex); + /** A context of open_tables() function, used to recover from a failed open_table() or open_routine() attempt. diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 4d6a2c64e3e..084b5a76b84 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -328,6 +328,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, query_plan.table= table; query_plan.updating_a_view= MY_TEST(table_list->view); + promote_select_describe_flag_if_needed(thd->lex); + if (mysql_prepare_delete(thd, table_list, select_lex->with_wild, select_lex->item_list, &conds, &delete_while_scanning)) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index eeed815b716..1c4d5cd9b52 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -399,6 +399,8 @@ int mysql_update(THD *thd, want_privilege= (table_list->view ? UPDATE_ACL : table_list->grant.want_privilege); #endif + promote_select_describe_flag_if_needed(thd->lex); + if (mysql_prepare_update(thd, table_list, &conds, order_num, order)) DBUG_RETURN(1); |