summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-11-21 15:39:01 +0200
committermonty@hundin.mysql.fi <>2001-11-21 15:39:01 +0200
commitc6b3afe2d743fd75a96debea3adc591f1ef47faa (patch)
tree264958e2dfc0a050b24d3c8d4211720608f2435e /mysql-test
parent3e231a82062fdb5c06fe1f754dee3a9de6cc2d97 (diff)
parent27d2057c5593daff1eee019446e6a1516c5a5d8d (diff)
downloadmariadb-git-c6b3afe2d743fd75a96debea3adc591f1ef47faa.tar.gz
Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/create.result9
-rw-r--r--mysql-test/r/myisam.result17
-rw-r--r--mysql-test/t/create.test10
-rw-r--r--mysql-test/t/myisam.test12
4 files changed, 48 insertions, 0 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 5f14de18735..1bb3249bdc5 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -68,3 +68,12 @@ select * from t2 where b="world";
a B
3 world
drop table t1,t2;
+create table t1(x varchar(50) );
+create table t2 select x from t1 where 1=2;
+describe t1;
+Field Type Null Key Default Extra
+x varchar(50) YES NULL
+describe t2;
+Field Type Null Key Default Extra
+x char(50) YES NULL
+drop table t1,t2;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index dae87d88765..448c1b37592 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -31,3 +31,20 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
+create table t1 (a int not null auto_increment, b int not null, primary key (a), index(b));
+insert into t1 (b) values (1),(2),(2),(2),(2);
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+show index from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
+t1 0 PRIMARY 1 a A 5 NULL NULL
+t1 1 b 1 b A 1 NULL NULL
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status Table is already up to date
+show index from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
+t1 0 PRIMARY 1 a A 5 NULL NULL
+t1 1 b 1 b A 1 NULL NULL
+drop table t1;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 3eb4f35bdc2..57edb684744 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -65,3 +65,13 @@ create table t2 (key (b)) select * from t1;
explain select * from t2 where b="world";
select * from t2 where b="world";
drop table t1,t2;
+
+#
+# Test types after CREATE ... SELECT
+#
+
+create table t1(x varchar(50) );
+create table t2 select x from t1 where 1=2;
+describe t1;
+describe t2;
+drop table t1,t2;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 48a8b5d6c65..93462534b43 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -38,3 +38,15 @@ check table t1;
repair table t1;
check table t1;
drop table t1;
+
+#
+# Test bug: Two optimize in a row reset index cardinality
+#
+
+create table t1 (a int not null auto_increment, b int not null, primary key (a), index(b));
+insert into t1 (b) values (1),(2),(2),(2),(2);
+optimize table t1;
+show index from t1;
+optimize table t1;
+show index from t1;
+drop table t1;