summaryrefslogtreecommitdiff
path: root/mysql-test/r/order_by.result
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@macbook.gmz>2007-03-07 14:51:45 +0200
committerunknown <gkodinov/kgeorge@macbook.gmz>2007-03-07 14:51:45 +0200
commite2706b6721324f8017affe1262dd62ba8f9f292b (patch)
tree723725675891aa53aeea24cd98da0bfabecf9e2b /mysql-test/r/order_by.result
parentcf31dff6f21e3459406218f8f0fe9eb184c93019 (diff)
downloadmariadb-git-e2706b6721324f8017affe1262dd62ba8f9f292b.tar.gz
Bug #26672:
DATE/DATETIME values are out of the currently supported 4 basic value types (INT,STRING,REAL and DECIMAL). So expressions (not fields) of compile type DATE/DATETIME are generally considered as STRING values. This is not so when they are compared : then they are compared as INTEGER values. But the rule for comparison as INTEGERS must be checked explicitly each time when a comparison is to be performed. filesort is one such place. However there the check was not done and hence the expressions (not fields) of type DATE/DATETIME were sorted by their string representation. Fixed to compare them as INTEGER values for filesort. mysql-test/r/order_by.result: Bug #26672: test case mysql-test/t/order_by.test: Bug #26672: test case sql/filesort.cc: Bug #26672: sort dates/times as integers
Diffstat (limited to 'mysql-test/r/order_by.result')
-rw-r--r--mysql-test/r/order_by.result22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 0b1edfd3e8f..2093b5cd465 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -934,3 +934,25 @@ a ratio
19 1.3333
9 2.6667
drop table t1;
+CREATE TABLE t1 (a INT UNSIGNED NOT NULL, b TIME);
+INSERT INTO t1 (a) VALUES (100000), (0), (100), (1000000),(10000), (1000), (10);
+UPDATE t1 SET b = SEC_TO_TIME(a);
+SELECT a, b FROM t1 ORDER BY b DESC;
+a b
+1000000 277:46:40
+100000 27:46:40
+10000 02:46:40
+1000 00:16:40
+100 00:01:40
+10 00:00:10
+0 00:00:00
+SELECT a, b FROM t1 ORDER BY SEC_TO_TIME(a) DESC;
+a b
+1000000 277:46:40
+100000 27:46:40
+10000 02:46:40
+1000 00:16:40
+100 00:01:40
+10 00:00:10
+0 00:00:00
+DROP TABLE t1;