diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-03-20 16:13:00 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-03-20 16:13:00 +0100 |
commit | 1be429561723dc20ff7f4f1739eb0580cf70564b (patch) | |
tree | 36577a308ee252832c448423cd69006ac15bde8b /mysql-test | |
parent | 8f607aae127439e132dae00b2750727162f4d564 (diff) | |
download | mariadb-git-1be429561723dc20ff7f4f1739eb0580cf70564b.tar.gz |
MDEV-4293 Valgrind warnings (Conditional jump or move depends on uninitialised value) in remove_eq_conds on time functions with NULL argument
val_int() is expected to return 0 for NULL's
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_time.result | 12 | ||||
-rw-r--r-- | mysql-test/t/func_time.test | 10 |
2 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index c2e287be046..3828af31991 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1898,3 +1898,15 @@ microsecond('12:00:00.123456') microsecond('2009-12-31 23:59:59.000010') 123456 10 select now(258); ERROR 42000: Too big precision 258 specified for 'now'. Maximum is 6. +SELECT 1 FROM DUAL WHERE YEAR(TIMEDIFF(NULL, '12:12:12')); +1 +SELECT 1 FROM DUAL WHERE MONTH(TIMEDIFF(NULL, '12:12:12')); +1 +SELECT 1 FROM DUAL WHERE DAYOFMONTH(TIMEDIFF(NULL, '12:12:12')); +1 +SELECT 1 FROM DUAL WHERE HOUR(TIMEDIFF(NULL, '12:12:12')); +1 +SELECT 1 FROM DUAL WHERE MINUTE(TIMEDIFF(NULL, '12:12:12')); +1 +SELECT 1 FROM DUAL WHERE SECOND(TIMEDIFF(NULL, '12:12:12')); +1 diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index c3d1d74ec50..c68b1260396 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1144,3 +1144,13 @@ select microsecond('12:00:00.123456'), microsecond('2009-12-31 23:59:59.000010') --error ER_TOO_BIG_PRECISION select now(258); + +# +# MDEV-4293 Valgrind warnings (Conditional jump or move depends on uninitialised value) in remove_eq_conds on time functions with NULL argument in WHERE +# +SELECT 1 FROM DUAL WHERE YEAR(TIMEDIFF(NULL, '12:12:12')); +SELECT 1 FROM DUAL WHERE MONTH(TIMEDIFF(NULL, '12:12:12')); +SELECT 1 FROM DUAL WHERE DAYOFMONTH(TIMEDIFF(NULL, '12:12:12')); +SELECT 1 FROM DUAL WHERE HOUR(TIMEDIFF(NULL, '12:12:12')); +SELECT 1 FROM DUAL WHERE MINUTE(TIMEDIFF(NULL, '12:12:12')); +SELECT 1 FROM DUAL WHERE SECOND(TIMEDIFF(NULL, '12:12:12')); |