Below is the list of changes that have just been committed into a local
4.1 repository of evgen. When evgen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2443 05/09/22 01:38:39 evgen@stripped +4 -0
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().
mysql-test/r/update.result
1.24 05/09/22 01:38:24 evgen@stripped +12 -0
Test case for bug#13180 thd->allow_sum_funcs wasn't reset before query
processing.
mysql-test/t/update.test
1.22 05/09/22 01:38:16 evgen@stripped +12 -0
Test case for bug#13180 thd->allow_sum_funcs wasn't reset before query
processing.
sql/sql_prepare.cc
1.154 05/09/22 01:37:40 evgen@stripped +1 -0
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().
sql/sql_lex.cc
1.148 05/09/22 01:37:15 evgen@stripped +1 -0
Fix bug#13180 thd->allow_sum_func wasn't reset obefore query processing.
thd->allow_sum_func is set to 0 in lex_start().
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: evgen
# Host: moonbone.local
# Root: /work/13180-bug-4.1-mysql
--- 1.147/sql/sql_lex.cc 2005-07-27 14:42:56 +04:00
+++ 1.148/sql/sql_lex.cc 2005-09-22 01:37:15 +04:00
@@ -160,6 +160,7 @@
lex->duplicates= DUP_ERROR;
lex->ignore= 0;
lex->proc_list.first= 0;
+ thd->allow_sum_func= 0;
}
void lex_end(LEX *lex)
--- 1.23/mysql-test/r/update.result 2005-07-16 05:27:38 +04:00
+++ 1.24/mysql-test/r/update.result 2005-09-22 01:38:24 +04:00
@@ -251,3 +251,15 @@
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;
--- 1.21/mysql-test/t/update.test 2005-07-28 04:21:50 +04:00
+++ 1.22/mysql-test/t/update.test 2005-09-22 01:38:16 +04:00
@@ -215,4 +215,16 @@
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
--- 1.153/sql/sql_prepare.cc 2005-08-19 22:49:29 +04:00
+++ 1.154/sql/sql_prepare.cc 2005-09-22 01:37:40 +04:00
@@ -1738,6 +1738,7 @@
lex->current_select= &lex->select_lex;
if (lex->result)
lex->result->cleanup();
+ thd->allow_sum_func= 0;
}
| Thread |
|---|
| • bk commit into 4.1 tree (evgen:1.2443) BUG#13180 | eugene | 21 Sep |