List:Internals« Previous MessageNext Message »
From:Sergey Petrunia Date:June 23 2005 7:05pm
Subject:bk commit into 5.0 tree (sergefp:1.1990)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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.1990 05/06/23 19:05:36 sergefp@stripped +3 -0
  Merge

  sql/item_cmpfunc.cc
    1.158 05/06/23 19:05:34 sergefp@stripped +0 -0
    SCCS merged

  mysql-test/t/case.test
    1.17 05/06/23 19:05:34 sergefp@stripped +0 -0
    SCCS merged

  mysql-test/r/case.result
    1.23 05/06/23 19:05:34 sergefp@stripped +0 -0
    SCCS merged

# 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-5.0-bug8441/RESYNC

--- 1.157/sql/item_cmpfunc.cc	2005-06-17 21:26:18 +02:00
+++ 1.158/sql/item_cmpfunc.cc	2005-06-23 19:05:34 +02:00
@@ -1420,6 +1420,8 @@
   my_decimal *first_expr_dec, first_expr_dec_val;
   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);
@@ -1433,7 +1435,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.22/mysql-test/r/case.result	2005-06-02 16:15:00 +02:00
+++ 1.23/mysql-test/r/case.result	2005-06-23 19:05:34 +02:00
@@ -160,6 +160,21 @@
   `COALESCE('a' COLLATE latin1_bin,'b')` varchar(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
 CREATE TABLE t1 (EMPNUM INT);
 INSERT INTO t1 VALUES (0), (2);
 CREATE TABLE t2 (EMPNUM DECIMAL (4, 2));

--- 1.16/mysql-test/t/case.test	2005-06-02 16:15:37 +02:00
+++ 1.17/mysql-test/t/case.test	2005-06-23 19:05:34 +02:00
@@ -111,6 +111,17 @@
 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;
+
 #
 # Tests for bug #9939: conversion of the arguments for COALESCE and IFNULL
 #
Thread
bk commit into 5.0 tree (sergefp:1.1990)Sergey Petrunia23 Jun