List:Internals« Previous MessageNext Message »
From:eugene Date:September 19 2005 1:27am
Subject:bk commit into 4.1 tree (evgen:1.2443) BUG#13180
View as plain text  
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/19 03:26:54 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/t/update.test
    1.22 05/09/19 03:19:17 evgen@stripped +9 -0
    Test case for bug#13180 thd->allow_sum_funcs wasn't reset before update.

  mysql-test/r/update.result
    1.24 05/09/19 03:18:53 evgen@stripped +7 -0
    Test case for bug#13180 thd->allow_sum_funcs wasn't reset before update.

  sql/sql_update.cc
    1.143 05/09/19 03:18:24 evgen@stripped +1 -0
    Fix bug #13180 thd->allow_sum_funcs wasn't reset before update.

# 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.142/sql/sql_update.cc	2005-02-18 16:14:10 +03:00
+++ 1.143/sql/sql_update.cc	2005-09-19 03:18:24 +04:00
@@ -426,6 +426,7 @@
   bzero((char*) &tables,sizeof(tables));	// For ORDER BY
   tables.table= table;
   tables.alias= table_list->alias;
+  thd->allow_sum_func= 0;
 
   if (setup_tables(update_table_list) ||
       setup_conds(thd, update_table_list, conds) ||

--- 1.23/mysql-test/r/update.result	2005-07-16 05:27:38 +04:00
+++ 1.24/mysql-test/r/update.result	2005-09-19 03:18:53 +04:00
@@ -251,3 +251,10 @@
 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
+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-19 03:19:17 +04:00
@@ -215,4 +215,13 @@
 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;
+drop table t1;
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (evgen:1.2443) BUG#13180eugene19 Sep