summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_if.result
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-06-02 17:00:07 +0400
committerunknown <evgen@moonbone.local>2005-06-02 17:00:07 +0400
commitc8e797b5b6d921803746d82b81c5e9e35d7c03a6 (patch)
tree949f9227c41dce4163f3d62c019efd88dbee6371 /mysql-test/r/func_if.result
parenta6cf849e0def7f612a2ccb2e2ce281287db3f6e5 (diff)
downloadmariadb-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/r/func_if.result')
-rw-r--r--mysql-test/r/func_if.result17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result
index 4db31121756..3e72fb45a14 100644
--- a/mysql-test/r/func_if.result
+++ b/mysql-test/r/func_if.result
@@ -91,3 +91,20 @@ drop table t1;
SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL;
NULLIF(5,5) IS NULL NULLIF(5,5) IS NOT NULL
1 0
+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;
+id date_ord text
+1 05-03-2005 Day 1
+2 16-03-2005 Day 2
+3 28-03-2005 Day 3
+SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord DESC;
+id date_ord text
+3 28-03-2005 Day 3
+2 16-03-2005 Day 2
+1 05-03-2005 Day 1
+DROP TABLE t1;