1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00
This commit is contained in:
unknown
2006-12-17 23:08:04 +03:00
parent 32d0850823
commit 185997ceaf
12 changed files with 477 additions and 15 deletions

View File

@@ -354,3 +354,48 @@ select * from t1 where a = 12;
a b c
12 403 NULL
drop table t1;
create table t1 (a int not null, b varchar(10)) engine=ndb;
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
alter table t1 add primary key (a);
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 a A 0 NULL NULL BTREE
alter table t1 drop primary key;
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
drop table t1;
create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) NOT NULL DEFAULT '0',
`c` varchar(254) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
alter table t1 alter b set default 1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) NOT NULL DEFAULT '1',
`c` varchar(254) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int not null, b int not null) engine=ndb;
insert into t1 values (1, 300), (2, 200), (3, 100);
select * from t1;
a b
3 100
2 200
1 300
alter table t1 order by b;
select * from t1;
a b
1 300
2 200
3 100
drop table t1;
End of 5.1 tests