| 1 |
CREATE LOGFILE GROUP lg1 |
| 2 |
ADD UNDOFILE 'lg1_undofile.dat' |
| 3 |
INITIAL_SIZE 1M |
| 4 |
UNDO_BUFFER_SIZE = 1M |
| 5 |
ENGINE=NDB; |
| 6 |
CREATE TABLESPACE ts1 |
| 7 |
ADD DATAFILE 'ts1_datafile.dat' |
| 8 |
USE LOGFILE GROUP lg1 |
| 9 |
INITIAL_SIZE 8M |
| 10 |
EXTENT_SIZE 256k |
| 11 |
ENGINE NDB; |
| 12 |
# |
| 13 |
# Check that tablespace are still used by table after altering |
| 14 |
# a table so that no columns are on disk |
| 15 |
# |
| 16 |
# Create table with tablespace and one column stored on disk |
| 17 |
CREATE TABLE t1( |
| 18 |
a INT STORAGE DISK |
| 19 |
) |
| 20 |
TABLESPACE ts1 |
| 21 |
ENGINE NDB; |
| 22 |
# Change the storage of the column from disk to memory |
| 23 |
ALTER TABLE t1 CHANGE COLUMN a a INT STORAGE MEMORY; |
| 24 |
DROP TABLE t1; |
| 25 |
# Check that it's not possible to create table with storage disk |
| 26 |
# without tablespace(i.e tablespace is required) |
| 27 |
CREATE TABLE t1( |
| 28 |
a INT STORAGE DISK |
| 29 |
) |
| 30 |
STORAGE DISK |
| 31 |
ENGINE NDB; |
| 32 |
ERROR HY000: Can't create table 't1' (use SHOW WARNINGS for more info). |
| 33 |
SHOW WARNINGS; |
| 34 |
Level Code Message |
| 35 |
Warning 3014 TABLESPACE option must be specified when using STORAGE DISK |
| 36 |
Error 1005 Can't create table 't1' (use SHOW WARNINGS for more info). |
| 37 |
ALTER TABLESPACE ts1 |
| 38 |
DROP DATAFILE 'ts1_datafile.dat'; |
| 39 |
DROP TABLESPACE ts1; |
| 40 |
DROP LOGFILE GROUP lg1 |
| 41 |
ENGINE=NDB; |