summaryrefslogtreecommitdiff
path: root/mysql-test/t/distinct.test
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-08-17 00:35:51 +0300
committerunknown <monty@hundin.mysql.fi>2002-08-17 00:35:51 +0300
commit96f2e21e99394352ad062ae788e70a17a788f92c (patch)
treea5bba2df04761e778b4e626fc71182b2708f85ff /mysql-test/t/distinct.test
parent7139794e299b9b9f118dbf4a9cddfbb027776983 (diff)
downloadmariadb-git-96f2e21e99394352ad062ae788e70a17a788f92c.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 Docs/manual.texi: Changelog include/my_pthread.h: Fix for pthread_mutex_trylock when used with SAFEMUTEX include/violite.h: Fixed bug in blocking handling when compiling with OPENSSL (caused hangup in client code) innobase/buf/buf0buf.c: Fixed wrong format string libmysqld/lib_sql.cc: Fixed hangup in embedded server. mysql-test/r/distinct.result: Fixed bug in SELECT DISTINCT ... ORDER BY not-used-column mysql-test/t/distinct.test: Fixed bug in SELECT DISTINCT ... ORDER BY not-used-column mysys/my_pthread.c: Cleanup of pthread_xxx rewrite code. Fixed bug in pthread_mutex_trylock with HPUX 11.0 sql/gen_lex_hash.cc: Smaller hash array sql/mysqld.cc: Fixed hangup in embedded server. sql/sql_select.cc: Fixed bug in SELECT DISTINCT ... ORDER BY not-used-column vio/vio.c: Added vio_ssl_blocking vio/viossl.c: Added vio_ssl_blocking
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;