Skip to content

Commit e08dee4

Browse files
committed
wl#11571 : Deprecate Shared tablespaces in partitioned table
- Added a deprecation warning to be thrown when a (sub)partition of a partitioned table is created in a shared tablespace. - Added an internal error handler to make sure this warning is thrown only once if there are more then one (sub)partitions are being created in shared tablespaces. RB : 19932 Reviewed by : Allen Lai <[email protected]> Kevin Lewis <[email protected]> Dyre Tjeldvoll <[email protected]>
1 parent eaf6b46 commit e08dee4

19 files changed

+449
-1
lines changed

mysql-test/r/mdl_tablespace.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,8 @@ ENGINE=InnoDB
865865
PARTITION BY RANGE (a)
866866
PARTITIONS 1
867867
(PARTITION P1 VALUES LESS THAN (2) TABLESPACE ts1);
868+
Warnings:
869+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
868870
#############################################
869871
# Case1: Checking TRUNCATE TABLE
870872
# Sending 'TRUNCATE TABLE t1;'
@@ -900,6 +902,8 @@ CREATE TABLE t3 ( a INT NOT NULL, PRIMARY KEY (a)) ENGINE=InnoDB PARTITION BY RA
900902
SET DEBUG_SYNC= 'now WAIT_FOR got_lock';
901903
SET DEBUG_SYNC= 'now SIGNAL cont';
902904
# Reaping 'CREATE TABLE'
905+
Warnings:
906+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
903907
#############################################
904908
# Case5: Checking CREATE TABLE LIKE
905909
SET DEBUG_SYNC= 'RESET';
@@ -911,6 +915,8 @@ CREATE TABLE t4 LIKE t3;;
911915
SET DEBUG_SYNC= 'now WAIT_FOR got_lock';
912916
SET DEBUG_SYNC= 'now SIGNAL cont';
913917
# Reaping 'CREATE TABLE LIKE'
918+
Warnings:
919+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
914920
#############################################
915921
# Case6: Checking ALTER TABLE ... PARTITION
916922
CREATE TABLESPACE ts2 ADD DATAFILE 'ts2.ibd';
@@ -923,6 +929,8 @@ ALTER TABLE t2 ADD PARTITION (partition p2 values less than (4) tablespace ts2);
923929
SET DEBUG_SYNC= 'now WAIT_FOR got_lock';
924930
SET DEBUG_SYNC= 'now SIGNAL cont';
925931
# Reaping 'ALTER TABLE'
932+
Warnings:
933+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
926934
#############################################
927935
# Case7: Checking LOCK TABLE t2 WRITE
928936
SET DEBUG_SYNC= 'RESET';

