diff options
author | unknown <sanja@montyprogram.com> | 2013-08-19 13:12:03 +0300 |
---|---|---|
committer | unknown <sanja@montyprogram.com> | 2013-08-19 13:12:03 +0300 |
commit | dafa458262fb47a2c9534bcc36088b15e26307c2 (patch) | |
tree | 62eb5695cf05f61573803a17c81a061ddc8ad3be | |
parent | 7c85205d193dc8ecd8b2ce2796e271536f3b42b1 (diff) | |
download | mariadb-git-dafa458262fb47a2c9534bcc36088b15e26307c2.tar.gz |
mysql-test/r/func_set.result:
merge
-rw-r--r-- | mysql-test/r/func_set.result | 19 | ||||
-rw-r--r-- | mysql-test/t/func_set.test | 15 | ||||
-rw-r--r-- | sql/item_cmpfunc.cc | 2 |
3 files changed, 35 insertions, 1 deletions
diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index ba9500bff46..492349fab2d 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -201,3 +201,22 @@ NULL 1,2,3,4,5,6,7 DROP TABLE t1; +# +# Start of 5.3 tests +# +# +# MDEV-4512 Valgrind warnings in my_long10_to_str_8bit on INTERVAL and DATE_ADD with incorrect types +# +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (10),(11); +SELECT INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 ) FROM t1; +INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 ) +8 +8 +Warnings: +Warning 1292 Incorrect datetime value: '10' +Warning 1292 Incorrect datetime value: '11' +DROP TABLE t1; +# +# End of 5.3 tests +# diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test index 3531864c860..c3428c2a868 100644 --- a/mysql-test/t/func_set.test +++ b/mysql-test/t/func_set.test @@ -119,3 +119,18 @@ SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL) IS UNKNOWN; --echo DROP TABLE t1; +--echo # +--echo # Start of 5.3 tests +--echo # + +--echo # +--echo # MDEV-4512 Valgrind warnings in my_long10_to_str_8bit on INTERVAL and DATE_ADD with incorrect types +--echo # +CREATE TABLE t1 (pk INT PRIMARY KEY); +INSERT INTO t1 VALUES (10),(11); +SELECT INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 ) FROM t1; +DROP TABLE t1; + +--echo # +--echo # End of 5.3 tests +--echo # diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 9b58e9bab7c..155a9afdafe 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2006,7 +2006,7 @@ void Item_func_interval::fix_length_and_dec() for (uint i= 1; not_null_consts && i < rows; i++) { Item *el= row->element_index(i); - not_null_consts&= el->const_item() & !el->is_null(); + not_null_consts&= el->const_item() && !el->is_null(); } if (not_null_consts && |