| 1 |
--source connect.inc |
| 2 |
|
| 3 |
--echo # |
| 4 |
--echo # Bug#29871406 HANG IN ACQUIRE_LOCK WHEN ALTERING TABLESPACE |
| 5 |
--echo # Create table in tablespace with RANGE partition caused MDL lock |
| 6 |
--echo # on the tablespace to be left behind on the participant, thus |
| 7 |
--echo # preventing further use of the tablespace |
| 8 |
--echo # |
| 9 |
CREATE LOGFILE GROUP lg1 |
| 10 |
ADD UNDOFILE 'lg1_undofile.dat' |
| 11 |
INITIAL_SIZE 16M |
| 12 |
UNDO_BUFFER_SIZE = 1M ENGINE=NDB; |
| 13 |
|
| 14 |
CREATE TABLESPACE ts1 |
| 15 |
ADD DATAFILE 'ts1_datafile1.dat' |
| 16 |
USE LOGFILE GROUP lg1 |
| 17 |
INITIAL_SIZE 64M |
| 18 |
ENGINE NDB; |
| 19 |
|
| 20 |
set new=on; # Enable RANGE PARTITION |
| 21 |
CREATE TABLE t1 ( |
| 22 |
a INT NOT NULL, |
| 23 |
PRIMARY KEY (a) |
| 24 |
) ENGINE=NDB |
| 25 |
PARTITION BY RANGE (a) |
| 26 |
PARTITIONS 1 |
| 27 |
(PARTITION P1 VALUES LESS THAN (2) TABLESPACE ts1); |
| 28 |
|
| 29 |
--echo # Workaround BUG#30248840 which describes problem with updating |
| 30 |
--echo # tablespace id on participant when altering tablespace where table |
| 31 |
--echo # has RANGE partitions |
| 32 |
DROP TABLE t1; |
| 33 |
CREATE TABLE t1 ( |
| 34 |
a INT NOT NULL, |
| 35 |
PRIMARY KEY (a) |
| 36 |
) ENGINE=NDB; |
| 37 |
--echo # End Workaround |
| 38 |
|
| 39 |
--connection mysqld2 |
| 40 |
--echo # mysqld2> Check that tablespace can be altered on participant |
| 41 |
|
| 42 |
ALTER TABLESPACE ts1 |
| 43 |
ADD DATAFILE 'ts1_datafile2.dat'; |
| 44 |
ALTER TABLESPACE ts1 |
| 45 |
DROP DATAFILE 'ts1_datafile2.dat'; |
| 46 |
|
| 47 |
--echo # Cleanup |
| 48 |
DROP TABLE t1; |
| 49 |
ALTER TABLESPACE ts1 |
| 50 |
DROP DATAFILE 'ts1_datafile1.dat'; |
| 51 |
DROP TABLESPACE ts1; |
| 52 |
DROP LOGFILE GROUP lg1 ENGINE = NDB; |