summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2003-08-01 14:58:57 +0200
committerunknown <serg@serg.mylan>2003-08-01 14:58:57 +0200
commit964569510899d778917849c4a9984cc3f2ab3b16 (patch)
treeaf561dccb79dcd184bfece98d96f9bc1fde44f4b /mysql-test
parent53c7ab7afbe74d8d063fe177420b339c762f27c3 (diff)
parent77e16415dc60baf120d98650ba058718a08494c0 (diff)
downloadmariadb-git-964569510899d778917849c4a9984cc3f2ab3b16.tar.gz
Merge bk-internal:/home/bk/mysql-4.0/
into serg.mylan:/usr/home/serg/Abk/mysql-4.0
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/fulltext.result11
-rw-r--r--mysql-test/r/select.result20
-rw-r--r--mysql-test/t/fulltext.test16
-rw-r--r--mysql-test/t/select.test20
4 files changed, 66 insertions, 1 deletions
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 646c1a7bee2..737390865f1 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -256,3 +256,14 @@ select ref_mag from t1 where match ref_mag against ('+test' in boolean mode);
ref_mag
test
drop table t1;
+create table t1 (t1_id int(11) primary key, name varchar(32));
+insert into t1 values (1, 'data1');
+insert into t1 values (2, 'data2');
+create table t2 (t2_id int(11) primary key, t1_id int(11), name varchar(32));
+insert into t2 values (1, 1, 'xxfoo');
+insert into t2 values (2, 1, 'xxbar');
+insert into t2 values (3, 1, 'xxbuz');
+select * from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against('xxfoo' in boolean mode);
+t1_id name t2_id t1_id name
+1 data1 1 1 xxfoo
+drop table t1,t2;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 811c396ea67..bde527b9b44 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3508,3 +3508,23 @@ aa id t2_id id
5 8303 2520 2520
6 8304 2521 2521
drop table t1,t2;
+create table t1 (id1 int NOT NULL);
+create table t2 (id2 int NOT NULL);
+create table t3 (id3 int NOT NULL);
+create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4));
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t2 values (1);
+insert into t4 values (1,1);
+explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3
+left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
+table type possible_keys key key_len ref rows Extra
+t3 system NULL NULL NULL NULL 0 const row not found
+t1 ALL NULL NULL NULL NULL 2
+t2 ALL NULL NULL NULL NULL 1
+t4 ALL id4 NULL NULL NULL 1 Using where
+select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3
+left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
+id1 id2 id3 id4 id44
+1 1 NULL NULL NULL
+drop table t1,t2,t3,t4;
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 942552f5e98..387a36f1f52 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -189,7 +189,7 @@ select * from t1 where match (a) against ('aaaa');
drop table t1;
#
-# bug 283 by jocelyn fournier <joc@presence-pc.com>
+# bug #283 by jocelyn fournier <joc@presence-pc.com>
# FULLTEXT index on a TEXT filed converted to a CHAR field doesn't work anymore
#
@@ -201,3 +201,17 @@ alter table t1 change ref_mag ref_mag char (255) not null;
select ref_mag from t1 where match ref_mag against ('+test' in boolean mode);
drop table t1;
+#
+# bug #942: JOIN
+#
+
+create table t1 (t1_id int(11) primary key, name varchar(32));
+insert into t1 values (1, 'data1');
+insert into t1 values (2, 'data2');
+create table t2 (t2_id int(11) primary key, t1_id int(11), name varchar(32));
+insert into t2 values (1, 1, 'xxfoo');
+insert into t2 values (2, 1, 'xxbar');
+insert into t2 values (3, 1, 'xxbuz');
+select * from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against('xxfoo' in boolean mode);
+drop table t1,t2;
+
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index c2e451ea7f3..9884c88b420 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1832,3 +1832,23 @@ INSERT INTO t2 VALUES (2517), (2518), (2519), (2520), (2521), (2522);
select * from t1, t2 WHERE t1.t2_id = t2.id and t1.t2_id > 0 order by t1.id LIMIT 0, 5;
drop table t1,t2;
+#
+# outer join, impossible on condition, where, and usable key for range
+#
+create table t1 (id1 int NOT NULL);
+create table t2 (id2 int NOT NULL);
+create table t3 (id3 int NOT NULL);
+create table t4 (id4 int NOT NULL, id44 int NOT NULL, KEY (id4));
+
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t2 values (1);
+insert into t4 values (1,1);
+
+explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3
+left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
+select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3
+left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
+
+drop table t1,t2,t3,t4;
+