diff options
author | evgen@moonbone.local <> | 2005-09-22 02:38:14 +0400 |
---|---|---|
committer | evgen@moonbone.local <> | 2005-09-22 02:38:14 +0400 |
commit | 2ba1eb1486b96cdaed1d9b5685f39ead5bdaddee (patch) | |
tree | 71b068067c4b4596c15b8b53424e74567733d64f | |
parent | a5a4c412f10f3d64d0d3605e1092ac446e779b95 (diff) | |
parent | b7e8c8b1126e50442f6de02d257d7ab6c020930c (diff) | |
download | mariadb-git-2ba1eb1486b96cdaed1d9b5685f39ead5bdaddee.tar.gz |
Manual merge
-rw-r--r-- | mysql-test/r/update.result | 12 | ||||
-rw-r--r-- | mysql-test/t/update.test | 12 | ||||
-rw-r--r-- | sql/sql_lex.cc | 1 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 4 |
4 files changed, 27 insertions, 2 deletions
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 42fb8064044..9ca6370dff6 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; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index dd6c36d8414..3822d1fe4e7 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -215,4 +215,16 @@ UPDATE t1 SET t1.f2=(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1); select * from t1; drop table t1,t2; +# +# Bug #13180 sometimes server accepts sum func in update/delete where condition +# +create table t1(f1 int); +select DATABASE(); +--error 1111 +update t1 set f1=1 where count(*)=1; +select DATABASE(); +--error 1111 +delete from t1 where count(*)=1; +drop table t1; + # End of 4.1 tests diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index b7a2b6b0624..32178a0a07d 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -171,6 +171,7 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->sql_command= lex->orig_sql_command= SQLCOM_END; lex->duplicates= DUP_ERROR; lex->ignore= 0; + thd->allow_sum_func= 0; lex->sphead= NULL; lex->spcont= NULL; lex->proc_list.first= 0; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 6eea101de8f..1201a0fb1ab 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2129,8 +2129,8 @@ void reinit_stmt_before_use(THD *thd, LEX *lex) lex->result->cleanup(); lex->result->set_thd(thd); } - - DBUG_VOID_RETURN; + thd->allow_sum_func= 0; + DBUG_VOID_RETURN; } |