summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorAnurag Shekhar <anurag.shekhar@sun.com>2009-04-17 11:21:51 +0530
committerAnurag Shekhar <anurag.shekhar@sun.com>2009-04-17 11:21:51 +0530
commite0e8ec4b28f27f8f2e82ef5f241d67471a45cd0f (patch)
treefb4254969f7857b83c4bbe473b44f1c80cd8c8eb /sql/sql_base.cc
parent8de80ef1b43bada69feda9fdbad95568270627bf (diff)
downloadmariadb-git-e0e8ec4b28f27f8f2e82ef5f241d67471a45cd0f.tar.gz
Bug#44040 MySQL allows creating a MERGE table upon VIEWs but crashes when
using it. The crash was due to a null pointer present for select_lex while processing the view. Adding a check while opening the view to see if its a child of a merge table fixed this problem.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 0f0ee7c529e..0dc29f7e3c2 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3844,6 +3844,16 @@ retry:
if (share->is_view)
{
/*
+ If parent_l of the table_list is non null then a merge table
+ has this view as child table, which is not supported.
+ */
+ if (table_list->parent_l)
+ {
+ my_error(ER_WRONG_MRG_TABLE, MYF(0));
+ goto err;
+ }
+
+ /*
This table is a view. Validate its metadata version: in particular,
that it was a view when the statement was prepared.
*/