summaryrefslogtreecommitdiff
path: root/mysql-test/r/ndb_alter_table.result
blob: 4e7f4b2a72bf34d4cc2a1728cd58f217b0ae710a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a INT NOT NULL,
b INT NOT NULL
) ENGINE=ndbcluster;
INSERT INTO t1 VALUES (9410,9412);
ALTER TABLE t1 ADD COLUMN c int not null;
SELECT * FROM t1;
a	b	c
9410	9412	0
DROP TABLE t1;
create table t1 (
col1 int not null auto_increment primary key,
col2 varchar(30) not null,
col3 varchar (20) not null,
col4 varchar(4) not null,
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null, to_be_deleted int)  ENGINE=ndbcluster;
show table status;
Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
t1	ndbcluster	9	Dynamic	100	0	0	NULL	0	0	0	NULL	NULL	NULL	latin1_swedish_ci	NULL		
insert into t1 values
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
show table status;
Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
t1	ndbcluster	9	Dynamic	100	0	0	NULL	0	0	102	NULL	NULL	NULL	latin1_swedish_ci	NULL		
select * from t1 order by col1;
col1	col2	col3	col4	col5	col6	to_be_deleted
0	4	3	5	PENDING	1	7
1	4	3	5	PENDING	1	7
7	4	3	5	PENDING	1	7
8	4	3	5	PENDING	1	7
31	4	3	5	PENDING	1	7
32	4	3	5	PENDING	1	7
99	4	3	5	PENDING	1	7
100	4	3	5	PENDING	1	7
101	4	3	5	PENDING	1	7
alter table t1
add column col4_5 varchar(20) not null after col4,
add column col7 varchar(30) not null after col5,
add column col8 datetime not null, drop column to_be_deleted,
change column col2 fourth varchar(30) not null after col3,
modify column col6 int not null first;
show table status;
Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
t1	ndbcluster	9	Dynamic	100	0	0	NULL	0	0	102	NULL	NULL	NULL	latin1_swedish_ci	NULL		
select * from t1 order by col1;
col6	col1	col3	fourth	col4	col4_5	col5	col7	col8
1	0	3	4	5		PENDING		0000-00-00 00:00:00
1	1	3	4	5		PENDING		0000-00-00 00:00:00
1	7	3	4	5		PENDING		0000-00-00 00:00:00
1	8	3	4	5		PENDING		0000-00-00 00:00:00
1	31	3	4	5		PENDING		0000-00-00 00:00:00
1	32	3	4	5		PENDING		0000-00-00 00:00:00
1	99	3	4	5		PENDING		0000-00-00 00:00:00
1	100	3	4	5		PENDING		0000-00-00 00:00:00
1	101	3	4	5		PENDING		0000-00-00 00:00:00
insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
show table status;
Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
t1	ndbcluster	9	Dynamic	100	0	0	NULL	0	0	103	NULL	NULL	NULL	latin1_swedish_ci	NULL		
select * from t1 order by col1;
col6	col1	col3	fourth	col4	col4_5	col5	col7	col8
1	0	3	4	5		PENDING		0000-00-00 00:00:00
1	1	3	4	5		PENDING		0000-00-00 00:00:00
1	7	3	4	5		PENDING		0000-00-00 00:00:00
1	8	3	4	5		PENDING		0000-00-00 00:00:00
1	31	3	4	5		PENDING		0000-00-00 00:00:00
1	32	3	4	5		PENDING		0000-00-00 00:00:00
1	99	3	4	5		PENDING		0000-00-00 00:00:00
1	100	3	4	5		PENDING		0000-00-00 00:00:00
1	101	3	4	5		PENDING		0000-00-00 00:00:00
2	102	4	3	5	99	PENDING	EXTRA	2004-01-01 00:00:00
drop table t1;