Debian Codegraph @

mysql-test/suite/ndbcluster/tablespace_storage.test

raw
1 --source include/have_ndb.inc
2
3 CREATE LOGFILE GROUP lg1
4 ADD UNDOFILE 'lg1_undofile.dat'
5 INITIAL_SIZE 1M
6 UNDO_BUFFER_SIZE = 1M
7 ENGINE=NDB;
8
9 CREATE TABLESPACE ts1
10 ADD DATAFILE 'ts1_datafile.dat'
11 USE LOGFILE GROUP lg1
12 INITIAL_SIZE 8M
13 EXTENT_SIZE 256k
14 ENGINE NDB;
15
16 --echo #
17 --echo # Check that tablespace are still used by table after altering
18 --echo # a table so that no columns are on disk
19 --echo #
20
21 --echo # Create table with tablespace and one column stored on disk
22 CREATE TABLE t1(
23 a INT STORAGE DISK
24 )
25 TABLESPACE ts1
26 ENGINE NDB;
27
28 --echo # Change the storage of the column from disk to memory
29 ALTER TABLE t1 CHANGE COLUMN a a INT STORAGE MEMORY;
30
31 DROP TABLE t1;
32
33 --echo # Check that it's not possible to create table with storage disk
34 --echo # without tablespace(i.e tablespace is required)
35 --error ER_CANT_CREATE_TABLE
36 CREATE TABLE t1(
37 a INT STORAGE DISK
38 )
39 STORAGE DISK
40 ENGINE NDB;
41 # Check that warning says "tablespace is required for storage disk"
42 SHOW WARNINGS;
43
44 # Remove datafile from tablespace
45 ALTER TABLESPACE ts1
46 DROP DATAFILE 'ts1_datafile.dat';
47
48 # Drop tablespace
49 DROP TABLESPACE ts1;
50
51 # Drop logfile group
52 DROP LOGFILE GROUP lg1
53 ENGINE=NDB;
54
55
56
57