From 062b7bfa39ae418f1da85bef3d8968fc9d53569e Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Sat, 5 Oct 2013 13:48:45 +0400 Subject: [PATCH] Better comments --- sql/sql_delete.cc | 2 -- sql/sql_lex.h | 7 +++++++ sql/sql_update.cc | 2 -- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index a84d6795603..a9d97a6debc 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -245,8 +245,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, table->map=1; query_plan.select_lex= &thd->lex->select_lex; query_plan.table= table; - - //psergey-todo: Ugly, discuss with Sanja query_plan.updating_a_view= test(table_list->view); if (mysql_prepare_delete(thd, table_list, select_lex->with_wild, diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 99a5b2d8ae3..21f3b5a5859 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -2382,6 +2382,13 @@ protected: bool impossible_where; bool no_partitions; public: + /* + When single-table UPDATE updates a VIEW, that VIEW's select is still + listed as the first child. When we print EXPLAIN, it looks like a + subquery. + In order to get rid of it, updating_a_view=TRUE means that first child + select should not be shown when printing EXPLAIN. + */ bool updating_a_view; TABLE *table; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 81e0f6c0ebe..db32ad2a0c5 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -314,8 +314,6 @@ int mysql_update(THD *thd, my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, "UPDATE"); DBUG_RETURN(1); } - - //psergey-todo: Ugly, discuss with Sanja query_plan.updating_a_view= test(table_list->view); /* Calculate "table->covering_keys" based on the WHERE */