diff options
author | unknown <evgen@moonbone.local> | 2005-06-02 17:00:07 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2005-06-02 17:00:07 +0400 |
commit | c8e797b5b6d921803746d82b81c5e9e35d7c03a6 (patch) | |
tree | 949f9227c41dce4163f3d62c019efd88dbee6371 /mysql-test/t/func_if.test | |
parent | a6cf849e0def7f612a2ccb2e2ce281287db3f6e5 (diff) | |
download | mariadb-git-c8e797b5b6d921803746d82b81c5e9e35d7c03a6.tar.gz |
Fix bug #9669 Ordering on IF function with FROM_UNIXTIME function fails
Integer overflow results in wrong field sortlength.
sql/item_cmpfunc.cc:
Fix bug #9669 Ordering on IF function with FROM_UNIXTIME function fails.
mysql-test/t/func_if.test:
Test for bug #9669 Ordering on IF function with FROM_UNIXTIME function fails.
mysql-test/r/func_if.result:
Test for bug #9669 Ordering on IF function with FROM_UNIXTIME function fails.
Diffstat (limited to 'mysql-test/t/func_if.test')
-rw-r--r-- | mysql-test/t/func_if.test | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test index a2ea26390ca..37556984f68 100644 --- a/mysql-test/t/func_if.test +++ b/mysql-test/t/func_if.test @@ -61,3 +61,17 @@ drop table t1; # Bug #5595 NULLIF() IS NULL returns false if NULLIF() returns NULL # SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL; + +# +# Bug #9669 Ordering on IF function with FROM_UNIXTIME function fails +# +CREATE TABLE `t1` ( + `id` int(11) NOT NULL , + `date` int(10) default NULL, + `text` varchar(32) NOT NULL +); +INSERT INTO t1 VALUES (1,1110000000,'Day 1'),(2,1111000000,'Day 2'),(3,1112000000,'Day 3'); +SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord ASC; +SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord DESC; +DROP TABLE t1; + |