summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-10-30 11:40:44 +0200
committerGeorgi Kodinov <joro@sun.com>2009-10-30 11:40:44 +0200
commitfc80944c6e5e115528972485303ccd9f90aea4ef (patch)
tree8e5e5c8044149eb2d6c1ffe30c379a3322a59782 /sql/sql_select.cc
parenteb9a854d8be6f692f55250c89cb40f1cb1b66baa (diff)
downloadmariadb-git-fc80944c6e5e115528972485303ccd9f90aea4ef.tar.gz
Bug #48293: crash with procedure analyse, view with > 10 columns,
having clause... The fix for bug 46184 was not very complete. It was not covering views using temporary tables and multiple tables in a FROM clause. Fixed by reverting the fix for 46184 and making a more general check that is checking at the right execution stage and for all of the non-supported cases. Now PROCEDURE ANALYZE on non-top level SELECT is also forbidden. Updated the analyse.test and subselect.test accordingly.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 8136c6f7635..c425d9a988e 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -622,6 +622,18 @@ JOIN::prepare(Item ***rref_pointer_array,
MYF(0)); /* purecov: inspected */
goto err; /* purecov: inspected */
}
+ if (thd->lex->derived_tables)
+ {
+ my_error(ER_WRONG_USAGE, MYF(0), "PROCEDURE",
+ thd->lex->derived_tables & DERIVED_VIEW ?
+ "view" : "subquery");
+ goto err;
+ }
+ if (thd->lex->sql_command != SQLCOM_SELECT)
+ {
+ my_error(ER_WRONG_USAGE, MYF(0), "PROCEDURE", "non-SELECT");
+ goto err;
+ }
}
if (!procedure && result && result->prepare(fields_list, unit_arg))