summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2001-08-09 19:16:15 -0600
committerunknown <sasha@mysql.sashanet.com>2001-08-09 19:16:15 -0600
commit9a6a7bf5f694dae0b33e61301a17f7aa6fcd1b62 (patch)
treeed06f905f1515a2117cc0c243c526264fccaac77 /mysql-test
parent4bb40187438bdfb8b1d8b091399bd01e0e3425c1 (diff)
parentebb3bd0f75ecb2b89e4fe07c693caa9e09c2ce3a (diff)
downloadmariadb-git-9a6a7bf5f694dae0b33e61301a17f7aa6fcd1b62.tar.gz
merged
BitKeeper/etc/logging_ok: auto-union BitKeeper/etc/ignore: auto-union Makefile.am: Auto merged ltmain.sh: Auto merged libmysql/Makefile.shared: Auto merged libmysql/libmysql.c: Auto merged myisam/myisamchk.c: Auto merged mysql-test/t/bdb.test: Auto merged sql/ha_myisam.cc: Auto merged sql/item_func.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_select.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/bdb.result2
-rw-r--r--mysql-test/r/order_by.result25
-rw-r--r--mysql-test/t/bdb.test7
-rw-r--r--mysql-test/t/fulltext.test23
-rw-r--r--mysql-test/t/order_by.test38
5 files changed, 93 insertions, 2 deletions
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result
index 89d9c56b3b0..39b4962ef58 100644
--- a/mysql-test/r/bdb.result
+++ b/mysql-test/r/bdb.result
@@ -139,6 +139,8 @@ t1 1 level 1 level A 3 NULL NULL
gesuchnr benutzer_id
1 1
2 1
+id x
+1 2
Table Op Msg_type Msg_text
test.t1 optimize status OK
a
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index a47fc950f0e..79b70ac2cc9 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -111,6 +111,31 @@ DateOfAction TransactionID
member_id nickname voornaam
1
2
+gid sid uid
+104620 5 15
+103867 5 27
+103962 5 27
+104619 5 75
+104505 5 117
+103853 5 250
+gid sid uid
+104620 5 15
+103867 5 27
+103962 5 27
+104619 5 75
+104505 5 117
+103853 5 250
+table type possible_keys key key_len ref rows Extra
+t1 index PRIMARY PRIMARY 4 NULL 6 Using index
+t2 eq_ref PRIMARY,uid PRIMARY 4 t1.gid 1
+t3 eq_ref PRIMARY PRIMARY 2 t2.uid 1 where used; Using index
+table type possible_keys key key_len ref rows Extra
+t1 index PRIMARY PRIMARY 4 NULL 6 Using index
+t3 eq_ref PRIMARY PRIMARY 2 t1.gid 1 where used
+table type possible_keys key key_len ref rows Extra
+t1 index PRIMARY PRIMARY 4 NULL 6 Using index; Using temporary; Using filesort
+t2 eq_ref PRIMARY,uid PRIMARY 4 t1.gid 1
+t3 eq_ref PRIMARY PRIMARY 2 t2.uid 1 where used; Using index
table type possible_keys key key_len ref rows Extra
t1 range a a 20 NULL 2 where used; Using index
a b c
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test
index f0c24722e90..5e28c31e051 100644
--- a/mysql-test/t/bdb.test
+++ b/mysql-test/t/bdb.test
@@ -65,6 +65,13 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1);
select * from t1;
drop table t1;
+# test for bug in replace with secondary key
+create table t1 (id int not null primary key, x int not null, key (x)) type=bdb;
+insert into t1 (id, x) values (1, 1);
+replace into t1 (id, x) values (1, 2);
+select * from t1;
+drop table t1;
+
#
# test delete using hidden_primary_key
#
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 064219c6ad3..153fdefd960 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -2,7 +2,7 @@
# Test of fulltext index
#
-drop table if exists t1,t2;
+drop table if exists t1,t2,t3;
CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),('Full-text indexes', 'are called collections'),('Only MyISAM tables','support collections'),('Function MATCH ... AGAINST()','is used to do a search'),('Full-text search in MySQL', 'implements vector space model');
@@ -61,4 +61,23 @@ select * from t2 where MATCH inhalt AGAINST (NULL);
select * from t2 where MATCH inhalt AGAINST ('foobar');
select * from t2 having MATCH inhalt AGAINST ('foobar');
-drop table t1,t2;
+#
+# check of fulltext errors
+#
+
+CREATE TABLE t3 (
+ ticket int(11),
+ inhalt text,
+ KEY tig (ticket),
+ fulltext index tix (inhalt)
+);
+
+--error 1210
+select * from t2 having MATCH inhalt AGAINST (t1.id);
+--error 1210
+select * from t2 having MATCH ticket AGAINST ('foobar');
+--error 1210
+select * from t2,t3 having MATCH (t2.inhalt,t3.inhalt) AGAINST ('foobar');
+
+drop table t1,t2,t3;
+
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 08d26413761..baa3fe67f0b 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -254,3 +254,41 @@ select * from t1 where a between 0 and 1 order by a desc, b desc;
drop table t1;
+CREATE TABLE t1 (
+ gid int(10) unsigned NOT NULL auto_increment,
+ cid smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (gid),
+ KEY component_id (cid)
+) TYPE=MyISAM;
+INSERT INTO t1 VALUES (103853,108),(103867,108),(103962,108),(104505,108),(104619,108),(104620,108);
+ALTER TABLE t1 add skr int(10) not null;
+
+CREATE TABLE t2 (
+ gid int(10) unsigned NOT NULL default '0',
+ uid smallint(5) unsigned NOT NULL default '1',
+ sid tinyint(3) unsigned NOT NULL default '1',
+ PRIMARY KEY (gid),
+ KEY uid (uid),
+ KEY status_id (sid)
+) TYPE=MyISAM;
+INSERT INTO t2 VALUES (103853,250,5),(103867,27,5),(103962,27,5),(104505,117,5),(104619,75,5),(104620,15,5);
+
+CREATE TABLE t3 (
+ uid smallint(6) NOT NULL auto_increment,
+ PRIMARY KEY (uid)
+) TYPE=MyISAM;
+INSERT INTO t3 VALUES (1),(15),(27),(75),(117),(250);
+ALTER TABLE t3 add skr int(10) not null;
+
+select t1.gid, t2.sid, t3.uid from t2, t1, t3 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid;
+select t1.gid, t2.sid, t3.uid from t3, t2, t1 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid;
+
+# The following ORDER BY can be optimimized
+EXPLAIN select t1.gid, t2.sid, t3.uid from t3, t2, t1 where t2.gid = t1.gid and t2.uid = t3.uid order by t1.gid, t3.uid;
+EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.gid = t3.uid order by t1.gid,t3.skr;
+
+# The following ORDER BY can't be optimimized
+EXPLAIN SELECT t1.gid, t2.sid, t3.uid from t2, t1, t3 where t2.gid = t1.gid and t2.uid = t3.uid order by t3.uid, t1.gid;
+EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.gid = t3.uid order by t3.skr,t1.gid;
+EXPLAIN SELECT t1.gid, t3.uid from t1, t3 where t1.skr = t3.uid order by t1.gid,t3.skr;
+drop table t1,t2,t3;