From 31065adc5cabb287ab1df623fd2c31b6ebf9dec6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 17 Aug 2002 00:35:51 +0300 Subject: 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 --- mysql-test/t/distinct.test | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mysql-test/t/distinct.test') 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; -- cgit v1.2.1