List:Internals« Previous MessageNext Message »
From:Sergey Petrunia Date:June 20 2005 11:43am
Subject:bk commit into 4.1 tree (sergefp:1.2296) BUG#10151
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of psergey. When psergey 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.2296 05/06/20 11:43:38 sergefp@stripped +3 -0
  Fix for BUG#10151: In Item_func_case::find_item don't assume that parameter str !=
&(this->str_value)

  sql/item_cmpfunc.cc
    1.191 05/06/20 11:43:35 sergefp@stripped +3 -1
    Fix for BUG#10151: In Item_func_case::find_item don't assume that parameter str !=
&(this->str_value)

  mysql-test/t/case.test
    1.15 05/06/20 11:43:35 sergefp@stripped +11 -0
    Testcase for BUG#10151

  mysql-test/r/case.result
    1.16 05/06/20 11:43:35 sergefp@stripped +15 -0
    Testcase for BUG#10151

# 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:	sergefp
# Host:	pslp.mylan
# Root:	/home/psergey/mysql-4.1-bug10151

--- 1.190/sql/item_cmpfunc.cc	2005-06-13 20:21:35 +02:00
+++ 1.191/sql/item_cmpfunc.cc	2005-06-20 11:43:35 +02:00
@@ -1174,6 +1174,8 @@
   String *first_expr_str,*tmp;
   longlong first_expr_int;
   double   first_expr_real;
+  char buff[MAX_FIELD_WIDTH];
+  String buff_str(buff,sizeof(buff),default_charset());
   
   /* These will be initialized later */
   LINT_INIT(first_expr_str);
@@ -1186,7 +1188,7 @@
     {
       case STRING_RESULT:
       	// We can't use 'str' here as this may be overwritten
-	if (!(first_expr_str= args[first_expr_num]->val_str(&str_value)))
+	if (!(first_expr_str= args[first_expr_num]->val_str(&buff_str)))
 	  return else_expr_num != -1 ? args[else_expr_num] : 0;	// Impossible
         break;
       case INT_RESULT:

--- 1.15/mysql-test/r/case.result	2005-01-18 14:41:02 +01:00
+++ 1.16/mysql-test/r/case.result	2005-06-20 11:43:35 +02:00
@@ -154,3 +154,18 @@
   `COALESCE('a' COLLATE latin1_bin,'b')` char(1) character set latin1 collate latin1_bin
NOT NULL default ''
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 DROP TABLE t1;
+SELECT 'case+union+test'
+UNION 
+SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;
+case+union+test
+case+union+test
+nobug
+SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;
+CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END
+nobug
+SELECT 'case+union+test'
+UNION 
+SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END;
+case+union+test
+case+union+test
+nobug

--- 1.14/mysql-test/t/case.test	2004-02-16 09:03:22 +01:00
+++ 1.15/mysql-test/t/case.test	2005-06-20 11:43:35 +02:00
@@ -107,3 +107,14 @@
  COALESCE('a' COLLATE latin1_bin,'b');
 SHOW CREATE TABLE t1;
 DROP TABLE t1;
+
+# Test for BUG#10151
+SELECT 'case+union+test'
+UNION 
+SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;
+
+SELECT CASE LOWER('1') WHEN LOWER('2') THEN 'BUG' ELSE 'nobug' END;
+
+SELECT 'case+union+test'
+UNION 
+SELECT CASE '1' WHEN '2' THEN 'BUG' ELSE 'nobug' END;
Thread
bk commit into 4.1 tree (sergefp:1.2296) BUG#10151Sergey Petrunia20 Jun