Description:
Hi,
If I have 2 table spaces (ts1 and ts2) I should not be allowed to drop files created
under ts2 by using ts1 in the alter command.
mysql> CREATE TABLESPACE ts1 ADD DATAFILE 'datafile.dat' USE LOGFILE GROUP lg1
INITIAL_SIZE 12M ENGINE NDB;
Query OK, 0 rows affected (1.08 sec)
mysql> CREATE TABLESPACE ts2 ADD DATAFILE 'datafile2.dat' USE LOGFILE GROUP lg1
INITIAL_SIZE 12M ENGINE NDB;
Query OK, 0 rows affected (1.11 sec)
id type state logging database schema name
3 UserTable Online Yes cluster def NDB$BLOB_2_3
1 SystemTable Online Yes sys def NDB$EVENTS_0
5 LogfileGroup Online - lg1
10 Datafile Online - datafile2.dat
6 Undofile Online - undofile.dat
2 UserTable Online Yes cluster def schema
4 UserTable Online Yes cluster def apply_status
8 Datafile Online - datafile.dat
7 Tablespace Online - ts1
9 Tablespace Online - ts2
0 SystemTable Online Yes sys def SYSTAB_0
mysql> ALTER TABLESPACE ts1 DROP DATAFILE 'datafile2.dat' ENGINE = NDB; Query OK, 0 rows
affected (0.41 sec)
id type state logging database schema name
3 UserTable Online Yes cluster def NDB$BLOB_2_3
1 SystemTable Online Yes sys def NDB$EVENTS_0
5 LogfileGroup Online - lg1
6 Undofile Online - undofile.dat
2 UserTable Online Yes cluster def schema
4 UserTable Online Yes cluster def apply_status
8 Datafile Online - datafile.dat
7 Tablespace Online - ts1
9 Tablespace Online - ts2
0 SystemTable Online Yes sys def SYSTAB_0
Notice that datafile2.dat is now gone.
How to repeat:
see above
Suggested fix:
Give me an error when I try to drop ts2's files using ts1 in the alter command