diff options
author | Vicențiu Ciorbaru <cvicentiu@gmail.com> | 2015-05-18 01:35:47 +0000 |
---|---|---|
committer | Vicentiu Ciorbaru <vicentiu@mariadb.org> | 2015-05-19 11:57:47 +0000 |
commit | 29c7aff76784ff2b8329387f69c73e7282f28b2a (patch) | |
tree | f29eb6b81c99b9624e507cf39368d4d2dbf51cdd /sql/sql_delete.cc | |
parent | 20c23048c1d2f28942f2f99e4150a58b6545c0cd (diff) | |
download | mariadb-git-29c7aff76784ff2b8329387f69c73e7282f28b2a.tar.gz |
MDEV-8063: Unconditional ANALYZE DELETE does not delete rows
When detecting a statement that can make use of ha_delete_all_rows(),
we refrained from running the statement when being presented
with the analyze or explain prefix.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 213013b889c..cfb44de5222 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -347,8 +347,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, DBUG_PRINT("debug", ("Trying to use delete_all_rows()")); query_plan.set_delete_all_rows(maybe_deleted); - if (thd->lex->describe || thd->lex->analyze_stmt) - goto produce_explain_and_leave; if (!(error=table->file->ha_delete_all_rows())) { @@ -359,6 +357,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, query_type= THD::STMT_QUERY_TYPE; error= -1; deleted= maybe_deleted; + query_plan.save_explain_delete_data(thd->mem_root, thd); goto cleanup; } if (error != HA_ERR_WRONG_COMMAND) @@ -698,9 +697,8 @@ cleanup: if (error < 0 || (thd->lex->ignore && !thd->is_error() && !thd->is_fatal_error)) { - if (thd->lex->analyze_stmt) + if (thd->lex->describe || thd->lex->analyze_stmt) { - error= 0; goto send_nothing_and_leave; } |