MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Glukhov Date:April 21 2009 7:23am
Subject:bzr commit into mysql-5.1-bugteam branch (Sergey.Glukhov:2861)
Bug#44367
View as plain text  
#At file:///home/gluh/MySQL/mysql-5.1-bug-44367/ based on revid:satya.bn@stripped

 2861 Sergey Glukhov	2009-04-21
      Bug#44367 valgrind warnings with find_in_set() functions
       init 'wc' variable
     @ mysql-test/r/func_set.result
        test result
     @ mysql-test/t/func_set.test
        test case
     @ sql/item_func.cc
        init 'wc' variable

    modified:
      mysql-test/r/func_set.result
      mysql-test/t/func_set.test
      sql/item_func.cc
=== modified file 'mysql-test/r/func_set.result'
--- a/mysql-test/r/func_set.result	2008-02-12 19:09:16 +0000
+++ b/mysql-test/r/func_set.result	2009-04-21 07:23:07 +0000
@@ -103,3 +103,46 @@ CAST(DATE(NULL) AS DECIMAL), CAST(DATE(N
 CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL))
 8
 End of 5.0 tests
+drop table if exists t1;
+create table t1 (f1 set('test1','test2','test3') character set utf8 default null)
+engine=myisam default charset=latin1;
+insert into t1 values (''),(null),(null),(''),(''),('');
+select find_in_set(f1,f1) as a from t1,(select find_in_set(f1,f1) as b from t1) a;
+a
+0
+NULL
+NULL
+0
+0
+0
+0
+NULL
+NULL
+0
+0
+0
+0
+NULL
+NULL
+0
+0
+0
+0
+NULL
+NULL
+0
+0
+0
+0
+NULL
+NULL
+0
+0
+0
+0
+NULL
+NULL
+0
+0
+0
+drop table t1;

=== modified file 'mysql-test/t/func_set.test'
--- a/mysql-test/t/func_set.test	2007-11-23 12:30:06 +0000
+++ b/mysql-test/t/func_set.test	2009-04-21 07:23:07 +0000
@@ -72,3 +72,15 @@ SELECT INTERVAL(0.0, CAST(DATE(NULL) AS 
   CAST(DATE(NULL) AS DECIMAL), CAST(DATE(NULL) AS DECIMAL));
 
 --echo End of 5.0 tests
+
+#
+# Bug#44367 valgrind warnings with find_in_set() functions
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (f1 set('test1','test2','test3') character set utf8 default null)
+engine=myisam default charset=latin1;
+insert into t1 values (''),(null),(null),(''),(''),('');
+select find_in_set(f1,f1) as a from t1,(select find_in_set(f1,f1) as b from t1) a;
+drop table t1;

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2009-04-08 23:42:51 +0000
+++ b/sql/item_func.cc	2009-04-21 07:23:07 +0000
@@ -2716,7 +2716,7 @@ longlong Item_func_find_in_set::val_int(
   int diff;
   if ((diff=buffer->length() - find->length()) >= 0)
   {
-    my_wc_t wc;
+    my_wc_t wc= 0;
     CHARSET_INFO *cs= cmp_collation.collation;
     const char *str_begin= buffer->ptr();
     const char *str_end= buffer->ptr();


Attachment: [text/bzr-bundle] bzr/sergey.glukhov@sun.com-20090421072307-yucopyvfsbmgbyre.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (Sergey.Glukhov:2861)Bug#44367Sergey Glukhov21 Apr