summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-12-06 01:16:28 +0200
committermonty@hundin.mysql.fi <>2001-12-06 01:16:28 +0200
commit5c94a164225593586ae0fe5229917a0e8a283250 (patch)
tree72b6ce45de206772ff694d62b41d9fc5a16edbe8 /mysql-test
parent4c17825acd56ccbbf7e6649e7ebe98c34f992c84 (diff)
parent0f71e337b32c3388070f96160234df86eae964f8 (diff)
downloadmariadb-git-5c94a164225593586ae0fe5229917a0e8a283250.tar.gz
merge with 3.23.47
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/gcc296.result5
-rw-r--r--mysql-test/t/gcc296.test17
-rw-r--r--mysql-test/t/innodb.test16
-rw-r--r--mysql-test/t/join_outer.test12
-rw-r--r--mysql-test/t/myisam.test16
5 files changed, 66 insertions, 0 deletions
diff --git a/mysql-test/r/gcc296.result b/mysql-test/r/gcc296.result
new file mode 100644
index 00000000000..7184bfb9cdc
--- /dev/null
+++ b/mysql-test/r/gcc296.result
@@ -0,0 +1,5 @@
+kodoboru obor aobor
+0101000000 aaa AAA
+0102000000 bbb BBB
+0103000000 ccc CCC
+0104000000 xxx XXX
diff --git a/mysql-test/t/gcc296.test b/mysql-test/t/gcc296.test
new file mode 100644
index 00000000000..7c72b57ca54
--- /dev/null
+++ b/mysql-test/t/gcc296.test
@@ -0,0 +1,17 @@
+#try to crash gcc 2.96
+drop table if exists obory;
+CREATE TABLE obory (
+ kodoboru varchar(10) default NULL,
+ obor tinytext,
+ aobor tinytext,
+ UNIQUE INDEX kodoboru (kodoboru),
+ FULLTEXT KEY obor (obor),
+ FULLTEXT KEY aobor (aobor)
+);
+INSERT INTO obory VALUES ('0101000000','aaa','AAA');
+INSERT INTO obory VALUES ('0102000000','bbb','BBB');
+INSERT INTO obory VALUES ('0103000000','ccc','CCC');
+INSERT INTO obory VALUES ('0104000000','xxx','XXX');
+
+select * from obory;
+drop table obory;
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index 6bac7bb8059..4d0930c50c6 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -547,3 +547,19 @@ delete from t1;
select * from t1;
commit;
drop table t1;
+
+#
+# Test of how ORDER BY works when doing it on the whole table
+#
+
+create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) type=innodb;
+insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
+explain select * from t1 order by a;
+explain select * from t1 order by b;
+explain select * from t1 order by c;
+explain select a from t1 order by a;
+explain select b from t1 order by b;
+explain select a,b from t1 order by b;
+explain select a,b from t1;
+explain select a,b,c from t1;
+drop table t1;
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 774f35ae38e..af5f377afb5 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -404,3 +404,15 @@ insert into t2 values (1,1),(1,2);
insert into t1 values (1,1),(2,1);
SELECT * FROM t1 LEFT JOIN t2 ON (t1.bug_id = t2.bug_id AND t2.who = 2) WHERE (t1.reporter = 2 OR t2.who = 2);
drop table t1,t2;
+
+#
+# Test problem with LEFT JOIN
+
+create table t1 (fooID smallint unsigned auto_increment, primary key (fooID));
+create table t2 (fooID smallint unsigned not null, barID smallint unsigned not null, primary key (fooID,barID));
+insert into t1 (fooID) values (10),(20),(30);
+insert into t2 values (10,1),(20,2),(30,3);
+explain select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
+select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30;
+select * from t2 left join t1 ignore index(primary) on t1.fooID = t2.fooID and t1.fooID = 30;
+drop table t1,t2;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 93462534b43..861bc807323 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -50,3 +50,19 @@ show index from t1;
optimize table t1;
show index from t1;
drop table t1;
+
+#
+# Test of how ORDER BY works when doing it on the whole table
+#
+
+create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) type=myisam;
+insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
+explain select * from t1 order by a;
+explain select * from t1 order by b;
+explain select * from t1 order by c;
+explain select a from t1 order by a;
+explain select b from t1 order by b;
+explain select a,b from t1 order by b;
+explain select a,b from t1;
+explain select a,b,c from t1;
+drop table t1;