Skip to content

Commit b88bcfb

Browse files
WL#10436: NewDD: Implicit tablespace name should be same as table name
Problem: ======== With current InnoDB tablespace implementation with newDD, the implicit (file-per-table) tablespace name is named as "innodb_file_per_table_x", where x is the tablespace ID. The disadvantage of this is that the tablespace name is hard for user to find out. This makes it a bit harder for user to specify tablespace name for import/export tablespace etc. Solution: ======== In case of file_per_table tablespace, rename tablespace name from innodb_file_per_table_<space_id> to tablespace name in mysql.tablespaces table. Reviewed-by: Jimmy Yang <jimmy.yang@oracle.com> Reviewed-by: Bin Su <bin.x.su@oracle.com> Reviewed-by: Dyre Tjeldvoll <dyre.tjeldvoll@oracle.com> RB: 16669
1 parent 6da6e63 commit b88bcfb

File tree

63 files changed

+1469
-1374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1469
-1374
lines changed

mysql-test/r/dd_schema_definition_debug_cs.result

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ id table_id name ordinal_position type is_nullable is_zerofill is_unsigned char_
100100
18 3 DB_TRX_ID 7 MYSQL_TYPE_INT24 0 0 0 6 0 NULL NULL 63 NULL NULL 0 1 NULL NULL
101101
19 3 DB_ROLL_PTR 8 MYSQL_TYPE_LONGLONG 0 0 0 7 0 NULL NULL 63 NULL NULL 0 1 NULL NULL
102102
20 4 id 1 MYSQL_TYPE_LONGLONG 0 0 1 20 20 0 NULL 83 NULL NULL 1 0 interval_count=0; NULL
103-
21 4 name 2 MYSQL_TYPE_VARCHAR 0 0 0 765 0 NULL NULL 83 NULL NULL 0 0 interval_count=0; NULL
103+
21 4 name 2 MYSQL_TYPE_VARCHAR 0 0 0 777 0 NULL NULL 83 NULL NULL 0 0 interval_count=0; NULL
104104
22 4 options 3 MYSQL_TYPE_MEDIUM_BLOB 1 0 0 8 0 NULL NULL 83 NULL NULL 0 0 interval_count=0; NULL
105105
23 4 se_private_data 4 MYSQL_TYPE_MEDIUM_BLOB 1 0 0 8 0 NULL NULL 83 NULL NULL 0 0 interval_count=0; NULL
106106
24 4 comment 5 MYSQL_TYPE_VARCHAR 0 0 0 6144 0 NULL NULL 83 NULL NULL 0 0 interval_count=0; NULL
@@ -447,7 +447,7 @@ index_id ordinal_position column_id length order hidden
447447
8 2 26 NULL ASC 1
448448
8 3 27 NULL ASC 1
449449
9 2 20 NULL ASC 1
450-
9 1 21 765 ASC 0
450+
9 1 21 777 ASC 0
451451
10 1 28 8 ASC 0
452452
10 2 29 4 ASC 0
453453
10 5 30 NULL ASC 1

mysql-test/r/partition_innodb_tablespace.result

+96-96
Large diffs are not rendered by default.
-35 Bytes
Binary file not shown.
-401 Bytes
Binary file not shown.
-12 Bytes
Binary file not shown.
-258 Bytes
Binary file not shown.

mysql-test/suite/funcs_1/r/is_columns_is.result

+3-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def information_schema EVENTS DATABASE_COLLATION 24 NULL NO varchar 64 192 NULL
8686
def information_schema FILES FILE_ID 1 NO bigint NULL NULL NULL NULL NULL NULL NULL bigint(4) select
8787
def information_schema FILES FILE_NAME 2 YES varchar 1333 4000 NULL NULL NULL utf8 utf8_general_ci varchar(4000) select
8888
def information_schema FILES FILE_TYPE 3 NO varchar 6 20 NULL NULL NULL utf8 utf8_general_ci varchar(20) select
89-
def information_schema FILES TABLESPACE_NAME 4 YES varchar 21 64 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
89+
def information_schema FILES TABLESPACE_NAME 4 YES varchar 86 259 NULL NULL NULL utf8 utf8_general_ci varchar(259) select
9090
def information_schema FILES TABLE_CATALOG 5 NO varchar 21 64 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
9191
def information_schema FILES TABLE_SCHEMA 6 YES varchar 21 64 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
9292
def information_schema FILES TABLE_NAME 7 YES varchar 21 64 NULL NULL NULL utf8 utf8_general_ci varchar(64) select
@@ -391,6 +391,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
391391
3.0000 varchar utf8 utf8_general_ci
392392
3.0008 varchar utf8 utf8_general_ci
393393
3.0029 varchar utf8 utf8_general_ci
394+
3.0116 varchar utf8 utf8_general_ci
394395
3.0118 varchar utf8 utf8_general_ci
395396
3.0476 varchar utf8 utf8_general_ci
396397
3.0769 varchar utf8 utf8_general_ci
@@ -511,7 +512,7 @@ NULL information_schema EVENTS ORIGINATOR int NULL NULL NULL NULL int(10) unsign
511512
NULL information_schema FILES FILE_ID bigint NULL NULL NULL NULL bigint(4)
512513
3.0008 information_schema FILES FILE_NAME varchar 1333 4000 utf8 utf8_general_ci varchar(4000)
513514
3.3333 information_schema FILES FILE_TYPE varchar 6 20 utf8 utf8_general_ci varchar(20)
514-
3.0476 information_schema FILES TABLESPACE_NAME varchar 21 64 utf8 utf8_general_ci varchar(64)
515+
3.0116 information_schema FILES TABLESPACE_NAME varchar 86 259 utf8 utf8_general_ci varchar(259)
515516
3.0476 information_schema FILES TABLE_CATALOG varchar 21 64 utf8 utf8_general_ci varchar(64)
516517
3.0476 information_schema FILES TABLE_SCHEMA varchar 21 64 utf8 utf8_general_ci varchar(64)
517518
3.0476 information_schema FILES TABLE_NAME varchar 21 64 utf8 utf8_general_ci varchar(64)

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

