[Commits] Rev 3557: Merge 5.2->5.3. in http://bazaar.launchpad.net/~maria-captains/maria/5.3

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Wed Aug 22 15:27:04 EEST 2012


At http://bazaar.launchpad.net/~maria-captains/maria/5.3

------------------------------------------------------------
revno: 3557 [merge]
revision-id: knielsen at knielsen-hq.org-20120822122650-rrghttpvuj211757
parent: psergey at askmonty.org-20120821182434-v4qwqc82ptql3v5m
parent: sanja at montyprogram.com-20120621154713-bspct1g9ui6ehtkh
committer: knielsen at knielsen-hq.org
branch nick: mariadb-5.3
timestamp: Wed 2012-08-22 14:26:50 +0200
message:
  Merge 5.2->5.3.
modified:
  mysql-test/r/case.result       sp1f-case.result-20001228015633-zt3tvi3yr42ycsgkeoycm5jbymflme5z
  mysql-test/r/compare.result    sp1f-compare.result-20001228015633-6omgrcr5lejsgilph57vswnwgf3t7sln
  mysql-test/t/case.test         sp1f-case.test-20001228015635-cvkiaivpkn4vfh6pa3k7gqhddmzaypeb
  mysql-test/t/compare.test      sp1f-compare.test-20001228015635-kh3xjgbn4tw7oxkhbbeyf7fubmla2jhi
  sql/item_cmpfunc.cc            sp1f-item_cmpfunc.cc-19700101030959-hrk7pi2n6qpwxauufnkizirsoucdcx2e
=== modified file 'mysql-test/r/case.result'
--- a/mysql-test/r/case.result	2011-09-07 18:39:47 +0000
+++ b/mysql-test/r/case.result	2012-08-22 12:26:50 +0000
@@ -225,3 +225,7 @@ case t1.f1 when '00:00:00' then 1 end
 1
 NULL
 drop table t1;
+CREATE TABLE t1(a YEAR);
+SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
+1
+DROP TABLE t1;

=== modified file 'mysql-test/r/compare.result'
--- a/mysql-test/r/compare.result	2011-10-05 15:18:00 +0000
+++ b/mysql-test/r/compare.result	2012-08-22 12:26:50 +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/case.test'
--- a/mysql-test/t/case.test	2011-09-07 18:39:47 +0000
+++ b/mysql-test/t/case.test	2012-08-22 12:26:50 +0000
@@ -179,3 +179,13 @@ create table t1 (f1 time);
 insert t1 values ('00:00:00'),('00:01:00');
 select case t1.f1 when '00:00:00' then 1 end from t1;
 drop table t1;
+
+#
+# LP BUG#1001510
+# Bug #11764313 57135: CRASH IN ITEM_FUNC_CASE::FIND_ITEM WITH CASE WHEN
+# ELSE CLAUSE
+#
+
+CREATE TABLE t1(a YEAR);
+SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
+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	2012-06-21 15:47:13 +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	2012-06-18 18:38:11 +0000
+++ b/sql/item_cmpfunc.cc	2012-08-22 12:26:50 +0000
@@ -3007,6 +3007,15 @@ void Item_func_case::fix_length_and_dec(
           return;
       }
     }
+    /*
+      Set cmp_context of all WHEN arguments. This prevents
+      Item_field::equal_fields_propagator() from transforming a
+      zerofill argument into a string constant. Such a change would
+      require rebuilding cmp_items.
+    */
+    for (i= 0; i < ncases; i+= 2)
+      args[i]->cmp_context= item_cmp_type(left_result_type,
+                                          args[i]->result_type());
   }
 
   if (else_expr_num == -1 || args[else_expr_num]->maybe_null)
@@ -3986,6 +3995,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;
 }
 



More information about the commits mailing list