List:Commits« Previous MessageNext Message »
From:Marc Alff Date:October 27 2011 7:13am
Subject:bzr push into mysql-trunk-wl5863 branch (marc.alff:3416 to 3417)
View as plain text  
 3417 Marc Alff	2011-10-27 [merge]
      Merge mysql-trunk --> mysql-trunk-wl5863

    modified:
      mysql-test/r/compare.result
      mysql-test/t/compare.test
      sql/item_cmpfunc.cc
 3416 Marc Alff	2011-10-27 [merge]
      Merge mysql-trunk --> mysql-trunk-wl5863

=== modified file 'mysql-test/r/compare.result'
--- a/mysql-test/r/compare.result	2011-07-19 15:11:15 +0000
+++ b/mysql-test/r/compare.result	2011-10-27 07:03:49 +0000
@@ -96,3 +96,7 @@ SELECT * FROM t1 WHERE a > '2008-01-01'
 a
 DROP TABLE t1;
 End of 5.0 tests
+CREATE TABLE t1(a INT ZEROFILL);
+SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2;
+1
+DROP TABLE t1;

=== modified file 'mysql-test/t/compare.test'
--- a/mysql-test/t/compare.test	2008-09-18 12:55:36 +0000
+++ b/mysql-test/t/compare.test	2011-10-27 07:03:49 +0000
@@ -86,3 +86,11 @@ SELECT * FROM t1 WHERE a > '2008-01-01'
 DROP TABLE t1;
 
 --echo End of 5.0 tests
+
+#
+# Bug #11764818 57692: Crash in item_func_in::val_int() with ZEROFILL
+#
+
+CREATE TABLE t1(a INT ZEROFILL);
+SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2;
+DROP TABLE t1;

=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc	2011-10-18 13:45:29 +0000
+++ b/sql/item_cmpfunc.cc	2011-10-27 07:03:49 +0000
@@ -4242,6 +4242,16 @@ void Item_func_in::fix_length_and_dec()
       }
     }
   }
+  /*
+    Set cmp_context of all arguments. This prevents
+    Item_field::equal_fields_propagator() from transforming a zerofill integer
+    argument into a string constant. Such a change would require rebuilding
+    cmp_itmes.
+   */
+  for (arg= args + 1, arg_end= args + arg_count; arg != arg_end ; arg++)
+  {
+    arg[0]->cmp_context= item_cmp_type(left_result_type, arg[0]->result_type());
+  }
   max_length= 1;
 }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5863 branch (marc.alff:3416 to 3417) Marc Alff27 Oct