summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-06-13 19:03:03 -0700
committerIgor Babaev <igor@askmonty.org>2011-06-13 19:03:03 -0700
commit56eb6d7e69ecce856e2d54e2404157407cb7203b (patch)
treeed1868d2b843805abf292c87b538e4a7983ae9a4 /sql/sql_update.cc
parentab411f8f1c2e84082623c038eb024c15c58745b5 (diff)
downloadmariadb-git-56eb6d7e69ecce856e2d54e2404157407cb7203b.tar.gz
Fixed LP bug #794890.
Changed the code that processing of multi-updates and multi-deletes with multitable views at the prepare stage. A proper solution would be: never to perform any transformations of views before and at the prepare stage. Yet it would require re-engineering of the code that checks privileges and updatability of views. Ultimately this re-engineering has to be done to provide a clean solution for INSERT/UPDATE/DELETE statements that use views. Fixed a valgrind problem in the function TABLE::use_index.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r--sql/sql_update.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 4821fc2bd8f..0bfbcf2b23f 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1038,8 +1038,9 @@ reopen_tables:
call in setup_tables()).
*/
//We need to merge for insert prior to prepare.
- if (mysql_handle_list_of_derived(lex, table_list, DT_MERGE_FOR_INSERT))
- DBUG_RETURN(1);
+ if (mysql_handle_derived(lex, DT_MERGE_FOR_INSERT))
+ DBUG_RETURN(TRUE);
+
if (mysql_handle_derived(lex, DT_PREPARE))
DBUG_RETURN(TRUE);
@@ -1237,6 +1238,9 @@ reopen_tables:
further check in multi_update::prepare whether to use record cache.
*/
lex->select_lex.exclude_from_table_unique_test= FALSE;
+
+ if (lex->select_lex.save_prep_leaf_tables(thd))
+ DBUG_RETURN(TRUE);
DBUG_RETURN (FALSE);
}