Debian Codegraph @

mysql-test/suite/ndb/t/ndb_column_properties.test

raw
1 -- source include/have_ndb.inc
2
3 CREATE LOGFILE GROUP lg1
4 ADD UNDOFILE 'undofile.dat'
5 INITIAL_SIZE 1M
6 UNDO_BUFFER_SIZE = 1M
7 ENGINE=NDB;
8
9 CREATE TABLESPACE ts1
10 ADD DATAFILE 'datafile.dat'
11 USE LOGFILE GROUP lg1
12 INITIAL_SIZE 8M
13 EXTENT_SIZE 256k
14 ENGINE NDB;
15
16 create table t1 (a int column_format DYNAMIC STORAGE DISK) TABLESPACE ts1 engine NDB CHARACTER SET latin1;
17 #select column_name, storage, format from information_schema.columns
18 #where table_name = "t1";
19 --disable_warnings
20 show create table t1;
21 --enable_warnings
22 source show_attributes.inc;
23 drop table t1;
24
25 create table t1 (a int column_format DYNAMIC,
26 a1 int column_format FIXED,
27 b int NOT NULL column_format DYNAMIC,
28 b1 int NOT NULL column_format FIXED storage DISK,
29 c VARCHAR(100) column_format FIXED,
30 c1 VARCHAR(100) column_format DYNAMIC storage memory,
31 d VARCHAR(100) NOT NULL column_format FIXED,
32 d1 VARCHAR(100) NOT NULL column_format DYNAMIC,
33 e CHAR(100) column_format FIXED,
34 e1 CHAR(100) column_format DYNAMIC,
35 f CHAR(100) NOT NULL column_format FIXED,
36 f1 char(100) NOT NULL column_format DYNAMIC storage DISK,
37 index (b)) TABLESPACE ts1 engine NDB CHARACTER SET latin1;
38 insert into t1 (b, b1, d,d1,f,f1) values
39 (1,1,"1","1","1","1"),
40 (2,2,"2","2","2","2"),
41 (3,3,"3","3","3","3");
42 alter table t1 change column a a int column_format FIXED;
43 --disable_warnings
44 show create table t1;
45 --enable_warnings
46 #select column_name, storage, format from information_schema.columns
47 #where table_name = "t1";
48 alter table t1 change column a a int storage disk;
49 --disable_warnings
50 show create table t1;
51 --enable_warnings
52 source show_attributes.inc;
53 alter table t1 change column a a int storage memory;
54 --disable_warnings
55 show create table t1;
56 --enable_warnings
57 source show_attributes.inc;
58 --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
59 alter table t1 algorithm=inplace, change column a1 a1 int column_format FIXED NOT NULL;
60 alter table t1 algorithm=inplace, change column b b int NOT NULL storage memory, add index b_i(b);
61 --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
62 alter table t1 algorithm=inplace, change column b b int NOT NULL storage memory, add index b1_i(b1);
63 alter table t1 change column b b int NOT NULL storage memory;
64 alter table t1 add column a2 int column_format FIXED;
65 --disable_warnings
66 show create table t1;
67 --enable_warnings
68 source show_attributes.inc;
69 alter table t1 add column c2 VARCHAR(100) column_format DYNAMIC;
70 --disable_warnings
71 show create table t1;
72 --enable_warnings
73 source show_attributes.inc;
74 alter table t1 add column c3 VARCHAR(100) column_format FIXED;
75 --disable_warnings
76 show create table t1;
77 --enable_warnings
78 source show_attributes.inc;
79 drop table t1;
80
81 create table t1 (a int storage disk column_format FIXED) TABLESPACE ts1 engine NDB CHARACTER SET latin1;
82 alter table t1 change column a a int storage memory column_format DYNAMIC;
83 --disable_warnings
84 show create table t1;
85 --enable_warnings
86 source show_attributes.inc;
87 drop table t1;
88
89 # Checking keywords
90 create table t1 (column_format int storage disk column_format FIXED, storage int storage disk column_format FIXED) TABLESPACE ts1 engine NDB CHARACTER SET latin1;
91 --disable_warnings
92 show create table t1;
93 --enable_warnings
94 source show_attributes.inc;
95 drop table t1;
96
97 ALTER TABLESPACE ts1
98 DROP DATAFILE 'datafile.dat';
99
100 drop tablespace ts1;
101
102 drop logfile group lg1
103 engine ndb;
104
105 CREATE TABLE t1 (
106 pk1 INT NOT NULL auto_increment,
107 c00 int not null column_format dynamic,
108 c01 int not null column_format dynamic,
109 c02 int not null column_format dynamic,
110 c03 int not null column_format dynamic,
111 c04 int not null column_format dynamic,
112 c05 int not null column_format dynamic,
113 c06 int not null column_format dynamic,
114 c07 int not null column_format dynamic,
115 c08 int not null column_format dynamic,
116 c09 int not null column_format dynamic,
117 c10 int not null column_format dynamic,
118 c11 int not null column_format dynamic,
119 c12 int not null column_format dynamic,
120 c13 int not null column_format dynamic,
121 c14 int not null column_format dynamic,
122 c15 int not null column_format dynamic,
123 c16 int not null column_format dynamic,
124 c17 int not null column_format dynamic,
125 c18 int not null column_format dynamic,
126 c19 int not null column_format dynamic,
127 primary key(pk1)
128 ) ENGINE=ndbcluster;
129
130 insert into t1 values(null,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
131 insert into t1 values(null,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
132 insert into t1 values(null,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
133 insert into t1 values(null,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
134 insert into t1 values(null,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
135 insert into t1 values(null,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
136 insert into t1 values(null,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
137 insert into t1 values(null,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
138 insert into t1 values(null,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
139 insert into t1 values(null,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
140 select * from t1 order by 1;
141 delete from t1;
142
143 drop table t1;