diff options
author | Alexander Barkov <bar@mariadb.org> | 2013-08-22 16:23:54 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2013-08-22 16:23:54 +0400 |
commit | d1adae3707cf509bf8268315ebf499b206327de2 (patch) | |
tree | 43b6708e6c0490e53918ae68fa19d738cd0f5639 /mysql-test/r | |
parent | f5ea23b6e2bedb4bdaed7f53325cfce35acc8a3e (diff) | |
parent | c40de1df363da0bc04118b4957c94fd52afe20b0 (diff) | |
download | mariadb-git-d1adae3707cf509bf8268315ebf499b206327de2.tar.gz |
Merging from 5.3
pending merges:
Alexander Barkov 2013-08-22 MDEV-4804 Date comparing false result
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/type_date.result | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index af747dca562..4ead8f8d743 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -311,6 +311,44 @@ NULL Warnings: Warning 1292 Incorrect datetime value: '2022-00-00 00:00:00' # +# MDEV-4804 Date comparing false result +# +SET @h0="20111107"; +SET @h1="0"; +SET @@timestamp=UNIX_TIMESTAMP('2013-08-19 20:30:00'); +SELECT +COALESCE(DATE(@h0),DATE("1901-01-01")) AS h0d, +COALESCE(DATE(@h1),DATE(NOW())) AS h1d, +COALESCE(DATE(@h0),DATE("1901-01-01"))>COALESCE(DATE(@h1),DATE(NOW())) AS compare_h0_gt_h1; +h0d h1d compare_h0_gt_h1 +2011-11-07 2013-08-19 0 +Warnings: +Warning 1292 Incorrect datetime value: '0' +Warning 1292 Incorrect datetime value: '0' +SELECT +DATE('20011107'), +DATE('0'), +COALESCE(DATE('0'),CURRENT_DATE) AS d1, +DATE('20011107')>COALESCE(DATE('0'),CURRENT_DATE) AS cmp; +DATE('20011107') DATE('0') d1 cmp +2001-11-07 NULL 2013-08-19 0 +Warnings: +Warning 1292 Incorrect datetime value: '0' +Warning 1292 Incorrect datetime value: '0' +Warning 1292 Incorrect datetime value: '0' +SELECT +DATE('20011107'), +DATE('0'), +IFNULL(DATE('0'),CURRENT_DATE) AS d1, +DATE('20011107')>IFNULL(DATE('0'),CURRENT_DATE) AS cmp; +DATE('20011107') DATE('0') d1 cmp +2001-11-07 NULL 2013-08-19 0 +Warnings: +Warning 1292 Incorrect datetime value: '0' +Warning 1292 Incorrect datetime value: '0' +Warning 1292 Incorrect datetime value: '0' +SET @@timestamp=DEFAULT; +# # End of 5.3 tests # # |