summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-01-09 22:43:23 +0200
committermonty@mashka.mysql.fi <>2003-01-09 22:43:23 +0200
commitc9dc5a206bd162b10a3a1a2bebc054cf3c5a6ed0 (patch)
tree5ffbc6660efade54ba4bc490d83c1538515feb3e /mysql-test/t
parentaf76ac08fd64f57bb1939db1cc6b39b18eae969f (diff)
parentbf683af4cea9a9efc3e524d5aabde4886e93540f (diff)
downloadmariadb-git-c9dc5a206bd162b10a3a1a2bebc054cf3c5a6ed0.tar.gz
Merge work:/home/bk/mysql-4.1 into mashka.mysql.fi:/home/my/mysql-4.1
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/myisam.test27
1 files changed, 26 insertions, 1 deletions
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 780a060e204..ed08b1cbacb 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -2,10 +2,15 @@
# Test bugs in the MyISAM code
#
+# Initialise
--disable_warnings
-drop table if exists t1;
+drop table if exists t1,t2;
--enable_warnings
+#
+# Test problem with CHECK TABLE;
+#
+
CREATE TABLE t1 (
STRING_DATA char(255) default NULL,
KEY string_data (STRING_DATA)
@@ -327,3 +332,23 @@ CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255));
ALTER TABLE t1 ADD INDEX t1 (a, b, c);
DROP TABLE t1;
+#
+# Test of cardinality of keys with NULL
+#
+
+CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a));
+INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
+create table t2 (a int not null, b int, c int, key(b), key(c), key(a));
+INSERT into t2 values (1,1,1), (2,2,2);
+optimize table t1;
+show index from t1;
+explain select * from t1,t2 where t1.a=t2.a;
+explain select * from t1,t2 force index(a) where t1.a=t2.a;
+explain select * from t1 force index(a),t2 force index(a) where t1.a=t2.a;
+explain select * from t1,t2 where t1.b=t2.b;
+explain select * from t1,t2 force index(c) where t1.a=t2.a;
+explain select * from t1 where a=0 or a=2;
+explain select * from t1 force index (a) where a=0 or a=2;
+explain select * from t1 where c=1;
+explain select * from t1 use index() where c=1;
+drop table t1,t2;