+27-27
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ CREATE TABLESPACE s1 ADD DATAFILE 's1.ibd' ENGINE InnoDB;
22
CREATE TABLE t1 (col1 INT, col2 INT) ENGINE = InnoDB TABLESPACE innodb_file_per_table PARTITION BY KEY(col1) PARTITIONS 3;
33
=== information_schema.innodb_tables and innodb_tablespaces ===
44
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
5-
test/t1#p#p0 innodb_file_per_table.## 33 5 Dynamic 0 Single
6-
test/t1#p#p1 innodb_file_per_table.## 33 5 Dynamic 0 Single
7-
test/t1#p#p2 innodb_file_per_table.## 33 5 Dynamic 0 Single
5+
test/t1#p#p0 test/t1#p#p0 33 5 Dynamic 0 Single
6+
test/t1#p#p1 test/t1#p#p1 33 5 Dynamic 0 Single
7+
test/t1#p#p2 test/t1#p#p2 33 5 Dynamic 0 Single
88
=== information_schema.innodb_tablespaces and innodb_datafiles ===
99
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
1010
s1 General DEFAULT 0 Any s1.ibd
11-
innodb_file_per_table.## Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p0.ibd
12-
innodb_file_per_table.## Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p1.ibd
13-
innodb_file_per_table.## Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p2.ibd
11+
test/t1#p#p0 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p0.ibd
12+
test/t1#p#p1 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p1.ibd
13+
test/t1#p#p2 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p2.ibd
1414
=== information_schema.files ===
1515
Space_Name File_Type Engine Status Tablespace_Name Path
1616
s1 TABLESPACE InnoDB NORMAL s1 MYSQLD_DATADIR/s1.ibd
17-
innodb_file_per_table.## TABLESPACE InnoDB NORMAL innodb_file_per_table.## MYSQLD_DATADIR/test/t1#p#p0.ibd
18-
innodb_file_per_table.## TABLESPACE InnoDB NORMAL innodb_file_per_table.## MYSQLD_DATADIR/test/t1#p#p1.ibd
19-
innodb_file_per_table.## TABLESPACE InnoDB NORMAL innodb_file_per_table.## MYSQLD_DATADIR/test/t1#p#p2.ibd
17+
test/t1#p#p0 TABLESPACE InnoDB NORMAL test/t1#p#p0 MYSQLD_DATADIR/test/t1#p#p0.ibd
18+
test/t1#p#p1 TABLESPACE InnoDB NORMAL test/t1#p#p1 MYSQLD_DATADIR/test/t1#p#p1.ibd
19+
test/t1#p#p2 TABLESPACE InnoDB NORMAL test/t1#p#p2 MYSQLD_DATADIR/test/t1#p#p2.ibd
2020
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE s1;
2121
SHOW CREATE TABLE t1;
2222
Table Create Table
@@ -28,21 +28,21 @@ t1 CREATE TABLE `t1` (
2828
PARTITIONS 3 */
2929
=== information_schema.innodb_tables and innodb_tablespaces ===
3030
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
31-
test/t1#p#p0 innodb_file_per_table.## 33 5 Dynamic 0 Single
32-
test/t1#p#p1 innodb_file_per_table.## 33 5 Dynamic 0 Single
33-
test/t1#p#p2 innodb_file_per_table.## 33 5 Dynamic 0 Single
31+
test/t1#p#p0 test/t1#p#p0 33 5 Dynamic 0 Single
32+
test/t1#p#p1 test/t1#p#p1 33 5 Dynamic 0 Single
33+
test/t1#p#p2 test/t1#p#p2 33 5 Dynamic 0 Single
3434
=== information_schema.innodb_tablespaces and innodb_datafiles ===
3535
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
3636
s1 General DEFAULT 0 Any s1.ibd
37-
innodb_file_per_table.## Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p0.ibd
38-
innodb_file_per_table.## Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p1.ibd
39-
innodb_file_per_table.## Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p2.ibd
37+
test/t1#p#p0 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p0.ibd
38+
test/t1#p#p1 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p1.ibd
39+
test/t1#p#p2 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p2.ibd
4040
=== information_schema.files ===
4141
Space_Name File_Type Engine Status Tablespace_Name Path
4242
s1 TABLESPACE InnoDB NORMAL s1 MYSQLD_DATADIR/s1.ibd
43-
innodb_file_per_table.## TABLESPACE InnoDB NORMAL innodb_file_per_table.## MYSQLD_DATADIR/test/t1#p#p0.ibd
44-
innodb_file_per_table.## TABLESPACE InnoDB NORMAL innodb_file_per_table.## MYSQLD_DATADIR/test/t1#p#p1.ibd
45-
innodb_file_per_table.## TABLESPACE InnoDB NORMAL innodb_file_per_table.## MYSQLD_DATADIR/test/t1#p#p2.ibd
43+
test/t1#p#p0 TABLESPACE InnoDB NORMAL test/t1#p#p0 MYSQLD_DATADIR/test/t1#p#p0.ibd
44+
test/t1#p#p1 TABLESPACE InnoDB NORMAL test/t1#p#p1 MYSQLD_DATADIR/test/t1#p#p1.ibd
45+
test/t1#p#p2 TABLESPACE InnoDB NORMAL test/t1#p#p2 MYSQLD_DATADIR/test/t1#p#p2.ibd
4646
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE innodb_file_per_table;
4747
SHOW CREATE TABLE t1;
4848
Table Create Table
@@ -54,21 +54,21 @@ t1 CREATE TABLE `t1` (
5454
PARTITIONS 3 */
5555
=== information_schema.innodb_tables and innodb_tablespaces ===
5656
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
57-
test/t1#p#p0 innodb_file_per_table.## 33 5 Dynamic 0 Single
58-
test/t1#p#p1 innodb_file_per_table.## 33 5 Dynamic 0 Single
59-
test/t1#p#p2 innodb_file_per_table.## 33 5 Dynamic 0 Single
57+
test/t1#p#p0 test/t1#p#p0 33 5 Dynamic 0 Single
58+
test/t1#p#p1 test/t1#p#p1 33 5 Dynamic 0 Single
59+
test/t1#p#p2 test/t1#p#p2 33 5 Dynamic 0 Single
6060
=== information_schema.innodb_tablespaces and innodb_datafiles ===
6161
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
6262
s1 General DEFAULT 0 Any s1.ibd
63-
innodb_file_per_table.## Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p0.ibd
64-
innodb_file_per_table.## Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p1.ibd
65-
innodb_file_per_table.## Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p2.ibd
63+
test/t1#p#p0 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p0.ibd
64+
test/t1#p#p1 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p1.ibd
65+
test/t1#p#p2 Single DEFAULT 0 Dynamic MYSQLD_DATADIR/test/t1#p#p2.ibd
6666
=== information_schema.files ===
6767
Space_Name File_Type Engine Status Tablespace_Name Path
6868
s1 TABLESPACE InnoDB NORMAL s1 MYSQLD_DATADIR/s1.ibd
69-
innodb_file_per_table.## TABLESPACE InnoDB NORMAL innodb_file_per_table.## MYSQLD_DATADIR/test/t1#p#p0.ibd
70-
innodb_file_per_table.## TABLESPACE InnoDB NORMAL innodb_file_per_table.## MYSQLD_DATADIR/test/t1#p#p1.ibd
71-
innodb_file_per_table.## TABLESPACE InnoDB NORMAL innodb_file_per_table.## MYSQLD_DATADIR/test/t1#p#p2.ibd
69+
test/t1#p#p0 TABLESPACE InnoDB NORMAL test/t1#p#p0 MYSQLD_DATADIR/test/t1#p#p0.ibd
70+
test/t1#p#p1 TABLESPACE InnoDB NORMAL test/t1#p#p1 MYSQLD_DATADIR/test/t1#p#p1.ibd
71+
test/t1#p#p2 TABLESPACE InnoDB NORMAL test/t1#p#p2 MYSQLD_DATADIR/test/t1#p#p2.ibd
7272
DROP TABLE t1;
7373
CREATE TABLE t1 (col1 INT, col2 INT) ENGINE = InnoDB TABLESPACE innodb_system PARTITION BY KEY(col1) PARTITIONS 3;
7474
=== information_schema.innodb_tables and innodb_tablespaces ===

0 commit comments

Comments
 (0)