[Commits] Rev 3856: Merge 5.3->5.5 in file:///home/igor/maria/maria-5.5/

Igor Babaev igor at askmonty.org
Wed Aug 21 21:27:36 EEST 2013


At file:///home/igor/maria/maria-5.5/

------------------------------------------------------------
revno: 3856 [merge]
revision-id: igor at askmonty.org-20130821182702-2446farfzf9trbk6
parent: jplindst at mariadb.org-20130820130534-2l6nkooq8hfzts6h
parent: igor at askmonty.org-20130820204713-98acrb6ezfz0fdbm
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.5
timestamp: Wed 2013-08-21 11:27:02 -0700
message:
  Merge 5.3->5.5
modified:
  mysql-test/r/null.result       sp1f-null.result-20001228015634-eu7snzgpkoadmi72tkozk7rjsbbonewc
  mysql-test/t/null.test         sp1f-null.test-20001228015636-vkft75tlc62uvgdd2ceyfio4gfzolpn2
  sql/item_cmpfunc.cc            sp1f-item_cmpfunc.cc-19700101030959-hrk7pi2n6qpwxauufnkizirsoucdcx2e
  sql/sql_select.cc              sp1f-sql_select.cc-19700101030959-egb7whpkh76zzvikycs5nsnuviu4fdlb
-------------- next part --------------
=== modified file 'mysql-test/r/null.result'
--- a/mysql-test/r/null.result	2011-11-27 16:46:20 +0000
+++ b/mysql-test/r/null.result	2013-08-21 18:27:02 +0000
@@ -343,3 +343,33 @@
 IFNULL(NULL, b)	decimal(1,0)	YES		NULL	
 DROP TABLE t1, t2;
 # End of 5.0 tests
+#
+# MDEV-4895 Valgrind warnings (Conditional jump or move depends on uninitialised value) in Field_datetime::get_date on GREATEST(..) IS NULL
+#
+CREATE TABLE t1 (dt DATETIME NOT NULL);
+INSERT INTO t1 VALUES (NOW()),(NOW());
+EXPLAIN
+SELECT * FROM t1 WHERE concat( dt, '2012-12-21 12:12:12' ) IS NULL;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE
+SELECT * FROM t1 WHERE concat( dt, '2012-12-21 12:12:12' ) IS NULL;
+dt
+DROP TABLE t1;
+CREATE TABLE t1 (dt INT NOT NULL);
+INSERT INTO t1 VALUES (1),(2);
+EXPLAIN
+SELECT * FROM t1 WHERE concat( dt, '1' ) IS NULL;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE
+SELECT * FROM t1 WHERE concat( dt, '1' ) IS NULL;
+dt
+DROP TABLE t1;
+CREATE TABLE t1 (dt INT NOT NULL);
+INSERT INTO t1 VALUES (1),(2);
+EXPLAIN
+SELECT * FROM t1 WHERE NOT (concat( dt, '1' ) IS NOT NULL);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE
+SELECT * FROM t1 WHERE NOT (concat( dt, '1' ) IS NOT NULL);
+dt
+DROP TABLE t1;

=== modified file 'mysql-test/t/null.test'
--- a/mysql-test/t/null.test	2009-02-10 03:00:11 +0000
+++ b/mysql-test/t/null.test	2013-08-20 14:08:03 +0000
@@ -255,3 +255,31 @@
 DROP TABLE t1, t2;
 
 --echo # End of 5.0 tests
+
+--echo #
+--echo # MDEV-4895 Valgrind warnings (Conditional jump or move depends on uninitialised value) in Field_datetime::get_date on GREATEST(..) IS NULL
+--echo #
+
+CREATE TABLE t1 (dt DATETIME NOT NULL);
+INSERT INTO t1 VALUES (NOW()),(NOW());
+
+EXPLAIN
+SELECT * FROM t1 WHERE concat( dt, '2012-12-21 12:12:12' ) IS NULL;
+SELECT * FROM t1 WHERE concat( dt, '2012-12-21 12:12:12' ) IS NULL;
+
+DROP TABLE t1;
+CREATE TABLE t1 (dt INT NOT NULL);
+INSERT INTO t1 VALUES (1),(2);
+EXPLAIN
+SELECT * FROM t1 WHERE concat( dt, '1' ) IS NULL;
+SELECT * FROM t1 WHERE concat( dt, '1' ) IS NULL;
+
+DROP TABLE t1;
+CREATE TABLE t1 (dt INT NOT NULL);
+INSERT INTO t1 VALUES (1),(2);
+
+EXPLAIN
+SELECT * FROM t1 WHERE NOT (concat( dt, '1' ) IS NOT NULL); 
+SELECT * FROM t1 WHERE NOT (concat( dt, '1' ) IS NOT NULL); 
+
+DROP TABLE t1;

=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc	2013-08-19 02:58:51 +0000
+++ b/sql/item_cmpfunc.cc	2013-08-21 18:27:02 +0000
@@ -4748,6 +4748,8 @@
 longlong Item_func_isnull::val_int()
 {
   DBUG_ASSERT(fixed == 1);
+  if (const_item() && !args[0]->maybe_null)
+    return 0;
   return args[0]->is_null() ? 1: 0;
 }
 
@@ -4755,6 +4757,8 @@
 {
   DBUG_ASSERT(fixed == 1);
   DBUG_ENTER("Item_is_not_null_test::val_int");
+  if (const_item() && !args[0]->maybe_null)
+    DBUG_RETURN(1);
   if (args[0]->is_null())
   {
     DBUG_PRINT("info", ("null"));

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2013-08-19 02:58:51 +0000
+++ b/sql/sql_select.cc	2013-08-21 18:27:02 +0000
@@ -13748,7 +13748,7 @@
         Propagate the newly formed multiple equalities to
         the all AND/OR levels of cond 
       */
-      bool is_simplifiable_cond= true;
+      bool is_simplifiable_cond= false;
       propagate_new_equalities(thd, cond, cond_equalities,
                                cond_equal->upper_levels,
                                &is_simplifiable_cond);
@@ -13759,7 +13759,7 @@
       */ 
       if (is_simplifiable_cond)
       {
-        if (!(cond= remove_eq_conds(thd, cond, cond_value)))
+        if (!(cond= internal_remove_eq_conds(thd, cond, cond_value)))
           return cond;
       }          
     }



More information about the commits mailing list