summaryrefslogtreecommitdiff
path: root/mysql-test/t/order_by.test
diff options
context:
space:
mode:
authorgkodinov/kgeorge@magare.gmz <>2007-03-13 18:46:46 +0200
committergkodinov/kgeorge@magare.gmz <>2007-03-13 18:46:46 +0200
commit96629f2c99acbe73bedeedec28107dfbc75402b3 (patch)
tree8a400d2aeac44cd0da2f653fa9e2d39dfe4a17d1 /mysql-test/t/order_by.test
parentd0a623120157f48c19ae89fce7e674b0cffd8889 (diff)
parentd2c977a9355f69311d0007f5e1b2eac958e5084d (diff)
downloadmariadb-git-96629f2c99acbe73bedeedec28107dfbc75402b3.tar.gz
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B26672-5.0-opt
Diffstat (limited to 'mysql-test/t/order_by.test')
-rw-r--r--mysql-test/t/order_by.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index a0a1147336c..4597276e3bc 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -677,3 +677,18 @@ create table t1 (a int, b int, c int);
insert into t1 values (1,2,3), (9,8,3), (19,4,3), (1,4,9);
select a,(sum(b)/sum(c)) as ratio from t1 group by a order by sum(b)/sum(c) asc;
drop table t1;
+
+#
+# Bug#26672: Incorrect SEC_TO_TIME() casting in ORDER BY
+#
+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);
+
+-- Correct ORDER
+SELECT a, b FROM t1 ORDER BY b DESC;
+
+-- must be ordered as the above
+SELECT a, b FROM t1 ORDER BY SEC_TO_TIME(a) DESC;
+
+DROP TABLE t1;