summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2006-03-28 15:06:29 +0400
committerunknown <konstantin@mysql.com>2006-03-28 15:06:29 +0400
commit1d73c16b873084a14ca6d8119b83e3a3385debbf (patch)
treeb8b09a147e82ee710a994bfe0d89df334c4fb965 /sql/sql_view.cc
parente4e2e5024a3053df8a1bb788fbd6081047b72f12 (diff)
downloadmariadb-git-1d73c16b873084a14ca6d8119b83e3a3385debbf.tar.gz
A fix and a test case for Bug#15683 "crash, Function on nested
VIEWs, Prepared statement": we didn't mark the nested views as 'prelockng placeholders' when building the prelocking list. This resulted in these views being processed (merged, materialized) before they are actually used. mysql-test/r/sp-prelocking.result: Test results fixed (Bug#15683) mysql-test/t/sp-prelocking.test: Add a test case for Bug#15683 sql/sql_view.cc: When initializing tables used in a view, inherite its 'prelocking_placeholder' flag. This flag is set when we're opening the view in order to build the prelocking list for a query. In this case we should only calculate the list to prelock, and should not merge neither this view nor any of the nested views, of there are any. The flag is used to indicate this mode.
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 2832adc1f8f..39d1ae5c9fb 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -938,6 +938,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table)
tbl->skip_temporary= 1;
tbl->belong_to_view= top_view;
tbl->referencing_view= table;
+ tbl->prelocking_placeholder= table->prelocking_placeholder;
/*
First we fill want_privilege with SELECT_ACL (this is needed for the
tables which belongs to view subqueries and temporary table views,