mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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().
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user