summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorgkodinov/kgeorge@macbook.gmz <>2006-10-24 15:26:41 +0300
committergkodinov/kgeorge@macbook.gmz <>2006-10-24 15:26:41 +0300
commit932d86bbb93328d5916b2a9e5b1b788ddf820742 (patch)
tree72d9d3c19fbeb5b6938a3cca98404b272cf861c4 /sql/sql_lex.cc
parenta5899ea8637081396794fb137b9022536f21e9c6 (diff)
downloadmariadb-git-932d86bbb93328d5916b2a9e5b1b788ddf820742.tar.gz
Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK. The SQL parser was using Item::name to transfer user defined function attributes to the user defined function (udf). It was not distinguishing between user defined function call arguments and stored procedure call arguments. Setting Item::name was causing Item_ref::print() method to print the argument as quoted identifiers and caused views that reference aggregate functions as udf call arguments (and rely on Item::print() for the text of the view to store) to throw an undefined identifier error. Overloaded Item_ref::print to print aggregate functions as such when printing the references to aggregate functions taken out of context by split_sum_func2() Fixed the parser to properly detect using AS clause in stored procedure arguments as an error. Fixed printing the arguments of udf call to print properly the udf attribute.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 788276ac654..a65d36cb07c 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -163,6 +163,7 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex->select_lex.ftfunc_list= &lex->select_lex.ftfunc_list_alloc;
lex->select_lex.group_list.empty();
lex->select_lex.order_list.empty();
+ lex->select_lex.udf_list.empty();
lex->current_select= &lex->select_lex;
lex->yacc_yyss=lex->yacc_yyvs=0;
lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE);
@@ -1166,6 +1167,7 @@ void st_select_lex::init_select()
braces= 0;
when_list.empty();
expr_list.empty();
+ udf_list.empty();
interval_list.empty();
use_index.empty();
ftfunc_list_alloc.empty();