summaryrefslogtreecommitdiff
path: root/mysql-test/t/distinct.test
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-08-17 00:35:51 +0300
committermonty@hundin.mysql.fi <>2002-08-17 00:35:51 +0300
commit5773b6504a888d61af1cdf7c0764bff7860ab90a (patch)
treea5bba2df04761e778b4e626fc71182b2708f85ff /mysql-test/t/distinct.test
parent5ff30464a68f70e01664a0af8dd9406e839c99ab (diff)
downloadmariadb-git-5773b6504a888d61af1cdf7c0764bff7860ab90a.tar.gz
Fixed bug in blocking handling when compiling with OPENSSL (caused hangup in client code)
Fixed bug in SELECT DISTINCT ... ORDER BY not-used-column. Fixed bug in pthread_mutex_trylock with HPUX 11.0
Diffstat (limited to 'mysql-test/t/distinct.test')
-rw-r--r--mysql-test/t/distinct.test24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index b850ec5d562..e4503b0cf72 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -218,3 +218,27 @@ select * from t1 where a >= '1';
select distinct a from t1 order by a desc;
select distinct a from t1 where a >= '1' order by a desc;
drop table t1;
+
+#
+# Test when using a not previously used column in ORDER BY
+#
+
+CREATE TABLE t1 (email varchar(50), infoID BIGINT, dateentered
+DATETIME);
+CREATE TABLE t2 (infoID BIGINT, shipcode varchar(10));
+
+INSERT INTO t1 (email, infoID, dateentered) VALUES
+ ('test1@testdomain.com', 1, '2002-07-30 22:56:38'),
+ ('test1@testdomain.com', 1, '2002-07-27 22:58:16'),
+ ('test2@testdomain.com', 1, '2002-06-19 15:22:19'),
+ ('test2@testdomain.com', 2, '2002-06-18 14:23:47'),
+ ('test3@testdomain.com', 1, '2002-05-19 22:17:32');
+
+INSERT INTO t2(infoID, shipcode) VALUES
+ (1, 'Z001'),
+ (2, 'R002');
+
+SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
+SELECT DISTINCTROW email FROM t1 ORDER BY dateentered DESC;
+SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID ORDER BY dateentered DESC;
+drop table t1,t2;