mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0
This commit is contained in:
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user