mysql-test/r/partition.result

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,11 @@ partitions 3
916916
(partition x1 tablespace ts1,
917917
partition x2 tablespace ts2,
918918
partition x3 tablespace ts3);
919+
Warnings:
920+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
919921
CREATE TABLE t2 LIKE t1;
922+
Warnings:
923+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
920924
SHOW CREATE TABLE t1;
921925
Table Create Table
922926
t1 CREATE TABLE `t1` (
@@ -953,6 +957,8 @@ partitions 3
953957
(partition x1 values in (1,2,9,4) tablespace ts1,
954958
partition x2 values in (3, 11, 5, 7) tablespace ts2,
955959
partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
960+
Warnings:
961+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
956962
SHOW CREATE TABLE t1;
957963
Table Create Table
958964
t1 CREATE TABLE `t1` (
@@ -976,6 +982,8 @@ partitions 3
976982
(partition x1 values in (1,2,9,4) tablespace ts1,
977983
partition x2 values in (3, 11, 5, 7) tablespace ts2,
978984
partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
985+
Warnings:
986+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
979987
SHOW CREATE TABLE t1;
980988
Table Create Table
981989
t1 CREATE TABLE `t1` (
@@ -998,6 +1006,8 @@ partition by list (b*a)
9981006
(partition x1 values in (1) tablespace ts1,
9991007
partition x2 values in (3, 11, 5, 7) tablespace ts2,
10001008
partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
1009+
Warnings:
1010+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
10011011
SHOW CREATE TABLE t1;
10021012
Table Create Table
10031013
t1 CREATE TABLE `t1` (

mysql-test/r/partition_hash.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ partitions 3
207207
(partition x1 tablespace ts1,
208208
partition x2 tablespace ts2,
209209
partition x3 tablespace ts3);
210+
Warnings:
211+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
210212
insert into t1 values (1,1,1);
211213
SHOW CREATE TABLE t1;
212214
Table Create Table
@@ -255,6 +257,8 @@ partitions 3
255257
(partition x1 tablespace ts1,
256258
partition x2 tablespace ts2,
257259
partition x3 tablespace ts3);
260+
Warnings:
261+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
258262
select * from t1;
259263
a b c
260264
SHOW CREATE TABLE t1;

mysql-test/r/partition_innodb.result

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,8 @@ PRIMARY KEY (`f1`,`f4`)
10611061
PARTITION BY LIST (`f4`)
10621062
(PARTITION p0 VALUES IN (0) ENGINE = InnoDB,
10631063
PARTITION p1 VALUES IN (1) DATA DIRECTORY = 'MYSQL_TMP_DIR/temp_tblspc' ENGINE = InnoDB);
1064+
Warnings:
1065+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
10641066
SHOW CREATE TABLE t1;
10651067
Table Create Table
10661068
t1 CREATE TABLE `t1` (
@@ -1133,6 +1135,8 @@ PRIMARY KEY (`f1`,`f4`)
11331135
PARTITION BY LIST (`f4`)
11341136
(PARTITION p0 VALUES IN (0) TABLESPACE ts1 ENGINE = InnoDB,
11351137
PARTITION p1 VALUES IN (1) TABLESPACE ts2 ENGINE = InnoDB);
1138+
Warnings:
1139+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
11361140
SHOW CREATE TABLE t1;
11371141
Table Create Table
11381142
t1 CREATE TABLE `t1` (
@@ -1171,6 +1175,8 @@ PARTITION BY LIST (`f4`)
11711175
PARTITION p1 VALUES IN (1) TABLESPACE innodb_file_per_table DATA DIRECTORY='MYSQL_TMP_DIR/temp_dir' ENGINE = InnoDB,
11721176
PARTITION p2 VALUES IN (2) TABLESPACE innodb_file_per_table ENGINE = InnoDB,
11731177
PARTITION p3 VALUES IN (3) TABLESPACE innodb_system ENGINE = InnoDB);
1178+
Warnings:
1179+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
11741180
SHOW CREATE TABLE t1;
11751181
Table Create Table
11761182
t1 CREATE TABLE `t1` (

mysql-test/r/partition_innodb_tablespace.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ PARTITION p3 VALUES LESS THAN (300) TABLESPACE innodb_file_per_table
391391
(SUBPARTITION sp9 TABLESPACE ts_part4,
392392
SUBPARTITION sp10,
393393
SUBPARTITION sp11));
394+
Warnings:
395+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
394396
SHOW CREATE TABLE t2;
395397
Table Create Table
396398
t2 CREATE TABLE `t2` (
@@ -444,6 +446,8 @@ PARTITION p3 VALUES LESS THAN (300) TABLESPACE innodb_file_per_table
444446
(SUBPARTITION sp9 TABLESPACE ts_part4,
445447
SUBPARTITION sp10,
446448
SUBPARTITION sp11));
449+
Warnings:
450+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
447451
SHOW CREATE TABLE t3;
448452
Table Create Table
449453
t3 CREATE TABLE `t3` (

mysql-test/r/partition_list.result

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@ c int not null,
426426
primary key(a,b))
427427
partition by list (a)
428428
(partition x1 values in (1,2,9,4) tablespace ts1);
429+
Warnings:
430+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
429431
SHOW CREATE TABLE t1;
430432
Table Create Table
431433
t1 CREATE TABLE `t1` (

mysql-test/r/partition_range.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ partitions 3
346346
(partition x1 values less than (5) tablespace ts1,
347347
partition x2 values less than (10) tablespace ts2,
348348
partition x3 values less than maxvalue tablespace ts3);
349+
Warnings:
350+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
349351
INSERT into t1 values (1, 1, 1);
350352
INSERT into t1 values (6, 1, 1);
351353
INSERT into t1 values (10, 1, 1);
@@ -374,6 +376,8 @@ partitions 3
374376
(partition x1 values less than (5) tablespace ts1,
375377
partition x2 values less than (10) tablespace ts2,
376378
partition x3 values less than maxvalue tablespace ts3);
379+
Warnings:
380+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
377381
select * from t1;
378382
a b c
379383
1 1 1
@@ -402,6 +406,8 @@ partitions 3
402406
(partition x1 values less than (5) tablespace ts1,
403407
partition x2 values less than (10) tablespace ts2,
404408
partition x3 values less than maxvalue tablespace ts3);
409+
Warnings:
410+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
405411
INSERT into t1 values (1, 1, 1);
406412
INSERT into t1 values (6, 1, 1);
407413
INSERT into t1 values (10, 1, 1);
@@ -429,6 +435,8 @@ partitions 3
429435
(partition x1 values less than (5) tablespace ts1,
430436
partition x2 values less than (10) tablespace ts2,
431437
partition x3 values less than maxvalue tablespace ts3);
438+
Warnings:
439+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
432440
select * from t1;
433441
a b c
434442
1 1 1
@@ -457,6 +465,8 @@ partitions 3
457465
(partition x1 values less than (5) tablespace ts1,
458466
partition x2 values less than (10) tablespace ts2,
459467
partition x3 values less than (15) tablespace ts3);
468+
Warnings:
469+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
460470
INSERT into t1 values (1, 1, 1);
461471
INSERT into t1 values (6, 1, 1);
462472
INSERT into t1 values (10, 1, 1);
@@ -485,6 +495,8 @@ partitions 3
485495
(partition x1 values less than (5) tablespace ts1,
486496
partition x2 values less than (10) tablespace ts2,
487497
partition x3 values less than (15) tablespace ts3);
498+
Warnings:
499+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
488500
select * from t1;
489501
a b c
490502
1 1 1
@@ -597,6 +609,8 @@ partition x2 values less than (5)
597609
( subpartition x21 tablespace ts1 nodegroup 0,
598610
subpartition x22 tablespace ts2 nodegroup 1)
599611
);
612+
Warnings:
613+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
600614
SELECT * from t1;
601615
a b c
602616
SHOW CREATE TABLE t1;

mysql-test/suite/innodb/r/create_tablespace_partition.result

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ SUBPARTITION subpart24),
2222
PARTITION thousands VALUES LESS THAN (10000)
2323
(SUBPARTITION subpart31,
2424
SUBPARTITION subpart32));
25+
Warnings:
26+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
2527
SET GLOBAL innodb_file_per_table = ON;
2628
CREATE TABLE t2 (a INT, b INT)
2729
ENGINE = InnoDB
@@ -35,11 +37,15 @@ SUBPARTITION subpart22 TABLESPACE=`s``1`),
3537
PARTITION thousands VALUES LESS THAN (10000)
3638
(SUBPARTITION subpart31 DATA DIRECTORY 'MYSQL_TMP_DIR',
3739
SUBPARTITION subpart32 DATA DIRECTORY 'MYSQL_TMP_DIR' TABLESPACE `innodb_file_per_table`));
40+
Warnings:
41+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
3842
ALTER TABLE t1 ALGORITHM=COPY, ADD PARTITION
3943
(PARTITION tenthousands VALUES LESS THAN (20000));
4044
ERROR 0A000: ALGORITHM=COPY/INPLACE is not supported. Reason: Partition specific operations do not yet support LOCK/ALGORITHM. Try ALGORITHM=DEFAULT.
4145
ALTER TABLE t1 ALGORITHM=DEFAULT, ADD PARTITION
4246
(PARTITION tenthousands VALUES LESS THAN (20000));
47+
Warnings:
48+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
4349
# Only allow tablespace name as ident, not text. I.e. no 'single' quotes.
4450
ALTER TABLE t1 ALGORITHM=COPY, ADD PARTITION
4551
(PARTITION twentythousands VALUES LESS THAN (30000)
@@ -60,6 +66,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
6066
ALTER TABLE t1 ALGORITHM=DEFAULT, ADD PARTITION
6167
(PARTITION twentythousands VALUES LESS THAN (30000)
6268
TABLESPACE = "innodb_system");
69+
Warnings:
70+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
6371
ALTER TABLE t1 ALGORITHM=DEFAULT, ADD PARTITION
6472
(PARTITION thirtythousands VALUES LESS THAN (40000)
6573
TABLESPACE = `innodb_file_per_table`);
@@ -99,9 +107,13 @@ SUBPARTITION p40k_2 TABLESPACE = innodb_file_per_table DATA DIRECTORY = 'MYSQL_T
99107
SET GLOBAL innodb_file_per_table = OFF;
100108
ALTER TABLE t1 ALGORITHM=DEFAULT, ADD PARTITION
101109
(PARTITION fiftythousands VALUES LESS THAN (60000));
110+
Warnings:
111+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
102112
ALTER TABLE t1 ALGORITHM=DEFAULT, ADD PARTITION
103113
(PARTITION sixtythousands VALUES LESS THAN (70000)
104114
TABLESPACE = `innodb_system`);
115+
Warnings:
116+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
105117
ALTER TABLE t1 ALGORITHM=DEFAULT, ADD PARTITION
106118
(PARTITION seventythousands VALUES LESS THAN (80000)
107119
TABLESPACE = `innodb_file_per_table`);
@@ -121,6 +133,8 @@ ALTER TABLE t1 ALGORITHM=DEFAULT, ADD PARTITION
121133
(PARTITION ninetythousands VALUES LESS THAN (100000)
122134
(SUBPARTITION p90k_1 TABLESPACE = `innodb_file_per_table`,
123135
SUBPARTITION p90k_2 TABLESPACE = `innodb_system`));
136+
Warnings:
137+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
124138
FLUSH TABLES;
125139
=== information_schema.innodb_sys_tables and innodb_sys_tablespaces ===
126140
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
@@ -388,6 +402,8 @@ SUBPARTITION seventythousandssp1 ENGINE = InnoDB),
388402
PARTITION ninetythousands VALUES LESS THAN (100000)
389403
(SUBPARTITION p90k_1 ENGINE = InnoDB,
390404
SUBPARTITION p90k_2 TABLESPACE = innodb_system ENGINE = InnoDB)) */;
405+
Warnings:
406+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
391407
CREATE TABLE `t2` (
392408
`a` int(11) DEFAULT NULL,
393409
`b` int(11) DEFAULT NULL
@@ -403,6 +419,8 @@ SUBPARTITION subpart22 TABLESPACE = `s``1` ENGINE = InnoDB),
403419
PARTITION thousands VALUES LESS THAN (10000)
404420
(SUBPARTITION subpart31 ENGINE = InnoDB,
405421
SUBPARTITION subpart32 ENGINE = InnoDB)) */;
422+
Warnings:
423+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
406424
=== information_schema.innodb_sys_tables and innodb_sys_tablespaces ===
407425
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
408426
test/t1#p#fiftythousands#sp#fiftythousandssp0 s1 161 5 Dynamic 0 General
@@ -531,6 +549,8 @@ CREATE TABLE ti
531549
ENGINE=INNODB
532550
PARTITION BY HASH( MONTH(tr_date) )
533551
PARTITIONS 6;
552+
Warnings:
553+
Warning 1681 'InnoDB : A table partition in a shared tablespace' is deprecated and will be removed in a future release.
534554
DROP TABLE t1,ti;
535555
DROP TABLESPACE ts1;
536556
#

0 commit comments

Comments
 (0)