summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2009-08-27 15:22:19 +0500
committerSergey Glukhov <Sergey.Glukhov@sun.com>2009-08-27 15:22:19 +0500
commit367c14b854f4afe6cfd41b9f56bf8fbf3c337b65 (patch)
treec872942a8df225d5829796ecab00369c6035c83e /sql
parent7492d622e44d7d3fd424bd24fd53131fe06d1c22 (diff)
downloadmariadb-git-367c14b854f4afe6cfd41b9f56bf8fbf3c337b65.tar.gz
Bug#46184 Crash, SELECT ... FROM derived table procedure analyze
The crash happens because select_union object is used as result set for queries which have derived tables. select_union use temporary table as data storage and if fields count exceeds 10(count of values for procedure ANALYSE()) then we get a crash on fill_record() function. mysql-test/r/analyse.result: test result mysql-test/r/subselect.result: result fix mysql-test/t/analyse.test: test case mysql-test/t/subselect.test: test fix sql/sql_yacc.yy: The crash happens because select_union object is used as result set for queries which have derived tables. select_union use temporary table as data storage and if fields count exceeds 10(count of values for procedure ANALYSE()) then we get a crash on fill_record() function.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_yacc.yy3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index b38b6e96890..09a0a4b2f12 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -7334,7 +7334,8 @@ procedure_clause:
MYSQL_YYABORT;
}
- if (&lex->select_lex != lex->current_select)
+ if (&lex->select_lex != lex->current_select ||
+ lex->select_lex.get_table_list()->derived)
{
my_error(ER_WRONG_USAGE, MYF(0), "PROCEDURE", "subquery");
MYSQL_YYABORT;