Debian Codegraph @

mysql-test/suite/ndb_ddl/alter_inplace_tablespace.test

raw
1 --source include/have_ndb.inc
2
3 # Test that inplace alter table does not support adding or changing tablespace
4 # for a table
5 #
6
7 CREATE LOGFILE GROUP lg1
8 ADD UNDOFILE 'lg1_undofile.dat'
9 INITIAL_SIZE 1M
10 UNDO_BUFFER_SIZE = 1M
11 ENGINE NDB;
12
13 CREATE TABLESPACE ts1
14 ADD DATAFILE 'ts1_datafile.dat'
15 USE LOGFILE GROUP lg1
16 INITIAL_SIZE 16M
17 ENGINE NDB;
18
19 CREATE TABLESPACE ts2
20 ADD DATAFILE 'ts2_datafile.dat'
21 USE LOGFILE GROUP lg1
22 INITIAL_SIZE 16M
23 ENGINE NDB;
24
25 CREATE TABLE t1 (
26 a int PRIMARY KEY,
27 b int
28 ) ENGINE = NDB;
29
30 # Adding tablespace not supported by inplace alter
31 # i.e 'no tablespace' -> 't1'
32 --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
33 ALTER TABLE t1 ALGORITHM=inplace, TABLESPACE ts1;
34
35 # Add tablespace to t1 with copying alter
36 ALTER TABLE t1 TABLESPACE ts1;
37
38 # Changing tablespace not supported by inplace alter
39 # ie. 'ts1' -> 'ts2'
40 --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
41 ALTER TABLE t1 ALGORITHM=inplace, TABLESPACE=ts2;
42
43 # Neither changing to same name is supported by inplace alter
44 # ie. 'ts1' -> 'ts1'
45 --error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
46 ALTER TABLE t1 ALGORITHM=inplace, TABLESPACE=ts1;
47
48 # Changing tablespace to t2 with copying alter
49 ALTER TABLE t1 TABLESPACE ts2;
50
51 DROP TABLE t1;
52 ALTER TABLESPACE ts1
53 DROP DATAFILE 'ts1_datafile.dat';
54 DROP TABLESPACE ts1;
55 ALTER TABLESPACE ts2
56 DROP DATAFILE 'ts2_datafile.dat';
57 DROP TABLESPACE ts2;
58 DROP LOGFILE GROUP lg1
59 ENGINE NDB;