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/20 03:54:07 evgen@stripped +3 -0
Fix bug #13180 thd->allow_sum_funcs wasn't reset before update.
thd->allow_sum_func was left 'true' after previous statement thus allowing
sum funcs to be present in conditions.
Now thd->allow_sum_func is set to false in mysql_prepare_update().
mysql-test/r/update.result
1.24 05/09/20 03:53:40 evgen@stripped +12 -0
Test case for bug#13180 thd->allow_sum_funcs wasn't reset before update.
mysql-test/t/update.test
1.22 05/09/20 03:53:25 evgen@stripped +12 -0
Test case for bug#13180 thd->allow_sum_funcs wasn't reset before update.
sql/sql_parse.cc
1.467 05/09/20 02:46:44 evgen@stripped +5 -0
Fix bug #13180: server accepts sometimes group in update's where condition
# 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.466/sql/sql_parse.cc 2005-09-11 02:57:22 +04:00
+++ 1.467/sql/sql_parse.cc 2005-09-20 02:46:44 +04:00
@@ -1945,6 +1945,11 @@
DBUG_ENTER("mysql_execute_command");
/*
+ Deny all non-select statements to use sum funcs.
+ Select will set this to 1 later.
+ */
+ thd->allow_sum_func= 0;
+ /*
Reset warning count for each query that uses tables
A better approach would be to reset this for any commands
that is not a SHOW command or a select that only access local
--- 1.23/mysql-test/r/update.result 2005-07-16 05:27:38 +04:00
+++ 1.24/mysql-test/r/update.result 2005-09-20 03:53:40 +04:00
@@ -251,3 +251,15 @@
1 1
2 2
drop table t1,t2;
+create table t1(f1 int);
+select VERSION();
+VERSION()
+4.1.15-debug-log
+update t1 set f1=1 where count(*)=1;
+ERROR HY000: Invalid use of group function
+select VERSION();
+VERSION()
+4.1.15-debug-log
+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-20 03:53:25 +04:00
@@ -215,4 +215,16 @@
select * from t1;
drop table t1,t2;
+#
+# Bug #13180 sometimes server accept sum func in update's where condition
+#
+create table t1(f1 int);
+select VERSION();
+--error 1111
+update t1 set f1=1 where count(*)=1;
+select VERSION();
+--error 1111
+delete from t1 where count(*)=1;
+drop table t1;
+
# End of 4.1 tests
| Thread |
|---|
| • bk commit into 4.1 tree (evgen:1.2443) BUG#13180 | eugene | 20 Sep |