summaryrefslogtreecommitdiff
path: root/mysql-test/t/distinct.test
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-09-12 04:18:07 +0300
committerunknown <monty@mashka.mysql.fi>2003-09-12 04:18:07 +0300
commit3500763b6e156bcdcb627fbc448681ec3c74c50e (patch)
treed50c5c2c1a243241a31006d775628dd2fcc29a03 /mysql-test/t/distinct.test
parent41824a35338012ff8196eb975f961d5e0f0e2a22 (diff)
downloadmariadb-git-3500763b6e156bcdcb627fbc448681ec3c74c50e.tar.gz
Optimize thai character handling
Remove sel000xxxx tests After merge fixes BitKeeper/deleted/.del-sel000033.test~3971fbe746eec069: Delete: mysql-test/t/sel000033.test BitKeeper/deleted/.del-sel000033.result~56d1d02d72b94602: Delete: mysql-test/r/sel000033.result BitKeeper/deleted/.del-sel000100.result~84ed46856cb3a69f: Delete: mysql-test/r/sel000100.result BitKeeper/deleted/.del-sel000100.test~548501cad19a1a59: Delete: mysql-test/t/sel000100.test mysql-test/r/distinct.result: Merge test with sel000100 mysql-test/r/grant.result: Update result after merge mysql-test/r/range.result: After merge fix Merge test with sel000033 mysql-test/t/distinct.test: Merge test with sel000100 mysql-test/t/range.test: Merge test with sel000033 sql/log_event.cc: Remove duplicate allocation sql/sql_select.cc: After merge fixes strings/ctype-tis620.c: Remove usage of strnlen Optimize code and make it \0 safe
Diffstat (limited to 'mysql-test/t/distinct.test')
-rw-r--r--mysql-test/t/distinct.test47
1 files changed, 47 insertions, 0 deletions
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test
index 0563b432873..56c00e7501c 100644
--- a/mysql-test/t/distinct.test
+++ b/mysql-test/t/distinct.test
@@ -285,3 +285,50 @@ INSERT INTO t1 VALUES (3, 'aaaaa');
INSERT INTO t1 VALUES (2, 'eeeeeee');
select distinct left(name,1) as name from t1;
drop table t1;
+
+#
+# Test case from sel000100
+#
+
+CREATE TABLE t1 (
+ ID int(11) NOT NULL auto_increment,
+ NAME varchar(75) DEFAULT '' NOT NULL,
+ LINK_ID int(11) DEFAULT '0' NOT NULL,
+ PRIMARY KEY (ID),
+ KEY NAME (NAME),
+ KEY LINK_ID (LINK_ID)
+);
+
+INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (1,'Mike',0);
+INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (2,'Jack',0);
+INSERT INTO t1 (ID, NAME, LINK_ID) VALUES (3,'Bill',0);
+
+CREATE TABLE t2 (
+ ID int(11) NOT NULL auto_increment,
+ NAME varchar(150) DEFAULT '' NOT NULL,
+ PRIMARY KEY (ID),
+ KEY NAME (NAME)
+);
+
+SELECT DISTINCT
+ t2.id AS key_link_id,
+ t2.name AS link
+FROM t1
+LEFT JOIN t2 ON t1.link_id=t2.id
+GROUP BY t1.id
+ORDER BY link;
+drop table t1,t2;
+
+#
+# test case for #674
+#
+
+CREATE TABLE t1 (
+ html varchar(5) default NULL,
+ rin int(11) default '0',
+ out int(11) default '0'
+) TYPE=MyISAM;
+
+INSERT INTO t1 VALUES ('1',1,0);
+SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
+drop table t1;