144 lines
5.2 KiB
Plaintext
144 lines
5.2 KiB
Plaintext
-- source include/have_ndb.inc
|
|
|
|
CREATE LOGFILE GROUP lg1
|
|
ADD UNDOFILE 'undofile.dat'
|
|
INITIAL_SIZE 1M
|
|
UNDO_BUFFER_SIZE = 1M
|
|
ENGINE=NDB;
|
|
|
|
CREATE TABLESPACE ts1
|
|
ADD DATAFILE 'datafile.dat'
|
|
USE LOGFILE GROUP lg1
|
|
INITIAL_SIZE 8M
|
|
EXTENT_SIZE 256k
|
|
ENGINE NDB;
|
|
|
|
create table t1 (a int column_format DYNAMIC STORAGE DISK) TABLESPACE ts1 engine NDB CHARACTER SET latin1;
|
|
#select column_name, storage, format from information_schema.columns
|
|
#where table_name = "t1";
|
|
--disable_warnings
|
|
show create table t1;
|
|
--enable_warnings
|
|
source show_attributes.inc;
|
|
drop table t1;
|
|
|
|
create table t1 (a int column_format DYNAMIC,
|
|
a1 int column_format FIXED,
|
|
b int NOT NULL column_format DYNAMIC,
|
|
b1 int NOT NULL column_format FIXED storage DISK,
|
|
c VARCHAR(100) column_format FIXED,
|
|
c1 VARCHAR(100) column_format DYNAMIC storage memory,
|
|
d VARCHAR(100) NOT NULL column_format FIXED,
|
|
d1 VARCHAR(100) NOT NULL column_format DYNAMIC,
|
|
e CHAR(100) column_format FIXED,
|
|
e1 CHAR(100) column_format DYNAMIC,
|
|
f CHAR(100) NOT NULL column_format FIXED,
|
|
f1 char(100) NOT NULL column_format DYNAMIC storage DISK,
|
|
index (b)) TABLESPACE ts1 engine NDB CHARACTER SET latin1;
|
|
insert into t1 (b, b1, d,d1,f,f1) values
|
|
(1,1,"1","1","1","1"),
|
|
(2,2,"2","2","2","2"),
|
|
(3,3,"3","3","3","3");
|
|
alter table t1 change column a a int column_format FIXED;
|
|
--disable_warnings
|
|
show create table t1;
|
|
--enable_warnings
|
|
#select column_name, storage, format from information_schema.columns
|
|
#where table_name = "t1";
|
|
alter table t1 change column a a int storage disk;
|
|
--disable_warnings
|
|
show create table t1;
|
|
--enable_warnings
|
|
source show_attributes.inc;
|
|
alter table t1 change column a a int storage memory;
|
|
--disable_warnings
|
|
show create table t1;
|
|
--enable_warnings
|
|
source show_attributes.inc;
|
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
|
alter table t1 algorithm=inplace, change column a1 a1 int column_format FIXED NOT NULL;
|
|
alter table t1 algorithm=inplace, change column b b int NOT NULL storage memory, add index b_i(b);
|
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
|
|
alter table t1 algorithm=inplace, change column b b int NOT NULL storage memory, add index b1_i(b1);
|
|
alter table t1 change column b b int NOT NULL storage memory;
|
|
alter table t1 add column a2 int column_format FIXED;
|
|
--disable_warnings
|
|
show create table t1;
|
|
--enable_warnings
|
|
source show_attributes.inc;
|
|
alter table t1 add column c2 VARCHAR(100) column_format DYNAMIC;
|
|
--disable_warnings
|
|
show create table t1;
|
|
--enable_warnings
|
|
source show_attributes.inc;
|
|
alter table t1 add column c3 VARCHAR(100) column_format FIXED;
|
|
--disable_warnings
|
|
show create table t1;
|
|
--enable_warnings
|
|
source show_attributes.inc;
|
|
drop table t1;
|
|
|
|
create table t1 (a int storage disk column_format FIXED) TABLESPACE ts1 engine NDB CHARACTER SET latin1;
|
|
alter table t1 change column a a int storage memory column_format DYNAMIC;
|
|
--disable_warnings
|
|
show create table t1;
|
|
--enable_warnings
|
|
source show_attributes.inc;
|
|
drop table t1;
|
|
|
|
# Checking keywords
|
|
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;
|
|
--disable_warnings
|
|
show create table t1;
|
|
--enable_warnings
|
|
source show_attributes.inc;
|
|
drop table t1;
|
|
|
|
ALTER TABLESPACE ts1
|
|
DROP DATAFILE 'datafile.dat';
|
|
|
|
drop tablespace ts1;
|
|
|
|
drop logfile group lg1
|
|
engine ndb;
|
|
|
|
CREATE TABLE t1 (
|
|
pk1 INT NOT NULL auto_increment,
|
|
c00 int not null column_format dynamic,
|
|
c01 int not null column_format dynamic,
|
|
c02 int not null column_format dynamic,
|
|
c03 int not null column_format dynamic,
|
|
c04 int not null column_format dynamic,
|
|
c05 int not null column_format dynamic,
|
|
c06 int not null column_format dynamic,
|
|
c07 int not null column_format dynamic,
|
|
c08 int not null column_format dynamic,
|
|
c09 int not null column_format dynamic,
|
|
c10 int not null column_format dynamic,
|
|
c11 int not null column_format dynamic,
|
|
c12 int not null column_format dynamic,
|
|
c13 int not null column_format dynamic,
|
|
c14 int not null column_format dynamic,
|
|
c15 int not null column_format dynamic,
|
|
c16 int not null column_format dynamic,
|
|
c17 int not null column_format dynamic,
|
|
c18 int not null column_format dynamic,
|
|
c19 int not null column_format dynamic,
|
|
primary key(pk1)
|
|
) ENGINE=ndbcluster;
|
|
|
|
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);
|
|
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);
|
|
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);
|
|
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);
|
|
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);
|
|
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);
|
|
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);
|
|
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);
|
|
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);
|
|
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);
|
|
select * from t1 order by 1;
|
|
delete from t1;
|
|
|
|
drop table t1;
|