From 1b02a815dde1379635fb1c76065fc056c084705a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 22 Sep 2005 01:38:39 +0400 Subject: Fix bug #13180 thd->allow_sum_funcs wasn't reset before query processing. thd->allow_sum_func was left 'true' after previous statement thus allowing sum funcs to be present in conditions. thd->allow_sum_func should be set to 0 for each query and each prepared statement reinitialization. This is done in lex_start() and reset_stmt_for_execute(). sql/sql_lex.cc: Fix bug#13180 thd->allow_sum_func wasn't reset obefore query processing. thd->allow_sum_func is set to 0 in lex_start(). sql/sql_prepare.cc: Fix bug#13180 thd->allow_sum_func wasn't reset obefore query processing. thd->allow_sum_func is set to 0 in reset_stmt_for_execute(). mysql-test/t/update.test: Test case for bug#13180 thd->allow_sum_funcs wasn't reset before query processing. mysql-test/r/update.result: Test case for bug#13180 thd->allow_sum_funcs wasn't reset before query processing. --- mysql-test/r/update.result | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index e35d4e29fe4..d6c1118f90c 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -251,3 +251,15 @@ f1 f2 1 1 2 2 drop table t1,t2; +create table t1(f1 int); +select DATABASE(); +DATABASE() +test +update t1 set f1=1 where count(*)=1; +ERROR HY000: Invalid use of group function +select DATABASE(); +DATABASE() +test +delete from t1 where count(*)=1; +ERROR HY000: Invalid use of group function +drop table t1; -- cgit v1.2.1