diff options
45 files changed, 275 insertions, 1690 deletions
diff --git a/mysql-test/suite/innodb/include/show_i_s_tablespaces.inc b/mysql-test/suite/innodb/include/show_i_s_tablespaces.inc index 6d0c5c63712..9b108da4115 100644 --- a/mysql-test/suite/innodb/include/show_i_s_tablespaces.inc +++ b/mysql-test/suite/innodb/include/show_i_s_tablespaces.inc @@ -5,14 +5,12 @@ --disable_query_log --replace_regex /#P#/#p#/ /#SP#/#sp#/ --replace_result ./ MYSQLD_DATADIR/ $MYSQLD_DATADIR/ MYSQLD_DATADIR/ $MYSQLD_DATADIR MYSQLD_DATADIR/ $MYSQL_TMP_DIR MYSQL_TMP_DIR $INNODB_PAGE_SIZE DEFAULT -SELECT s.name 'Space_Name', - s.page_size 'Page_Size', - s.zip_page_size 'Zip_Size', - d.path 'Path' - FROM information_schema.innodb_sys_tablespaces s, - information_schema.innodb_sys_datafiles d - WHERE s.space = d.space - AND s.name NOT LIKE 'mysql/%' - AND s.name NOT LIKE '%/#sql-ib%' - ORDER BY s.space; +SELECT name 'Space_Name', + @@GLOBAL.innodb_page_size 'Page_Size', + page_size 'Zip_Size', + filename 'Path' + FROM information_schema.innodb_sys_tablespaces + WHERE name != 'innodb_system' + AND name NOT LIKE 'mysql/%' AND name NOT LIKE '%/#sql-ib%' + ORDER BY space; --enable_query_log diff --git a/mysql-test/suite/innodb/r/information_schema_grants.result b/mysql-test/suite/innodb/r/information_schema_grants.result index 622faa2920a..da66e7d8761 100644 --- a/mysql-test/suite/innodb/r/information_schema_grants.result +++ b/mysql-test/suite/innodb/r/information_schema_grants.result @@ -44,8 +44,6 @@ create sql security invoker view i_mutexes as select * from information_schema.i create sql security definer view d_mutexes as select * from information_schema.innodb_mutexes; create sql security invoker view i_sys_columns as select * from information_schema.innodb_sys_columns; create sql security definer view d_sys_columns as select * from information_schema.innodb_sys_columns; -create sql security invoker view i_sys_datafiles as select * from information_schema.innodb_sys_datafiles; -create sql security definer view d_sys_datafiles as select * from information_schema.innodb_sys_datafiles; create sql security invoker view i_sys_fields as select * from information_schema.innodb_sys_fields; create sql security definer view d_sys_fields as select * from information_schema.innodb_sys_fields; create sql security invoker view i_sys_foreign as select * from information_schema.innodb_sys_foreign; @@ -205,13 +203,6 @@ ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) select count(*) > -1 from d_sys_columns; count(*) > -1 1 -select count(*) > -1 from information_schema.innodb_sys_datafiles; -ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation -select count(*) > -1 from i_sys_datafiles; -ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation -select count(*) > -1 from d_sys_datafiles; -count(*) > -1 -1 select count(*) > -1 from information_schema.innodb_sys_fields; ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation select count(*) > -1 from i_sys_fields; diff --git a/mysql-test/suite/innodb/r/innodb-index-online-fk.result b/mysql-test/suite/innodb/r/innodb-index-online-fk.result index 854afd95aaf..a3041985519 100644 --- a/mysql-test/suite/innodb/r/innodb-index-online-fk.result +++ b/mysql-test/suite/innodb/r/innodb-index-online-fk.result @@ -120,10 +120,8 @@ test/child a1 test/child a2 SELECT NAME FROM information_schema.INNODB_SYS_TABLES; NAME -SYS_DATAFILES SYS_FOREIGN SYS_FOREIGN_COLS -SYS_TABLESPACES SYS_VIRTUAL mysql/innodb_index_stats mysql/innodb_table_stats @@ -312,10 +310,8 @@ test/child a1 test/child a2 SELECT NAME FROM information_schema.INNODB_SYS_TABLES; NAME -SYS_DATAFILES SYS_FOREIGN SYS_FOREIGN_COLS -SYS_TABLESPACES SYS_VIRTUAL mysql/innodb_index_stats mysql/innodb_table_stats @@ -340,10 +336,8 @@ test/child a2 test/child a3 SELECT NAME FROM information_schema.INNODB_SYS_TABLES; NAME -SYS_DATAFILES SYS_FOREIGN SYS_FOREIGN_COLS -SYS_TABLESPACES SYS_VIRTUAL mysql/innodb_index_stats mysql/innodb_table_stats @@ -379,10 +373,8 @@ test/child a1 test/child a2 SELECT NAME FROM information_schema.INNODB_SYS_TABLES; NAME -SYS_DATAFILES SYS_FOREIGN SYS_FOREIGN_COLS -SYS_TABLESPACES SYS_VIRTUAL mysql/innodb_index_stats mysql/innodb_table_stats @@ -416,10 +408,8 @@ test/child a2 test/child a3 SELECT NAME FROM information_schema.INNODB_SYS_TABLES; NAME -SYS_DATAFILES SYS_FOREIGN SYS_FOREIGN_COLS -SYS_TABLESPACES SYS_VIRTUAL mysql/innodb_index_stats mysql/innodb_table_stats diff --git a/mysql-test/suite/innodb/r/innodb-system-table-view.result b/mysql-test/suite/innodb/r/innodb-system-table-view.result index 11fc1ae8cf9..a1037976866 100644 --- a/mysql-test/suite/innodb/r/innodb-system-table-view.result +++ b/mysql-test/suite/innodb/r/innodb-system-table-view.result @@ -9,10 +9,8 @@ WHERE table_id NOT IN (@table_stats_id, @index_stats_id) ORDER BY table_id; TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE 11 SYS_FOREIGN 0 7 0 Redundant 0 System 12 SYS_FOREIGN_COLS 0 7 0 Redundant 0 System -13 SYS_TABLESPACES 0 6 0 Redundant 0 System -14 SYS_DATAFILES 0 5 0 Redundant 0 System -15 SYS_VIRTUAL 0 6 0 Redundant 0 System -18 mysql/transaction_registry 33 8 3 Dynamic 0 Single +13 SYS_VIRTUAL 0 6 0 Redundant 0 System +16 mysql/transaction_registry 33 8 3 Dynamic 0 Single SELECT table_id,pos,mtype,prtype,len,name FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS WHERE table_id NOT IN (@table_stats_id, @index_stats_id) @@ -26,19 +24,14 @@ table_id pos mtype prtype len name 12 1 6 0 4 POS 12 2 1 524292 0 FOR_COL_NAME 12 3 1 524292 0 REF_COL_NAME -13 0 6 0 4 SPACE -13 1 1 524292 0 NAME -13 2 6 0 4 FLAGS -14 0 6 0 4 SPACE -14 1 1 524292 0 PATH -15 0 6 0 8 TABLE_ID -15 1 6 0 4 POS -15 2 6 0 4 BASE_POS -18 0 6 1800 8 transaction_id -18 1 6 1800 8 commit_id -18 2 3 526087 7 begin_timestamp -18 3 3 526087 7 commit_timestamp -18 4 6 1022 1 isolation_level +13 0 6 0 8 TABLE_ID +13 1 6 0 4 POS +13 2 6 0 4 BASE_POS +16 0 6 1800 8 transaction_id +16 1 6 1800 8 commit_id +16 2 3 526087 7 begin_timestamp +16 3 3 526087 7 commit_timestamp +16 4 6 1022 1 isolation_level SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE table_id NOT IN (@table_stats_id, @index_stats_id) ORDER BY index_id; INDEX_ID NAME TABLE_ID TYPE N_FIELDS PAGE_NO SPACE MERGE_THRESHOLD @@ -46,8 +39,6 @@ INDEX_ID NAME TABLE_ID TYPE N_FIELDS PAGE_NO SPACE MERGE_THRESHOLD # FOR_IND # 0 1 # # 50 # REF_IND # 0 1 # # 50 # ID_IND # 3 2 # # 50 -# SYS_TABLESPACES_SPACE # 3 1 # # 50 -# SYS_DATAFILES_SPACE # 3 1 # # 50 # BASE_IDX # 3 3 # # 50 # PRIMARY # 3 1 # # 50 # commit_id # 2 1 # # 50 @@ -62,16 +53,14 @@ index_id pos name 13 0 REF_NAME 14 0 ID 14 1 POS -15 0 SPACE -16 0 SPACE -17 0 TABLE_ID -17 1 POS -17 2 BASE_POS -20 0 transaction_id -21 0 commit_id -22 0 begin_timestamp -23 0 commit_timestamp -23 1 transaction_id +15 0 TABLE_ID +15 1 POS +15 2 BASE_POS +18 0 transaction_id +19 0 commit_id +20 0 begin_timestamp +21 0 commit_timestamp +21 1 transaction_id SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN; ID FOR_NAME REF_NAME N_COLS TYPE SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; @@ -95,7 +84,7 @@ test/t_dynamic DEFAULT DEFAULT MYSQLD_DATADIR/test/t_dynamic.ibd DROP TABLE t_redundant, t_compact, t_compressed, t_dynamic; SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS; count(*) -8 +6 CREATE TABLE parent (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; CREATE TABLE child (id INT, parent_id INT, @@ -119,10 +108,8 @@ test/parent 1 1 SELECT NAME, FLAG, N_COLS FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name NOT LIKE 'sys/%'; NAME FLAG N_COLS -SYS_DATAFILES 0 5 SYS_FOREIGN 0 7 SYS_FOREIGN_COLS 0 7 -SYS_TABLESPACES 0 6 SYS_VIRTUAL 0 6 mysql/innodb_index_stats 33 11 mysql/innodb_table_stats 33 9 diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result index 775bbc017a1..777dd678fe8 100644 --- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result +++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result @@ -336,7 +336,6 @@ select * from information_schema.innodb_buffer_page_lru; POOL_ID LRU_POSITION SPACE PAGE_NUMBER PAGE_TYPE FLUSH_TYPE FIX_COUNT IS_HASHED NEWEST_MODIFICATION OLDEST_MODIFICATION ACCESS_TIME TABLE_NAME INDEX_NAME NUMBER_RECORDS DATA_SIZE COMPRESSED_SIZE COMPRESSED IO_FIX IS_OLD FREE_PAGE_CLOCK Warnings: Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_buffer_page_lru but the InnoDB storage engine is not installed -select * from information_schema.innodb_buffer_stats; select * from information_schema.innodb_sys_tables; TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE Warnings: @@ -366,14 +365,9 @@ ID FOR_COL_NAME REF_COL_NAME POS Warnings: Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_foreign_cols but the InnoDB storage engine is not installed select * from information_schema.innodb_sys_tablespaces; -SPACE NAME FLAG ROW_FORMAT PAGE_SIZE ZIP_PAGE_SIZE FS_BLOCK_SIZE FILE_SIZE ALLOCATED_SIZE +SPACE NAME FLAG ROW_FORMAT PAGE_SIZE FILENAME FS_BLOCK_SIZE FILE_SIZE ALLOCATED_SIZE Warnings: Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_tablespaces but the InnoDB storage engine is not installed -select * from information_schema.innodb_sys_datafiles; -SPACE PATH -Warnings: -Warning 1012 InnoDB: SELECTing from INFORMATION_SCHEMA.innodb_sys_datafiles but the InnoDB storage engine is not installed -select * from information_schema.innodb_changed_pages; select * from information_schema.innodb_tablespaces_encryption; SPACE NAME ENCRYPTION_SCHEME KEYSERVER_REQUESTS MIN_KEY_VERSION CURRENT_KEY_VERSION KEY_ROTATION_PAGE_NUMBER KEY_ROTATION_MAX_PAGE_NUMBER CURRENT_KEY_ID ROTATING_OR_FLUSHING Warnings: diff --git a/mysql-test/suite/innodb/r/rename_table.result b/mysql-test/suite/innodb/r/rename_table.result index 23bb8c52d4a..e5f4e5d77e6 100644 --- a/mysql-test/suite/innodb/r/rename_table.result +++ b/mysql-test/suite/innodb/r/rename_table.result @@ -2,8 +2,8 @@ CREATE DATABASE test_jfg; CREATE DATABASE test_jfg2; CREATE TABLE test_jfg.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB; RENAME TABLE test_jfg.test TO test_jfg2.test; -SELECT REPLACE(path,'\\','/') path -FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%'; +SELECT REPLACE(filename,'\\','/') path +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE filename LIKE '%test%'; path ./test_jfg2/test.ibd DROP DATABASE test_jfg; @@ -13,8 +13,8 @@ CREATE DATABASE abc_def; CREATE DATABASE abc_def2; CREATE TABLE abc_def.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB; RENAME TABLE abc_def.test TO abc_def2.test1; -SELECT REPLACE(path,'\\','/') path -FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%'; +SELECT REPLACE(filename,'\\','/') path +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE filename LIKE '%test%'; path ./abc_def2/test1.ibd DROP DATABASE abc_def; diff --git a/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff index 7e851cf5634..babcd88bd91 100644 --- a/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff +++ b/mysql-test/suite/innodb/r/table_flags,32k,debug.rdiff @@ -1,6 +1,6 @@ --- suite/innodb/r/table_flags.result +++ suite/innodb/r/table_flags,32k,debug.reject -@@ -5,96 +5,98 @@ +@@ -6,6 +6,8 @@ SET innodb_strict_mode=OFF; CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; @@ -9,23 +9,13 @@ SET innodb_strict_mode=ON; CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; +@@ -11,71 +11,71 @@ + PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; SYS_TABLES clustered index root page (8): - N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001 --header=0x01000003016e (NAME=0x696e66696d756d00) --header=0x00002815008d (NAME='SYS_DATAFILES', -+header=0x0100000301bf (NAME=0x696e66696d756d00) -+header=0x0000301500de (NAME='SYS_DATAFILES', - DB_TRX_ID=0x000000000000, - DB_ROLL_PTR=0x80000000000000, -- ID=0x000000000000000e, -+ ID=0x000000000000000f, - N_COLS=0x00000002, - TYPE=0x00000001, - MIX_ID=0x0000000000000000, - MIX_LEN=0x00000040, - CLUSTER_NAME=NULL(0 bytes), - SPACE=0x00000000) + N_RECS=8; LEVEL=0; INDEX_ID=0x0000000000000001 +-header=0x01000003008d (NAME=0x696e66696d756d00) -header=0x0000101500d5 (NAME='SYS_FOREIGN', ++header=0x0100000300de (NAME=0x696e66696d756d00) +header=0x000018150126 (NAME='SYS_FOREIGN', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, @@ -49,8 +39,8 @@ MIX_LEN=0x00000040, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000000) --header=0x0400201501b8 (NAME='SYS_TABLESPACES', -+header=0x040028150209 (NAME='SYS_TABLESPACES', +-header=0x0000201501ae (NAME='SYS_VIRTUAL', ++header=0x0000281501bb (NAME='SYS_VIRTUAL', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, - ID=0x000000000000000d, @@ -61,69 +51,57 @@ MIX_LEN=0x00000040, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000000) --header=0x000030150244 (NAME='SYS_VIRTUAL', -+header=0x000038150251 (NAME='SYS_VIRTUAL', +-header=0x0400301501f2 (NAME='test/tc', ++header=0x0400301501ff (NAME='test/tc', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, - ID=0x000000000000000f, + ID=0x0000000000000010, - N_COLS=0x00000003, - TYPE=0x00000001, - MIX_ID=0x0000000000000000, - MIX_LEN=0x00000040, - CLUSTER_NAME=NULL(0 bytes), - SPACE=0x00000000) --header=0x000040150288 (NAME='test/tc', -+header=0x000040150295 (NAME='test/tc', - DB_TRX_ID=0x000000000000, - DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000011, -+ ID=0x0000000000000012, N_COLS=0x80000001, TYPE=0x00000001, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000002) --header=0x000048150310 (NAME='test/td', -+header=0x00004815031d (NAME='test/td', +-header=0x00003815027a (NAME='test/td', ++header=0x000038150287 (NAME='test/td', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000012, -+ ID=0x0000000000000013, +- ID=0x0000000000000010, ++ ID=0x0000000000000011, N_COLS=0x80000001, TYPE=0x00000021, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000003) --header=0x000058150200 (NAME='test/tp', -+header=0x00005815008d (NAME='test/tp', +-header=0x00004815016a (NAME='test/tp', ++header=0x00004815008d (NAME='test/tp', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000014, -+ ID=0x0000000000000015, +- ID=0x0000000000000012, ++ ID=0x0000000000000013, N_COLS=0x80000001, TYPE=0x000009a1, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000005) --header=0x0000381502cc (NAME='test/tr', -+header=0x0000101502d9 (NAME='test/tr', +-header=0x000028150236 (NAME='test/tr', ++header=0x000010150243 (NAME='test/tr', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000010, -+ ID=0x0000000000000011, +- ID=0x000000000000000e, ++ ID=0x000000000000000f, N_COLS=0x00000001, TYPE=0x00000001, MIX_ID=0x0000000000000000, -@@ -104,9 +106,9 @@ - header=0x000050150074 (NAME='test/tz', +@@ -85,9 +85,9 @@ + header=0x000040150074 (NAME='test/tz', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000013, -+ ID=0x0000000000000014, +- ID=0x0000000000000011, ++ ID=0x0000000000000012, N_COLS=0x80000001, - TYPE=0x00000023, + TYPE=0x00000021, diff --git a/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff index da52f17fa68..c8763b4c093 100644 --- a/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff +++ b/mysql-test/suite/innodb/r/table_flags,64k,debug.rdiff @@ -1,6 +1,6 @@ --- suite/innodb/r/table_flags.result +++ suite/innodb/r/table_flags,64k,debug.reject -@@ -5,96 +5,98 @@ +@@ -6,6 +6,8 @@ SET innodb_strict_mode=OFF; CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; @@ -9,23 +9,13 @@ SET innodb_strict_mode=ON; CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; +@@ -11,71 +11,71 @@ + PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; SYS_TABLES clustered index root page (8): - N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001 --header=0x01000003016e (NAME=0x696e66696d756d00) --header=0x00002815008d (NAME='SYS_DATAFILES', -+header=0x0100000301bf (NAME=0x696e66696d756d00) -+header=0x0000301500de (NAME='SYS_DATAFILES', - DB_TRX_ID=0x000000000000, - DB_ROLL_PTR=0x80000000000000, -- ID=0x000000000000000e, -+ ID=0x000000000000000f, - N_COLS=0x00000002, - TYPE=0x00000001, - MIX_ID=0x0000000000000000, - MIX_LEN=0x00000040, - CLUSTER_NAME=NULL(0 bytes), - SPACE=0x00000000) + N_RECS=8; LEVEL=0; INDEX_ID=0x0000000000000001 +-header=0x01000003008d (NAME=0x696e66696d756d00) -header=0x0000101500d5 (NAME='SYS_FOREIGN', ++header=0x0100000300de (NAME=0x696e66696d756d00) +header=0x000018150126 (NAME='SYS_FOREIGN', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, @@ -49,8 +39,8 @@ MIX_LEN=0x00000040, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000000) --header=0x0400201501b8 (NAME='SYS_TABLESPACES', -+header=0x040028150209 (NAME='SYS_TABLESPACES', +-header=0x0000201501ae (NAME='SYS_VIRTUAL', ++header=0x0000281501bb (NAME='SYS_VIRTUAL', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, - ID=0x000000000000000d, @@ -61,69 +51,57 @@ MIX_LEN=0x00000040, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000000) --header=0x000030150244 (NAME='SYS_VIRTUAL', -+header=0x000038150251 (NAME='SYS_VIRTUAL', +-header=0x0400301501f2 (NAME='test/tc', ++header=0x0400301501ff (NAME='test/tc', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, - ID=0x000000000000000f, + ID=0x0000000000000010, - N_COLS=0x00000003, - TYPE=0x00000001, - MIX_ID=0x0000000000000000, - MIX_LEN=0x00000040, - CLUSTER_NAME=NULL(0 bytes), - SPACE=0x00000000) --header=0x000040150288 (NAME='test/tc', -+header=0x000040150295 (NAME='test/tc', - DB_TRX_ID=0x000000000000, - DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000011, -+ ID=0x0000000000000012, N_COLS=0x80000001, TYPE=0x00000001, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000002) --header=0x000048150310 (NAME='test/td', -+header=0x00004815031d (NAME='test/td', +-header=0x00003815027a (NAME='test/td', ++header=0x000038150287 (NAME='test/td', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000012, -+ ID=0x0000000000000013, +- ID=0x0000000000000010, ++ ID=0x0000000000000011, N_COLS=0x80000001, TYPE=0x00000021, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000003) --header=0x000058150200 (NAME='test/tp', -+header=0x00005815008d (NAME='test/tp', +-header=0x00004815016a (NAME='test/tp', ++header=0x00004815008d (NAME='test/tp', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000014, -+ ID=0x0000000000000015, +- ID=0x0000000000000012, ++ ID=0x0000000000000013, N_COLS=0x80000001, TYPE=0x000009a1, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000005) --header=0x0000381502cc (NAME='test/tr', -+header=0x0000101502d9 (NAME='test/tr', +-header=0x000028150236 (NAME='test/tr', ++header=0x000010150243 (NAME='test/tr', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000010, -+ ID=0x0000000000000011, +- ID=0x000000000000000e, ++ ID=0x000000000000000f, N_COLS=0x00000001, TYPE=0x00000001, MIX_ID=0x0000000000000000, -@@ -104,9 +106,9 @@ - header=0x000050150074 (NAME='test/tz', +@@ -85,9 +85,9 @@ + header=0x000040150074 (NAME='test/tz', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000013, -+ ID=0x0000000000000014, +- ID=0x0000000000000011, ++ ID=0x0000000000000012, N_COLS=0x80000001, - TYPE=0x00000023, + TYPE=0x00000021, diff --git a/mysql-test/suite/innodb/r/table_flags,debug.rdiff b/mysql-test/suite/innodb/r/table_flags,debug.rdiff index 16f748468dd..50592d95ac4 100644 --- a/mysql-test/suite/innodb/r/table_flags,debug.rdiff +++ b/mysql-test/suite/innodb/r/table_flags,debug.rdiff @@ -1,24 +1,12 @@ --- suite/innodb/r/table_flags.result +++ suite/innodb/r/table_flags,debug.reject -@@ -10,91 +10,91 @@ +@@ -11,71 +11,71 @@ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; SYS_TABLES clustered index root page (8): - N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001 --header=0x01000003016e (NAME=0x696e66696d756d00) --header=0x00002815008d (NAME='SYS_DATAFILES', -+header=0x0100000301bf (NAME=0x696e66696d756d00) -+header=0x0000301500de (NAME='SYS_DATAFILES', - DB_TRX_ID=0x000000000000, - DB_ROLL_PTR=0x80000000000000, -- ID=0x000000000000000e, -+ ID=0x000000000000000f, - N_COLS=0x00000002, - TYPE=0x00000001, - MIX_ID=0x0000000000000000, - MIX_LEN=0x00000040, - CLUSTER_NAME=NULL(0 bytes), - SPACE=0x00000000) + N_RECS=8; LEVEL=0; INDEX_ID=0x0000000000000001 +-header=0x01000003008d (NAME=0x696e66696d756d00) -header=0x0000101500d5 (NAME='SYS_FOREIGN', ++header=0x0100000300de (NAME=0x696e66696d756d00) +header=0x000018150126 (NAME='SYS_FOREIGN', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, @@ -42,8 +30,8 @@ MIX_LEN=0x00000040, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000000) --header=0x0400201501b8 (NAME='SYS_TABLESPACES', -+header=0x040028150209 (NAME='SYS_TABLESPACES', +-header=0x0000201501ae (NAME='SYS_VIRTUAL', ++header=0x0000281501bb (NAME='SYS_VIRTUAL', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, - ID=0x000000000000000d, @@ -54,69 +42,57 @@ MIX_LEN=0x00000040, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000000) --header=0x000030150244 (NAME='SYS_VIRTUAL', -+header=0x000038150251 (NAME='SYS_VIRTUAL', +-header=0x0400301501f2 (NAME='test/tc', ++header=0x0400301501ff (NAME='test/tc', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, - ID=0x000000000000000f, + ID=0x0000000000000010, - N_COLS=0x00000003, - TYPE=0x00000001, - MIX_ID=0x0000000000000000, - MIX_LEN=0x00000040, - CLUSTER_NAME=NULL(0 bytes), - SPACE=0x00000000) --header=0x000040150288 (NAME='test/tc', -+header=0x000040150295 (NAME='test/tc', - DB_TRX_ID=0x000000000000, - DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000011, -+ ID=0x0000000000000012, N_COLS=0x80000001, TYPE=0x00000001, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000002) --header=0x000048150310 (NAME='test/td', -+header=0x00004815031d (NAME='test/td', +-header=0x00003815027a (NAME='test/td', ++header=0x000038150287 (NAME='test/td', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000012, -+ ID=0x0000000000000013, +- ID=0x0000000000000010, ++ ID=0x0000000000000011, N_COLS=0x80000001, TYPE=0x00000021, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000003) --header=0x000058150200 (NAME='test/tp', -+header=0x00005815008d (NAME='test/tp', +-header=0x00004815016a (NAME='test/tp', ++header=0x00004815008d (NAME='test/tp', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000014, -+ ID=0x0000000000000015, +- ID=0x0000000000000012, ++ ID=0x0000000000000013, N_COLS=0x80000001, TYPE=0x000009a1, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000005) --header=0x0000381502cc (NAME='test/tr', -+header=0x0000101502d9 (NAME='test/tr', +-header=0x000028150236 (NAME='test/tr', ++header=0x000010150243 (NAME='test/tr', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000010, -+ ID=0x0000000000000011, +- ID=0x000000000000000e, ++ ID=0x000000000000000f, N_COLS=0x00000001, TYPE=0x00000001, MIX_ID=0x0000000000000000, -@@ -104,7 +104,7 @@ - header=0x000050150074 (NAME='test/tz', +@@ -85,7 +85,7 @@ + header=0x000040150074 (NAME='test/tz', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, -- ID=0x0000000000000013, -+ ID=0x0000000000000014, +- ID=0x0000000000000011, ++ ID=0x0000000000000012, N_COLS=0x80000001, TYPE=0x00000023, MIX_ID=0x0000000000000000, diff --git a/mysql-test/suite/innodb/r/table_flags.result b/mysql-test/suite/innodb/r/table_flags.result index 347ba5ef52c..210d370aab4 100644 --- a/mysql-test/suite/innodb/r/table_flags.result +++ b/mysql-test/suite/innodb/r/table_flags.result @@ -10,18 +10,8 @@ SET innodb_strict_mode=ON; CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; SYS_TABLES clustered index root page (8): -N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001 -header=0x01000003016e (NAME=0x696e66696d756d00) -header=0x00002815008d (NAME='SYS_DATAFILES', - DB_TRX_ID=0x000000000000, - DB_ROLL_PTR=0x80000000000000, - ID=0x000000000000000e, - N_COLS=0x00000002, - TYPE=0x00000001, - MIX_ID=0x0000000000000000, - MIX_LEN=0x00000040, - CLUSTER_NAME=NULL(0 bytes), - SPACE=0x00000000) +N_RECS=8; LEVEL=0; INDEX_ID=0x0000000000000001 +header=0x01000003008d (NAME=0x696e66696d756d00) header=0x0000101500d5 (NAME='SYS_FOREIGN', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, @@ -42,7 +32,7 @@ header=0x000018150122 (NAME='SYS_FOREIGN_COLS', MIX_LEN=0x00000040, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000000) -header=0x0400201501b8 (NAME='SYS_TABLESPACES', +header=0x0000201501ae (NAME='SYS_VIRTUAL', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, ID=0x000000000000000d, @@ -52,67 +42,57 @@ header=0x0400201501b8 (NAME='SYS_TABLESPACES', MIX_LEN=0x00000040, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000000) -header=0x000030150244 (NAME='SYS_VIRTUAL', +header=0x0400301501f2 (NAME='test/tc', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, ID=0x000000000000000f, - N_COLS=0x00000003, - TYPE=0x00000001, - MIX_ID=0x0000000000000000, - MIX_LEN=0x00000040, - CLUSTER_NAME=NULL(0 bytes), - SPACE=0x00000000) -header=0x000040150288 (NAME='test/tc', - DB_TRX_ID=0x000000000000, - DB_ROLL_PTR=0x80000000000000, - ID=0x0000000000000011, N_COLS=0x80000001, TYPE=0x00000001, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000002) -header=0x000048150310 (NAME='test/td', +header=0x00003815027a (NAME='test/td', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, - ID=0x0000000000000012, + ID=0x0000000000000010, N_COLS=0x80000001, TYPE=0x00000021, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000003) -header=0x000058150200 (NAME='test/tp', +header=0x00004815016a (NAME='test/tp', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, - ID=0x0000000000000014, + ID=0x0000000000000012, N_COLS=0x80000001, TYPE=0x000009a1, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000005) -header=0x0000381502cc (NAME='test/tr', +header=0x000028150236 (NAME='test/tr', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, - ID=0x0000000000000010, + ID=0x000000000000000e, N_COLS=0x00000001, TYPE=0x00000001, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000001) -header=0x000050150074 (NAME='test/tz', +header=0x000040150074 (NAME='test/tz', DB_TRX_ID=0x000000000000, DB_ROLL_PTR=0x80000000000000, - ID=0x0000000000000013, + ID=0x0000000000000011, N_COLS=0x80000001, TYPE=0x00000023, MIX_ID=0x0000000000000000, MIX_LEN=0x00000050, CLUSTER_NAME=NULL(0 bytes), SPACE=0x00000004) -header=0x070008030000 (NAME=0x73757072656d756d00) +header=0x050008030000 (NAME=0x73757072656d756d00) # restart: with restart_parameters SHOW CREATE TABLE tr; ERROR 42S02: Table 'test.tr' doesn't exist in engine diff --git a/mysql-test/suite/innodb/r/temporary_table_optimization.result b/mysql-test/suite/innodb/r/temporary_table_optimization.result index 3459dbb7837..c678fd56880 100644 --- a/mysql-test/suite/innodb/r/temporary_table_optimization.result +++ b/mysql-test/suite/innodb/r/temporary_table_optimization.result @@ -244,23 +244,14 @@ index sk (b(3021)) drop table t; CREATE TABLE t1 ( i INT ) ENGINE = Innodb; CREATE TEMPORARY TABLE t2 ( i INT ) ENGINE = Innodb; -SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_'; -COUNT(*) -0 SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_'; COUNT(*) 1 CREATE TEMPORARY table t3 ( i INT ) ENGINE = Innodb; -SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_'; -COUNT(*) -0 SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_'; COUNT(*) 1 DROP TABLE t1,t2,t3; -SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_'; -COUNT(*) -0 SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_'; COUNT(*) 0 diff --git a/mysql-test/suite/innodb/t/information_schema_grants.opt b/mysql-test/suite/innodb/t/information_schema_grants.opt index 38c5e3cf1cd..fb2052874cd 100644 --- a/mysql-test/suite/innodb/t/information_schema_grants.opt +++ b/mysql-test/suite/innodb/t/information_schema_grants.opt @@ -25,7 +25,6 @@ --enable-plugin-innodb-sys-foreign --enable-plugin-innodb-sys-foreign-cols --enable-plugin-innodb-sys-tablespaces ---enable-plugin-innodb-sys-datafiles --enable-plugin-innodb-sys-virtual --enable-plugin-innodb-mutexes --enable-plugin-innodb-sys-semaphore-waits diff --git a/mysql-test/suite/innodb/t/information_schema_grants.test b/mysql-test/suite/innodb/t/information_schema_grants.test index 72982b3ec1c..a9b82529694 100644 --- a/mysql-test/suite/innodb/t/information_schema_grants.test +++ b/mysql-test/suite/innodb/t/information_schema_grants.test @@ -70,9 +70,6 @@ create sql security definer view d_mutexes as select * from information_schema.i create sql security invoker view i_sys_columns as select * from information_schema.innodb_sys_columns; create sql security definer view d_sys_columns as select * from information_schema.innodb_sys_columns; -create sql security invoker view i_sys_datafiles as select * from information_schema.innodb_sys_datafiles; -create sql security definer view d_sys_datafiles as select * from information_schema.innodb_sys_datafiles; - create sql security invoker view i_sys_fields as select * from information_schema.innodb_sys_fields; create sql security definer view d_sys_fields as select * from information_schema.innodb_sys_fields; @@ -225,12 +222,6 @@ select count(*) > -1 from i_sys_columns; select count(*) > -1 from d_sys_columns; --error ER_SPECIFIC_ACCESS_DENIED_ERROR -select count(*) > -1 from information_schema.innodb_sys_datafiles; ---error ER_SPECIFIC_ACCESS_DENIED_ERROR -select count(*) > -1 from i_sys_datafiles; -select count(*) > -1 from d_sys_datafiles; - ---error ER_SPECIFIC_ACCESS_DENIED_ERROR select count(*) > -1 from information_schema.innodb_sys_fields; --error ER_SPECIFIC_ACCESS_DENIED_ERROR select count(*) > -1 from i_sys_fields; diff --git a/mysql-test/suite/innodb/t/innodb-system-table-view.opt b/mysql-test/suite/innodb/t/innodb-system-table-view.opt index 4d6858cbe0b..6bf2c4c9c72 100644 --- a/mysql-test/suite/innodb/t/innodb-system-table-view.opt +++ b/mysql-test/suite/innodb/t/innodb-system-table-view.opt @@ -1,6 +1,5 @@ --innodb --innodb-sys-tablespaces ---innodb-sys-datafiles --innodb-sys-tablestats --innodb-sys-tables --innodb-sys-columns diff --git a/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.test b/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.test index a5d5d3fe34e..d21b9c092e2 100644 --- a/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.test +++ b/mysql-test/suite/innodb/t/innodb_skip_innodb_is_tables.test @@ -18,8 +18,6 @@ select * from information_schema.innodb_ft_index_table; select * from information_schema.innodb_ft_config; select * from information_schema.innodb_buffer_page; select * from information_schema.innodb_buffer_page_lru; ---error 0,1109 -select * from information_schema.innodb_buffer_stats; select * from information_schema.innodb_sys_tables; select * from information_schema.innodb_sys_tablestats; select * from information_schema.innodb_sys_indexes; @@ -28,9 +26,6 @@ select * from information_schema.innodb_sys_fields; select * from information_schema.innodb_sys_foreign; select * from information_schema.innodb_sys_foreign_cols; select * from information_schema.innodb_sys_tablespaces; -select * from information_schema.innodb_sys_datafiles; ---error 0,1109 -select * from information_schema.innodb_changed_pages; select * from information_schema.innodb_tablespaces_encryption; select * from information_schema.innodb_mutexes; select * from information_schema.innodb_sys_semaphore_waits; diff --git a/mysql-test/suite/innodb/t/rename_table.opt b/mysql-test/suite/innodb/t/rename_table.opt index a4c52ea7d79..1852495a506 100644 --- a/mysql-test/suite/innodb/t/rename_table.opt +++ b/mysql-test/suite/innodb/t/rename_table.opt @@ -1,2 +1,2 @@ --innodb ---innodb-sys-datafiles +--innodb-sys-tablespaces diff --git a/mysql-test/suite/innodb/t/rename_table.test b/mysql-test/suite/innodb/t/rename_table.test index 0191a94def2..f7e3998cf63 100644 --- a/mysql-test/suite/innodb/t/rename_table.test +++ b/mysql-test/suite/innodb/t/rename_table.test @@ -6,8 +6,8 @@ CREATE DATABASE test_jfg2; CREATE TABLE test_jfg.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB; RENAME TABLE test_jfg.test TO test_jfg2.test; -SELECT REPLACE(path,'\\','/') path -FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%'; +SELECT REPLACE(filename,'\\','/') path +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE filename LIKE '%test%'; DROP DATABASE test_jfg; @@ -21,8 +21,8 @@ CREATE DATABASE abc_def2; CREATE TABLE abc_def.test (a int unsigned PRIMARY KEY) ENGINE=InnoDB; RENAME TABLE abc_def.test TO abc_def2.test1; -SELECT REPLACE(path,'\\','/') path -FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%'; +SELECT REPLACE(filename,'\\','/') path +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE filename LIKE '%test%'; DROP DATABASE abc_def; diff --git a/mysql-test/suite/innodb/t/temporary_table_optimization.opt b/mysql-test/suite/innodb/t/temporary_table_optimization.opt index 2f73da1ead6..39b93371503 100644 --- a/mysql-test/suite/innodb/t/temporary_table_optimization.opt +++ b/mysql-test/suite/innodb/t/temporary_table_optimization.opt @@ -1 +1 @@ ---loose-innodb-sys-datafiles --loose-innodb-sys-tables +--loose-innodb-sys-tables diff --git a/mysql-test/suite/innodb/t/temporary_table_optimization.test b/mysql-test/suite/innodb/t/temporary_table_optimization.test index 967965f9998..a30f05cb6b9 100644 --- a/mysql-test/suite/innodb/t/temporary_table_optimization.test +++ b/mysql-test/suite/innodb/t/temporary_table_optimization.test @@ -13,7 +13,7 @@ # 4. Import/Discard of temp-table (to check blocked action) # # 5. Renaming of temp-table # # 6. Creating temp-table with large prefix. # -# 7. Check Temp table info not stored in I_S datafile and tables # +# 7. Check Temp table info not stored in InnoDB system tables # ######################################################################### @@ -233,11 +233,8 @@ drop table t; # CREATE TABLE t1 ( i INT ) ENGINE = Innodb; CREATE TEMPORARY TABLE t2 ( i INT ) ENGINE = Innodb; -SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_'; SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_'; CREATE TEMPORARY table t3 ( i INT ) ENGINE = Innodb; -SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_'; SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_'; DROP TABLE t1,t2,t3; -SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_'; SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_'; diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_datafiles.opt b/mysql-test/suite/innodb_i_s/innodb_sys_datafiles.opt deleted file mode 100644 index d6803d5ecdf..00000000000 --- a/mysql-test/suite/innodb_i_s/innodb_sys_datafiles.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb_sys_datafiles diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_datafiles.result b/mysql-test/suite/innodb_i_s/innodb_sys_datafiles.result deleted file mode 100644 index eb2dd8b71ad..00000000000 --- a/mysql-test/suite/innodb_i_s/innodb_sys_datafiles.result +++ /dev/null @@ -1,6 +0,0 @@ -SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_DATAFILES; -Table Create Table -INNODB_SYS_DATAFILES CREATE TEMPORARY TABLE `INNODB_SYS_DATAFILES` ( - `SPACE` int(11) unsigned NOT NULL DEFAULT 0, - `PATH` varchar(4000) NOT NULL DEFAULT '' -) ENGINE=MEMORY DEFAULT CHARSET=utf8 diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_datafiles.test b/mysql-test/suite/innodb_i_s/innodb_sys_datafiles.test deleted file mode 100644 index dd843fec761..00000000000 --- a/mysql-test/suite/innodb_i_s/innodb_sys_datafiles.test +++ /dev/null @@ -1,3 +0,0 @@ ---source include/have_innodb.inc - -SHOW CREATE TABLE INFORMATION_SCHEMA.INNODB_SYS_DATAFILES; diff --git a/mysql-test/suite/innodb_i_s/innodb_sys_tablespaces.result b/mysql-test/suite/innodb_i_s/innodb_sys_tablespaces.result index 40e337f49f3..cc8728bc9ad 100644 --- a/mysql-test/suite/innodb_i_s/innodb_sys_tablespaces.result +++ b/mysql-test/suite/innodb_i_s/innodb_sys_tablespaces.result @@ -6,7 +6,7 @@ INNODB_SYS_TABLESPACES CREATE TEMPORARY TABLE `INNODB_SYS_TABLESPACES` ( `FLAG` int(11) unsigned NOT NULL DEFAULT 0, `ROW_FORMAT` varchar(22) DEFAULT NULL, `PAGE_SIZE` int(11) unsigned NOT NULL DEFAULT 0, - `ZIP_PAGE_SIZE` int(11) unsigned NOT NULL DEFAULT 0, + `FILENAME` varchar(512) NOT NULL DEFAULT '', `FS_BLOCK_SIZE` int(11) unsigned NOT NULL DEFAULT 0, `FILE_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0, `ALLOCATED_SIZE` bigint(21) unsigned NOT NULL DEFAULT 0 diff --git a/mysql-test/suite/innodb_zip/r/restart.result b/mysql-test/suite/innodb_zip/r/restart.result index 59d739db5b5..b0cc44c73b5 100644 --- a/mysql-test/suite/innodb_zip/r/restart.result +++ b/mysql-test/suite/innodb_zip/r/restart.result @@ -216,9 +216,9 @@ test/t2_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t2_restart.ibd test/t3_restart DEFAULT 2048 MYSQLD_DATADIR/test/t3_restart.ibd test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd test/t5_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd -test/t6_restart#p#p0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd -test/t6_restart#p#p1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd -test/t6_restart#p#p2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd +test/t6_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd +test/t6_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd +test/t6_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd test/t7_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd test/t7_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd test/t7_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd @@ -401,9 +401,9 @@ test/t2_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t2_restart.ibd test/t3_restart DEFAULT 2048 MYSQLD_DATADIR/test/t3_restart.ibd test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd test/t5_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd -test/t6_restart#p#p0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd -test/t6_restart#p#p1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd -test/t6_restart#p#p2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd +test/t6_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd +test/t6_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd +test/t6_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd test/t7_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd test/t7_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd test/t7_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd @@ -420,12 +420,12 @@ ALTER TABLE t7_restart TRUNCATE PARTITION p1; === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === Space_Name Page_Size Zip_Size Path test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd -test/t6_restart#p#p0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd -test/t6_restart#p#p1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd +test/t6_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd +test/t6_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd test/t7_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd test/t7_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd test/t5_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd -test/t6_restart#p#p2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd +test/t6_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd test/t7_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd test/t7_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); @@ -525,12 +525,12 @@ innodb_file_per_table ON === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === Space_Name Page_Size Zip_Size Path test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd -test/t6_restart#p#p0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd -test/t6_restart#p#p1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd +test/t6_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd +test/t6_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd test/t7_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd test/t7_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd test/t5_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd -test/t6_restart#p#p2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd +test/t6_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd test/t7_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd test/t7_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd SELECT count(*) FROM t5_restart; @@ -626,12 +626,12 @@ RENAME TABLE t7_restart TO t77_restart; === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === Space_Name Page_Size Zip_Size Path test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd -test/t66_restart#p#p0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd -test/t66_restart#p#p1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd +test/t66_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd +test/t66_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd test/t77_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s0.ibd test/t77_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s1.ibd test/t55_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd -test/t66_restart#p#p2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p2.ibd +test/t66_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p2.ibd test/t77_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s2.ibd test/t77_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s3.ibd INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart); @@ -724,12 +724,12 @@ innodb_file_per_table ON === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === Space_Name Page_Size Zip_Size Path test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd -test/t66_restart#p#p0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd -test/t66_restart#p#p1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd +test/t66_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd +test/t66_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd test/t77_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s0.ibd test/t77_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s1.ibd test/t55_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd -test/t66_restart#p#p2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p2.ibd +test/t66_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p2.ibd test/t77_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s2.ibd test/t77_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s3.ibd INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart); @@ -858,12 +858,12 @@ t77_restart#p#p1#sp#s3.ibd === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === Space_Name Page_Size Zip_Size Path test/t4_restart DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd -test/t66_restart#p#p0 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p0.ibd -test/t66_restart#p#p1 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p1.ibd +test/t66_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p0.ibd +test/t66_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p1.ibd test/t77_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p0#sp#s0.ibd test/t77_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p0#sp#s1.ibd test/t55_restart DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd -test/t66_restart#p#p2 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p2.ibd +test/t66_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p2.ibd test/t77_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p1#sp#s2.ibd test/t77_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p1#sp#s3.ibd INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); @@ -996,12 +996,12 @@ t77_restart.par === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === Space_Name Page_Size Zip_Size Path test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd -test/t66_restart#p#p0 DEFAULT DEFAULT MYSQLD_DATADIR/test/t66_restart#p#p0.ibd -test/t66_restart#p#p1 DEFAULT DEFAULT MYSQLD_DATADIR/test/t66_restart#p#p1.ibd +test/t66_restart#p#p0 DEFAULT 2048 MYSQLD_DATADIR/test/t66_restart#p#p0.ibd +test/t66_restart#p#p1 DEFAULT 2048 MYSQLD_DATADIR/test/t66_restart#p#p1.ibd test/t77_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQLD_DATADIR/test/t77_restart#p#p0#sp#s0.ibd test/t77_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQLD_DATADIR/test/t77_restart#p#p0#sp#s1.ibd test/t55_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t55_restart.ibd -test/t66_restart#p#p2 DEFAULT DEFAULT MYSQLD_DATADIR/test/t66_restart#p#p2.ibd +test/t66_restart#p#p2 DEFAULT 2048 MYSQLD_DATADIR/test/t66_restart#p#p2.ibd test/t77_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQLD_DATADIR/test/t77_restart#p#p1#sp#s2.ibd test/t77_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQLD_DATADIR/test/t77_restart#p#p1#sp#s3.ibd INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); diff --git a/mysql-test/suite/innodb_zip/t/page_size.opt b/mysql-test/suite/innodb_zip/t/page_size.opt index 82f574a8039..9e30213d5ef 100644 --- a/mysql-test/suite/innodb_zip/t/page_size.opt +++ b/mysql-test/suite/innodb_zip/t/page_size.opt @@ -1,3 +1,2 @@ --loose-innodb-sys-indexes --loose-innodb-sys-tablespaces ---loose-innodb-sys-datafiles diff --git a/mysql-test/suite/innodb_zip/t/restart.opt b/mysql-test/suite/innodb_zip/t/restart.opt index 52314cbf241..d7564300c09 100644 --- a/mysql-test/suite/innodb_zip/t/restart.opt +++ b/mysql-test/suite/innodb_zip/t/restart.opt @@ -1,3 +1,2 @@ --loose-innodb-sys-tables --loose-innodb-sys-tablespaces ---loose-innodb-sys-datafiles diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index 55e3191c228..ea7bad3e9f0 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -1341,10 +1341,9 @@ function_exit: /****************************************************************//** Check whether a system table exists. Additionally, if it exists, -move it to the non-LRU end of the table LRU list. This is oly used +move it to the non-LRU end of the table LRU list. This is only used for system tables that can be upgraded or added to an older database, -which include SYS_FOREIGN, SYS_FOREIGN_COLS, SYS_TABLESPACES and -SYS_DATAFILES. +which include SYS_FOREIGN and SYS_FOREIGN_COLS. @return DB_SUCCESS if the sys table exists, DB_CORRUPTION if it exists but is not current, DB_TABLE_NOT_FOUND if it does not exist*/ static @@ -2049,189 +2048,3 @@ dict_create_add_foreigns_to_dictionary( return error; } - -/****************************************************************//** -Creates the tablespaces and datafiles system tables inside InnoDB -at server bootstrap or server start if they are not found or are -not of the right form. -@return DB_SUCCESS or error code */ -dberr_t -dict_create_or_check_sys_tablespace(void) -/*=====================================*/ -{ - trx_t* trx; - my_bool srv_file_per_table_backup; - dberr_t err; - dberr_t sys_tablespaces_err; - dberr_t sys_datafiles_err; - - ut_ad(!srv_any_background_activity()); - - /* Note: The master thread has not been started at this point. */ - - sys_tablespaces_err = dict_check_if_system_table_exists( - "SYS_TABLESPACES", DICT_NUM_FIELDS__SYS_TABLESPACES + 1, 1); - sys_datafiles_err = dict_check_if_system_table_exists( - "SYS_DATAFILES", DICT_NUM_FIELDS__SYS_DATAFILES + 1, 1); - - if (sys_tablespaces_err == DB_SUCCESS - && sys_datafiles_err == DB_SUCCESS) { - srv_sys_tablespaces_open = true; - return(DB_SUCCESS); - } - - if (srv_read_only_mode - || srv_force_recovery >= SRV_FORCE_NO_TRX_UNDO) { - return(DB_READ_ONLY); - } - - trx = trx_create(); - - trx_set_dict_operation(trx, TRX_DICT_OP_TABLE); - - trx->op_info = "creating tablepace and datafile sys tables"; - - row_mysql_lock_data_dictionary(trx); - - /* Check which incomplete table definition to drop. */ - - if (sys_tablespaces_err == DB_CORRUPTION) { - row_drop_table_after_create_fail("SYS_TABLESPACES", trx); - } - - if (sys_datafiles_err == DB_CORRUPTION) { - row_drop_table_after_create_fail("SYS_DATAFILES", trx); - } - - ib::info() << "Creating tablespace and datafile system tables."; - - /* We always want SYSTEM tables to be created inside the system - tablespace. */ - srv_file_per_table_backup = srv_file_per_table; - srv_file_per_table = 0; - - err = que_eval_sql( - NULL, - "PROCEDURE CREATE_SYS_TABLESPACE_PROC () IS\n" - "BEGIN\n" - "CREATE TABLE SYS_TABLESPACES(\n" - " SPACE INT, NAME CHAR, FLAGS INT);\n" - "CREATE UNIQUE CLUSTERED INDEX SYS_TABLESPACES_SPACE" - " ON SYS_TABLESPACES (SPACE);\n" - "CREATE TABLE SYS_DATAFILES(\n" - " SPACE INT, PATH CHAR);\n" - "CREATE UNIQUE CLUSTERED INDEX SYS_DATAFILES_SPACE" - " ON SYS_DATAFILES (SPACE);\n" - "END;\n", - FALSE, trx); - - if (UNIV_UNLIKELY(err != DB_SUCCESS)) { - ib::error() << "Creation of SYS_TABLESPACES and SYS_DATAFILES" - " has failed with error " << err - << ". Dropping incompletely created tables."; - - ut_a(err == DB_OUT_OF_FILE_SPACE - || err == DB_DUPLICATE_KEY - || err == DB_TOO_MANY_CONCURRENT_TRXS); - - row_drop_table_after_create_fail("SYS_TABLESPACES", trx); - row_drop_table_after_create_fail("SYS_DATAFILES", trx); - - if (err == DB_OUT_OF_FILE_SPACE) { - err = DB_MUST_GET_MORE_FILE_SPACE; - } - } - - trx_commit_for_mysql(trx); - - row_mysql_unlock_data_dictionary(trx); - - trx->free(); - - srv_file_per_table = srv_file_per_table_backup; - - if (err == DB_SUCCESS) { - srv_sys_tablespaces_open = true; - } - - /* Note: The master thread has not been started at this point. */ - /* Confirm and move to the non-LRU part of the table LRU list. */ - - sys_tablespaces_err = dict_check_if_system_table_exists( - "SYS_TABLESPACES", DICT_NUM_FIELDS__SYS_TABLESPACES + 1, 1); - ut_a(sys_tablespaces_err == DB_SUCCESS || err != DB_SUCCESS); - - sys_datafiles_err = dict_check_if_system_table_exists( - "SYS_DATAFILES", DICT_NUM_FIELDS__SYS_DATAFILES + 1, 1); - ut_a(sys_datafiles_err == DB_SUCCESS || err != DB_SUCCESS); - - return(err); -} - -/** Put a tablespace definition into the data dictionary, -replacing what was there previously. -@param[in] space Tablespace id -@param[in] name Tablespace name -@param[in] flags Tablespace flags -@param[in] path Tablespace path -@param[in] trx Transaction -@return error code or DB_SUCCESS */ -dberr_t -dict_replace_tablespace_in_dictionary( - ulint space_id, - const char* name, - ulint flags, - const char* path, - trx_t* trx) -{ - if (!srv_sys_tablespaces_open) { - /* Startup procedure is not yet ready for updates. */ - return(DB_SUCCESS); - } - - dberr_t error; - - pars_info_t* info = pars_info_create(); - - pars_info_add_int4_literal(info, "space", space_id); - - pars_info_add_str_literal(info, "name", name); - - pars_info_add_int4_literal(info, "flags", flags); - - pars_info_add_str_literal(info, "path", path); - - error = que_eval_sql(info, - "PROCEDURE P () IS\n" - "p CHAR;\n" - - "DECLARE CURSOR c IS\n" - " SELECT PATH FROM SYS_DATAFILES\n" - " WHERE SPACE=:space FOR UPDATE;\n" - - "BEGIN\n" - "OPEN c;\n" - "FETCH c INTO p;\n" - - "IF (SQL % NOTFOUND) THEN" - " DELETE FROM SYS_TABLESPACES " - "WHERE SPACE=:space;\n" - " INSERT INTO SYS_TABLESPACES VALUES" - "(:space, :name, :flags);\n" - " INSERT INTO SYS_DATAFILES VALUES" - "(:space, :path);\n" - "ELSIF p <> :path THEN\n" - " UPDATE SYS_DATAFILES SET PATH=:path" - " WHERE CURRENT OF c;\n" - "END IF;\n" - "END;\n", - FALSE, trx); - - if (error != DB_SUCCESS) { - return(error); - } - - trx->op_info = ""; - - return(error); -} diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index ca4081e90e9..168636cc965 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -5268,87 +5268,3 @@ dict_tf_to_row_format_string( ut_error; return(0); } - -/** Look for any dictionary objects that are found in the given tablespace. -@param[in] space_id Tablespace ID to search for. -@return true if tablespace is empty. */ -bool -dict_space_is_empty( - ulint space_id) -{ - btr_pcur_t pcur; - const rec_t* rec; - mtr_t mtr; - bool found = false; - - dict_sys_lock(); - mtr_start(&mtr); - - for (rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES); - rec != NULL; - rec = dict_getnext_system(&pcur, &mtr)) { - const byte* field; - ulint len; - ulint space_id_for_table; - - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_TABLES__SPACE, &len); - ut_ad(len == 4); - space_id_for_table = mach_read_from_4(field); - - if (space_id_for_table == space_id) { - found = true; - } - } - - mtr_commit(&mtr); - dict_sys_unlock(); - - return(!found); -} - -/** Find the space_id for the given name in sys_tablespaces. -@param[in] name Tablespace name to search for. -@return the tablespace ID. */ -ulint -dict_space_get_id( - const char* name) -{ - btr_pcur_t pcur; - const rec_t* rec; - mtr_t mtr; - ulint name_len = strlen(name); - ulint id = ULINT_UNDEFINED; - - dict_sys_lock(); - mtr_start(&mtr); - - for (rec = dict_startscan_system(&pcur, &mtr, SYS_TABLESPACES); - rec != NULL; - rec = dict_getnext_system(&pcur, &mtr)) { - const byte* field; - ulint len; - - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_TABLESPACES__NAME, &len); - ut_ad(len > 0); - ut_ad(len < OS_FILE_MAX_PATH); - - if (len == name_len && !memcmp(name, field, len)) { - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_TABLESPACES__SPACE, &len); - ut_ad(len == 4); - id = mach_read_from_4(field); - - /* This is normally called by dict_getnext_system() - at the end of the index. */ - btr_pcur_close(&pcur); - break; - } - } - - mtr_commit(&mtr); - dict_sys_unlock(); - - return(id); -} diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 753bcf74967..8555c7849d6 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -54,8 +54,6 @@ static const char* SYSTEM_TABLE_NAME[] = { "SYS_FIELDS", "SYS_FOREIGN", "SYS_FOREIGN_COLS", - "SYS_TABLESPACES", - "SYS_DATAFILES", "SYS_VIRTUAL" }; @@ -662,307 +660,6 @@ err_len: return(NULL); } -/********************************************************************//** -This function parses a SYS_TABLESPACES record, extracts necessary -information from the record and returns to caller. -@return error message, or NULL on success */ -const char* -dict_process_sys_tablespaces( -/*=========================*/ - mem_heap_t* heap, /*!< in/out: heap memory */ - const rec_t* rec, /*!< in: current SYS_TABLESPACES rec */ - uint32_t* space, /*!< out: tablespace identifier */ - const char** name, /*!< out: tablespace name */ - ulint* flags) /*!< out: tablespace flags */ -{ - ulint len; - const byte* field; - - if (rec_get_deleted_flag(rec, 0)) { - return("delete-marked record in SYS_TABLESPACES"); - } - - if (rec_get_n_fields_old(rec) != DICT_NUM_FIELDS__SYS_TABLESPACES) { - return("wrong number of columns in SYS_TABLESPACES record"); - } - - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_TABLESPACES__SPACE, &len); - if (len != DICT_FLD_LEN_SPACE) { -err_len: - return("incorrect column length in SYS_TABLESPACES"); - } - *space = mach_read_from_4(field); - - rec_get_nth_field_offs_old( - rec, DICT_FLD__SYS_TABLESPACES__DB_TRX_ID, &len); - if (len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL) { - goto err_len; - } - - rec_get_nth_field_offs_old( - rec, DICT_FLD__SYS_TABLESPACES__DB_ROLL_PTR, &len); - if (len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL) { - goto err_len; - } - - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_TABLESPACES__NAME, &len); - if (len == 0 || len == UNIV_SQL_NULL) { - goto err_len; - } - *name = mem_heap_strdupl(heap, (char*) field, len); - - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_TABLESPACES__FLAGS, &len); - if (len != DICT_FLD_LEN_FLAGS) { - goto err_len; - } - *flags = mach_read_from_4(field); - - return(NULL); -} - -/********************************************************************//** -This function parses a SYS_DATAFILES record, extracts necessary -information from the record and returns it to the caller. -@return error message, or NULL on success */ -const char* -dict_process_sys_datafiles( -/*=======================*/ - mem_heap_t* heap, /*!< in/out: heap memory */ - const rec_t* rec, /*!< in: current SYS_DATAFILES rec */ - uint32_t* space, /*!< out: space id */ - const char** path) /*!< out: datafile paths */ -{ - ulint len; - const byte* field; - - if (rec_get_deleted_flag(rec, 0)) { - return("delete-marked record in SYS_DATAFILES"); - } - - if (rec_get_n_fields_old(rec) != DICT_NUM_FIELDS__SYS_DATAFILES) { - return("wrong number of columns in SYS_DATAFILES record"); - } - - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_DATAFILES__SPACE, &len); - if (len != DICT_FLD_LEN_SPACE) { -err_len: - return("incorrect column length in SYS_DATAFILES"); - } - *space = mach_read_from_4(field); - - rec_get_nth_field_offs_old( - rec, DICT_FLD__SYS_DATAFILES__DB_TRX_ID, &len); - if (len != DATA_TRX_ID_LEN && len != UNIV_SQL_NULL) { - goto err_len; - } - - rec_get_nth_field_offs_old( - rec, DICT_FLD__SYS_DATAFILES__DB_ROLL_PTR, &len); - if (len != DATA_ROLL_PTR_LEN && len != UNIV_SQL_NULL) { - goto err_len; - } - - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_DATAFILES__PATH, &len); - if (len == 0 || len == UNIV_SQL_NULL) { - goto err_len; - } - *path = mem_heap_strdupl(heap, (char*) field, len); - - return(NULL); -} - -/** Get the first filepath from SYS_DATAFILES for a given space_id. -@param[in] space_id Tablespace ID -@return First filepath (caller must invoke ut_free() on it) -@retval NULL if no SYS_DATAFILES entry was found. */ -static char* -dict_get_first_path( - ulint space_id) -{ - mtr_t mtr; - dict_table_t* sys_datafiles; - dict_index_t* sys_index; - dtuple_t* tuple; - dfield_t* dfield; - byte* buf; - btr_pcur_t pcur; - const rec_t* rec; - const byte* field; - ulint len; - char* filepath = NULL; - mem_heap_t* heap = mem_heap_create(1024); - - ut_ad(mutex_own(&dict_sys.mutex)); - - mtr_start(&mtr); - - sys_datafiles = dict_table_get_low("SYS_DATAFILES"); - sys_index = UT_LIST_GET_FIRST(sys_datafiles->indexes); - - ut_ad(!dict_table_is_comp(sys_datafiles)); - ut_ad(name_of_col_is(sys_datafiles, sys_index, - DICT_FLD__SYS_DATAFILES__SPACE, "SPACE")); - ut_ad(name_of_col_is(sys_datafiles, sys_index, - DICT_FLD__SYS_DATAFILES__PATH, "PATH")); - - tuple = dtuple_create(heap, 1); - dfield = dtuple_get_nth_field(tuple, DICT_FLD__SYS_DATAFILES__SPACE); - - buf = static_cast<byte*>(mem_heap_alloc(heap, 4)); - mach_write_to_4(buf, space_id); - - dfield_set_data(dfield, buf, 4); - dict_index_copy_types(tuple, sys_index, 1); - - btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE, - BTR_SEARCH_LEAF, &pcur, &mtr); - - rec = btr_pcur_get_rec(&pcur); - - /* Get the filepath from this SYS_DATAFILES record. */ - if (btr_pcur_is_on_user_rec(&pcur)) { - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_DATAFILES__SPACE, &len); - ut_a(len == 4); - - if (space_id == mach_read_from_4(field)) { - /* A record for this space ID was found. */ - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_DATAFILES__PATH, &len); - - ut_ad(len > 0); - ut_ad(len < OS_FILE_MAX_PATH); - - if (len > 0 && len < UNIV_SQL_NULL) { - filepath = mem_strdupl( - reinterpret_cast<const char*>(field), - len); - ut_ad(filepath != NULL); - - /* The dictionary may have been written on - another OS. */ - os_normalize_path(filepath); - } - } - } - - btr_pcur_close(&pcur); - mtr_commit(&mtr); - mem_heap_free(heap); - - return(filepath); -} - -/** Update the record for space_id in SYS_TABLESPACES to this filepath. -@param[in] space_id Tablespace ID -@param[in] filepath Tablespace filepath -@return DB_SUCCESS if OK, dberr_t if the insert failed */ -dberr_t -dict_update_filepath( - ulint space_id, - const char* filepath) -{ - if (!srv_sys_tablespaces_open) { - /* Startup procedure is not yet ready for updates. */ - return(DB_SUCCESS); - } - - dberr_t err = DB_SUCCESS; - trx_t* trx; - - ut_d(dict_sys.assert_locked()); - - trx = trx_create(); - trx->op_info = "update filepath"; - trx->dict_operation_lock_mode = RW_X_LATCH; - trx_start_for_ddl(trx, TRX_DICT_OP_INDEX); - - pars_info_t* info = pars_info_create(); - - pars_info_add_int4_literal(info, "space", space_id); - pars_info_add_str_literal(info, "path", filepath); - - err = que_eval_sql(info, - "PROCEDURE UPDATE_FILEPATH () IS\n" - "BEGIN\n" - "UPDATE SYS_DATAFILES" - " SET PATH = :path\n" - " WHERE SPACE = :space;\n" - "END;\n", FALSE, trx); - - trx_commit_for_mysql(trx); - trx->dict_operation_lock_mode = 0; - trx->free(); - - if (UNIV_LIKELY(err == DB_SUCCESS)) { - /* We just updated SYS_DATAFILES due to the contents in - a link file. Make a note that we did this. */ - ib::info() << "The InnoDB data dictionary table SYS_DATAFILES" - " for tablespace ID " << space_id - << " was updated to use file " << filepath << "."; - } else { - ib::warn() << "Error occurred while updating InnoDB data" - " dictionary table SYS_DATAFILES for tablespace ID " - << space_id << " to file " << filepath << ": " - << err << "."; - } - - return(err); -} - -/** Replace records in SYS_TABLESPACES and SYS_DATAFILES associated with -the given space_id using an independent transaction. -@param[in] space_id Tablespace ID -@param[in] name Tablespace name -@param[in] filepath First filepath -@param[in] fsp_flags Tablespace flags -@return DB_SUCCESS if OK, dberr_t if the insert failed */ -dberr_t -dict_replace_tablespace_and_filepath( - ulint space_id, - const char* name, - const char* filepath, - ulint fsp_flags) -{ - if (!srv_sys_tablespaces_open) { - /* Startup procedure is not yet ready for updates. - Return success since this will likely get updated - later. */ - return(DB_SUCCESS); - } - - dberr_t err = DB_SUCCESS; - trx_t* trx; - - DBUG_EXECUTE_IF("innodb_fail_to_update_tablespace_dict", - return(DB_INTERRUPTED);); - - ut_d(dict_sys.assert_locked()); - ut_ad(filepath); - - trx = trx_create(); - trx->op_info = "insert tablespace and filepath"; - trx->dict_operation_lock_mode = RW_X_LATCH; - trx_start_for_ddl(trx, TRX_DICT_OP_INDEX); - - /* A record for this space ID was not found in - SYS_DATAFILES. Assume the record is also missing in - SYS_TABLESPACES. Insert records into them both. */ - err = dict_replace_tablespace_in_dictionary( - space_id, name, fsp_flags, filepath, trx); - - trx_commit_for_mysql(trx); - trx->dict_operation_lock_mode = 0; - trx->free(); - - return(err); -} - /** Check the validity of a SYS_TABLES record Make sure the fields are the right length and that they do not contain invalid contents. @@ -1046,53 +743,6 @@ err_len: return(NULL); } -/** Read and return the contents of a SYS_TABLESPACES record. -@param[in] rec A record of SYS_TABLESPACES -@param[out] id Pointer to the space_id for this table -@param[in,out] name Buffer for Tablespace Name of length NAME_LEN -@param[out] flags Pointer to tablespace flags -@return true if the record was read correctly, false if not. */ -bool -dict_sys_tablespaces_rec_read( - const rec_t* rec, - ulint* id, - char* name, - ulint* flags) -{ - const byte* field; - ulint len; - - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_TABLESPACES__SPACE, &len); - if (len != DICT_FLD_LEN_SPACE) { - ib::error() << "Wrong field length in SYS_TABLESPACES.SPACE: " - << len; - return(false); - } - *id = mach_read_from_4(field); - - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_TABLESPACES__NAME, &len); - if (len == 0 || len == UNIV_SQL_NULL) { - ib::error() << "Wrong field length in SYS_TABLESPACES.NAME: " - << len; - return(false); - } - strncpy(name, reinterpret_cast<const char*>(field), NAME_LEN); - - /* read the 4 byte flags from the TYPE field */ - field = rec_get_nth_field_old( - rec, DICT_FLD__SYS_TABLESPACES__FLAGS, &len); - if (len != 4) { - ib::error() << "Wrong field length in SYS_TABLESPACES.FLAGS: " - << len; - return(false); - } - *flags = mach_read_from_4(field); - - return(true); -} - /** Check if SYS_TABLES.TYPE is valid @param[in] type SYS_TABLES.TYPE @param[in] not_redundant whether ROW_FORMAT=REDUNDANT is not used @@ -1343,15 +993,6 @@ static ulint dict_check_sys_tables() mtr_start(&mtr); - /* Before traversing SYS_TABLES, let's make sure we have - SYS_TABLESPACES and SYS_DATAFILES loaded. */ - dict_table_t* sys_tablespaces; - dict_table_t* sys_datafiles; - sys_tablespaces = dict_table_get_low("SYS_TABLESPACES"); - ut_a(sys_tablespaces != NULL); - sys_datafiles = dict_table_get_low("SYS_DATAFILES"); - ut_a(sys_datafiles != NULL); - for (rec = dict_startscan_system(&pcur, &mtr, SYS_TABLES); rec != NULL; mtr.commit(), mtr.start(), @@ -1411,34 +1052,17 @@ next: /* Now that we have the proper name for this tablespace, look to see if it is already in the tablespace cache. */ - if (const fil_space_t* space - = fil_space_for_table_exists_in_mem( + if (fil_space_for_table_exists_in_mem( space_id, table_name.m_name, flags)) { - /* Recovery can open a datafile that does not - match SYS_DATAFILES. If they don't match, update - SYS_DATAFILES. */ - char *dict_path = dict_get_first_path(space_id); - const char *fil_path = space->chain.start->name; - if (dict_path - && strcmp(dict_path, fil_path)) { - dict_update_filepath(space_id, fil_path); - } - ut_free(dict_path); - ut_free(table_name.m_name); continue; } - /* Set the expected filepath from the data dictionary. - If the file is found elsewhere (from an ISL or the default - location) or this path is the same file but looks different, - fil_ibd_open() will update the dictionary with what is - opened. */ - char* filepath = dict_get_first_path(space_id); + char* filepath = fil_make_filepath( + NULL, table_name.m_name, IBD, false); /* Check that the .ibd file exists. */ if (!fil_ibd_open( false, - !srv_read_only_mode && srv_log_file_size != 0, FIL_TYPE_TABLESPACE, space_id, dict_tf_to_fsp_flags(flags), table_name, filepath)) { @@ -1463,8 +1087,7 @@ Then look at each table defined in SYS_TABLES that has a space_id > 0 to find all the file-per-table tablespaces. In a crash recovery we already have some tablespace objects created from -processing the REDO log. Any other tablespace in SYS_TABLESPACES not -previously used in recovery will be opened here. We will compare the +processing the REDO log. We will compare the space_id information in the data dictionary to what we find in the tablespace file. In addition, more validation will be done if recovery was needed and force_recovery is not set. @@ -1487,9 +1110,7 @@ void dict_check_tablespaces_and_store_max_id() fil_set_max_space_id_if_bigger(max_space_id); - /* Open all tablespaces referenced in SYS_TABLES. - This will update SYS_TABLESPACES and SYS_DATAFILES if it - finds any file-per-table tablespaces not already there. */ + /* Open all tablespaces referenced in SYS_TABLES. */ max_space_id = dict_check_sys_tables(); fil_set_max_space_id_if_bigger(max_space_id); @@ -2674,8 +2295,7 @@ dict_save_data_dir_path( } } -/** Make sure the data_dir_path is saved in dict_table_t if DATA DIRECTORY -was used. Try to read it from the fil_system first, then from SYS_DATAFILES. +/** Make sure the data_dir_path is saved in dict_table_t if needed. @param[in] table Table object @param[in] dict_mutex_own true if dict_sys.mutex is owned already */ void @@ -2698,8 +2318,8 @@ dict_get_and_save_data_dir_path( if (table->data_dir_path == NULL) { /* Since we did not set the table data_dir_path, - unset the flag. This does not change SYS_DATAFILES - or SYS_TABLES or FSP_SPACE_FLAGS on the header page + unset the flag. This does not change + SYS_TABLES or FSP_SPACE_FLAGS on the header page of the tablespace, but it makes dict_table_t consistent. */ table->flags &= ~DICT_TF_MASK_DATA_DIR @@ -2800,8 +2420,7 @@ dict_load_tablespace( from the table->name. */ char* filepath = NULL; if (DICT_TF_HAS_DATA_DIR(table->flags)) { - /* This will set table->data_dir_path from either - fil_system or SYS_DATAFILES */ + /* This will set table->data_dir_path from fil_system */ dict_get_and_save_data_dir_path(table, true); if (table->data_dir_path) { @@ -2814,7 +2433,7 @@ dict_load_tablespace( /* Try to open the tablespace. We set the 2nd param (fix_dict) to false because we do not have an x-lock on dict_sys.latch */ table->space = fil_ibd_open( - true, false, FIL_TYPE_TABLESPACE, table->space_id, + true, FIL_TYPE_TABLESPACE, table->space_id, dict_tf_to_fsp_flags(table->flags), table->name, filepath); diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index c515cd82c48..ece334deeb4 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -2477,7 +2477,6 @@ If the fix_dict boolean is set, then it is safe to use an internal SQL statement to update the dictionary tables if they are incorrect. @param[in] validate true if we should validate the tablespace -@param[in] fix_dict true if the dictionary is available to be fixed @param[in] purpose FIL_TYPE_TABLESPACE or FIL_TYPE_TEMPORARY @param[in] id tablespace ID @param[in] flags expected FSP_SPACE_FLAGS @@ -2490,7 +2489,6 @@ If file-per-table, it is the table name in the databasename/tablename format fil_space_t* fil_ibd_open( bool validate, - bool fix_dict, fil_type_t purpose, ulint id, ulint flags, @@ -2522,21 +2520,11 @@ fil_ibd_open( } mutex_exit(&fil_system.mutex); - bool dict_filepath_same_as_default = false; - bool link_file_found = false; - bool link_file_is_bad = false; Datafile df_default; /* default location */ - Datafile df_dict; /* dictionary location */ RemoteDatafile df_remote; /* remote location */ ulint tablespaces_found = 0; ulint valid_tablespaces_found = 0; - if (fix_dict) { - ut_d(dict_sys.assert_locked()); - ut_ad(!srv_read_only_mode); - ut_ad(srv_log_file_size != 0); - } - /* Table flags can be ULINT_UNDEFINED if dict_tf_to_fsp_flags_failure is set. */ if (flags == ULINT_UNDEFINED) { @@ -2547,7 +2535,6 @@ corrupted: ut_ad(fil_space_t::is_valid_flags(flags & ~FSP_FLAGS_MEM_MASK, id)); df_default.init(tablename.m_name, flags); - df_dict.init(tablename.m_name, flags); df_remote.init(tablename.m_name, flags); /* Discover the correct file by looking in three possible locations @@ -2564,7 +2551,6 @@ corrupted: /* Always validate a file opened from an ISL pointer */ validate = true; ++tablespaces_found; - link_file_found = true; } else if (df_remote.filepath() != NULL) { /* An ISL file was found but contained a bad filepath in it. Better validate anything we do find. */ @@ -2573,17 +2559,10 @@ corrupted: /* Attempt to open the tablespace at the dictionary filepath. */ if (path_in) { - if (df_default.same_filepath_as(path_in)) { - dict_filepath_same_as_default = true; - } else { + if (!df_default.same_filepath_as(path_in)) { /* Dict path is not the default path. Always validate remote files. If default is opened, it was moved. */ validate = true; - df_dict.set_filepath(path_in); - if (df_dict.open_read_only(true) == DB_SUCCESS) { - ut_ad(df_dict.is_open()); - ++tablespaces_found; - } } } @@ -2604,14 +2583,6 @@ corrupted: df_remote.delete_link_file(); df_remote.close(); } - if (tablespaces_found > 1 && df_default.same_as(df_dict)) { - --tablespaces_found; - df_dict.close(); - } - if (tablespaces_found > 1 && df_remote.same_as(df_dict)) { - --tablespaces_found; - df_dict.close(); - } /* We have now checked all possible tablespace locations and have a count of how many unique files we found. If things are @@ -2630,9 +2601,6 @@ corrupted: valid_tablespaces_found += (df_default.validate_to_dd(id, flags) == DB_SUCCESS); - valid_tablespaces_found += - (df_dict.validate_to_dd(id, flags) == DB_SUCCESS); - /* Make sense of these three possible locations. First, bail out if no tablespace files were found. */ if (valid_tablespaces_found == 0) { @@ -2663,12 +2631,6 @@ corrupted: << ", Space ID=" << df_remote.space_id() << ", Flags=" << df_remote.flags(); } - if (df_dict.is_open()) { - ib::error() << "Dictionary location: " - << df_dict.filepath() - << ", Space ID=" << df_dict.space_id() - << ", Flags=" << df_dict.flags(); - } /* Force-recovery will allow some tablespaces to be skipped by REDO if there was more than one file found. @@ -2683,13 +2645,11 @@ corrupted: /* If the file is not open it cannot be valid. */ ut_ad(df_default.is_open() || !df_default.is_valid()); - ut_ad(df_dict.is_open() || !df_dict.is_valid()); ut_ad(df_remote.is_open() || !df_remote.is_valid()); /* Having established that, this is an easy way to look for corrupted data files. */ if (df_default.is_open() != df_default.is_valid() - || df_dict.is_open() != df_dict.is_valid() || df_remote.is_open() != df_remote.is_valid()) { goto corrupted; } @@ -2706,17 +2666,9 @@ error: tablespaces_found--; } - if (df_dict.is_open() && !df_dict.is_valid()) { - df_dict.close(); - /* Leave dict.filepath so that SYS_DATAFILES - can be corrected below. */ - tablespaces_found--; - } - if (df_remote.is_open() && !df_remote.is_valid()) { df_remote.close(); tablespaces_found--; - link_file_is_bad = true; } } @@ -2724,78 +2676,9 @@ error: ut_a(tablespaces_found == 1); ut_a(valid_tablespaces_found == 1); - /* Only fix the dictionary at startup when there is only one thread. - Calls to dict_load_table() can be done while holding other latches. */ - if (!fix_dict) { - goto skip_validate; - } - - /* We may need to update what is stored in SYS_DATAFILES or - SYS_TABLESPACES or adjust the link file. Since a failure to - update SYS_TABLESPACES or SYS_DATAFILES does not prevent opening - and using the tablespace either this time or the next, we do not - check the return code or fail to open the tablespace. But if it - fails, dict_update_filepath() will issue a warning to the log. */ - if (df_dict.filepath()) { - ut_ad(path_in != NULL); - ut_ad(df_dict.same_filepath_as(path_in)); - - if (df_remote.is_open()) { - if (!df_remote.same_filepath_as(path_in)) { - dict_update_filepath(id, df_remote.filepath()); - } - - } else if (df_default.is_open()) { - ut_ad(!dict_filepath_same_as_default); - dict_update_filepath(id, df_default.filepath()); - if (link_file_is_bad) { - RemoteDatafile::delete_link_file( - tablename.m_name); - } - - } else if (!link_file_found || link_file_is_bad) { - ut_ad(df_dict.is_open()); - /* Fix the link file if we got our filepath - from the dictionary but a link file did not - exist or it did not point to a valid file. */ - RemoteDatafile::delete_link_file(tablename.m_name); - RemoteDatafile::create_link_file( - tablename.m_name, df_dict.filepath()); - } - - } else if (df_remote.is_open()) { - if (dict_filepath_same_as_default) { - dict_update_filepath(id, df_remote.filepath()); - - } else if (path_in == NULL) { - /* SYS_DATAFILES record for this space ID - was not found. */ - dict_replace_tablespace_and_filepath( - id, tablename.m_name, - df_remote.filepath(), flags); - } - - } else if (df_default.is_open()) { - /* We opened the tablespace in the default location. - SYS_DATAFILES.PATH needs to be updated if it is different - from this default path or if the SYS_DATAFILES.PATH was not - supplied and it should have been. Also update the dictionary - if we found an ISL file (since !df_remote.is_open). Since - path_in is not suppled for file-per-table, we must assume - that it matched the ISL. */ - if ((path_in != NULL && !dict_filepath_same_as_default) - || (path_in == NULL && DICT_TF_HAS_DATA_DIR(flags)) - || df_remote.filepath() != NULL) { - dict_replace_tablespace_and_filepath( - id, tablename.m_name, df_default.filepath(), - flags); - } - } - skip_validate: const byte* first_page = df_default.is_open() ? df_default.get_first_page() : - df_dict.is_open() ? df_dict.get_first_page() : df_remote.get_first_page(); fil_space_crypt_t* crypt_data = first_page @@ -2814,12 +2697,10 @@ skip_validate: space->add( df_remote.is_open() ? df_remote.filepath() : - df_dict.is_open() ? df_dict.filepath() : df_default.filepath(), OS_FILE_CLOSED, 0, false, true); if (validate && !srv_read_only_mode) { df_remote.close(); - df_dict.close(); df_default.close(); if (space->acquire()) { if (purpose != FIL_TYPE_IMPORT) { diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index cf9d1a73500..32437810adb 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -10909,7 +10909,6 @@ ha_innobase::update_create_info( return; } - /* Update the DATA DIRECTORY name from SYS_DATAFILES. */ dict_get_and_save_data_dir_path(m_prebuilt->table, false); if (m_prebuilt->table->data_dir_path) { @@ -19749,7 +19748,6 @@ i_s_innodb_sys_fields, i_s_innodb_sys_foreign, i_s_innodb_sys_foreign_cols, i_s_innodb_sys_tablespaces, -i_s_innodb_sys_datafiles, i_s_innodb_sys_virtual, i_s_innodb_mutexes, i_s_innodb_sys_semaphore_waits, diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index ecc0905de56..af51dd7c043 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -6475,8 +6475,8 @@ static ST_FIELD_INFO innodb_sys_tablespaces_fields_info[] = #define SYS_TABLESPACES_PAGE_SIZE 4 Column("PAGE_SIZE", ULong(), NOT_NULL), -#define SYS_TABLESPACES_ZIP_PAGE_SIZE 5 - Column("ZIP_PAGE_SIZE", ULong(), NOT_NULL), +#define SYS_TABLESPACES_FILENAME 5 + Column("FILENAME", Varchar(FN_REFLEN), NOT_NULL), #define SYS_TABLESPACES_FS_BLOCK_SIZE 6 Column("FS_BLOCK_SIZE", ULong(),NOT_NULL), @@ -6491,189 +6491,106 @@ static ST_FIELD_INFO innodb_sys_tablespaces_fields_info[] = }; } // namespace Show -/**********************************************************************//** -Function to fill INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES with information -collected by scanning SYS_TABLESPACESS table. +/** Produce one row of INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES. +@param thd connection +@param s tablespace +@param t output table @return 0 on success */ -static -int -i_s_dict_fill_sys_tablespaces( -/*==========================*/ - THD* thd, /*!< in: thread */ - uint32_t space, /*!< in: space ID */ - const char* name, /*!< in: tablespace name */ - ulint flags, /*!< in: tablespace flags */ - TABLE* table_to_fill) /*!< in/out: fill this table */ -{ - Field** fields; - ulint atomic_blobs = FSP_FLAGS_HAS_ATOMIC_BLOBS(flags); - const char* row_format; - - DBUG_ENTER("i_s_dict_fill_sys_tablespaces"); - - if (fil_space_t::full_crc32(flags)) { - row_format = NULL; - } else if (is_system_tablespace(space)) { - row_format = "Compact, Redundant or Dynamic"; - } else if (FSP_FLAGS_GET_ZIP_SSIZE(flags)) { - row_format = "Compressed"; - } else if (atomic_blobs) { - row_format = "Dynamic"; - } else { - row_format = "Compact or Redundant"; - } - - fields = table_to_fill->field; - - OK(fields[SYS_TABLESPACES_SPACE]->store(space, true)); - - OK(field_store_string(fields[SYS_TABLESPACES_NAME], name)); - - OK(fields[SYS_TABLESPACES_FLAGS]->store(flags, true)); - - OK(field_store_string(fields[SYS_TABLESPACES_ROW_FORMAT], row_format)); - - ulint cflags = fil_space_t::is_valid_flags(flags, space) - ? flags : fsp_flags_convert_from_101(flags); - if (cflags == ULINT_UNDEFINED) { - fields[SYS_TABLESPACES_PAGE_SIZE]->set_null(); - fields[SYS_TABLESPACES_ZIP_PAGE_SIZE]->set_null(); - fields[SYS_TABLESPACES_FS_BLOCK_SIZE]->set_null(); - fields[SYS_TABLESPACES_FILE_SIZE]->set_null(); - fields[SYS_TABLESPACES_ALLOC_SIZE]->set_null(); - OK(schema_table_store_record(thd, table_to_fill)); - DBUG_RETURN(0); - } - - OK(fields[SYS_TABLESPACES_PAGE_SIZE]->store( - fil_space_t::logical_size(cflags), true)); - - OK(fields[SYS_TABLESPACES_ZIP_PAGE_SIZE]->store( - fil_space_t::physical_size(cflags), true)); - - os_file_stat_t stat; - os_file_size_t file; - - memset(&file, 0xff, sizeof(file)); - memset(&stat, 0x0, sizeof(stat)); - - if (fil_space_t* s = fil_space_t::get(space)) { - const char *filepath = s->chain.start - ? s->chain.start->name : NULL; - if (!filepath) { - goto file_done; - } - - file = os_file_get_size(filepath); - - /* Get the file system (or Volume) block size. */ - switch (dberr_t err = os_file_get_status(filepath, &stat, - false, false)) { - case DB_FAIL: - ib::warn() - << "File '" << filepath << "', failed to get " - << "stats"; - break; - - case DB_SUCCESS: - case DB_NOT_FOUND: - break; - - default: - ib::error() << "File '" << filepath << "' " << err; - break; - } - -file_done: - s->release(); - } - - if (file.m_total_size == os_offset_t(~0)) { - stat.block_size = 0; - file.m_total_size = 0; - file.m_alloc_size = 0; - } - - OK(fields[SYS_TABLESPACES_FS_BLOCK_SIZE]->store(stat.block_size, true)); - - OK(fields[SYS_TABLESPACES_FILE_SIZE]->store(file.m_total_size, true)); - - OK(fields[SYS_TABLESPACES_ALLOC_SIZE]->store(file.m_alloc_size, true)); - - OK(schema_table_store_record(thd, table_to_fill)); - - DBUG_RETURN(0); +static int i_s_sys_tablespaces_fill(THD *thd, const fil_space_t &s, TABLE *t) +{ + DBUG_ENTER("i_s_sys_tablespaces_fill"); + const char *row_format; + + if (s.full_crc32() || is_system_tablespace(s.id)) + row_format= nullptr; + else if (FSP_FLAGS_GET_ZIP_SSIZE(s.flags)) + row_format= "Compressed"; + else if (FSP_FLAGS_HAS_ATOMIC_BLOBS(s.flags)) + row_format= "Dynamic"; + else + row_format= "Compact or Redundant"; + + Field **fields= t->field; + + OK(fields[SYS_TABLESPACES_SPACE]->store(s.id, true)); + OK(field_store_string(fields[SYS_TABLESPACES_NAME], s.name)); + OK(fields[SYS_TABLESPACES_FLAGS]->store(s.flags, true)); + OK(field_store_string(fields[SYS_TABLESPACES_ROW_FORMAT], row_format)); + const char *filepath= s.chain.start->name; + OK(field_store_string(fields[SYS_TABLESPACES_FILENAME], filepath)); + + OK(fields[SYS_TABLESPACES_PAGE_SIZE]->store(s.physical_size(), true)); + os_file_stat_t stat; + stat.block_size= 0; + os_file_size_t file= os_file_get_size(filepath); + if (file.m_total_size == os_offset_t(~0)) + { + file.m_total_size= 0; + file.m_alloc_size= 0; + } + else + { + /* Get the file system (or Volume) block size. */ + switch (dberr_t err= os_file_get_status(filepath, &stat, false, false)) { + case DB_FAIL: + ib::warn() << "File '" << filepath << "', failed to get stats"; + break; + case DB_SUCCESS: + case DB_NOT_FOUND: + break; + default: + ib::error() << "File '" << filepath << "' " << err; + break; + } + } + + OK(fields[SYS_TABLESPACES_FS_BLOCK_SIZE]->store(stat.block_size, true)); + OK(fields[SYS_TABLESPACES_FILE_SIZE]->store(file.m_total_size, true)); + OK(fields[SYS_TABLESPACES_ALLOC_SIZE]->store(file.m_alloc_size, true)); + + OK(schema_table_store_record(thd, t)); + + DBUG_RETURN(0); } -/*******************************************************************//** -Function to populate INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES table. -Loop through each record in SYS_TABLESPACES, and extract the column -information and fill the INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES table. +/** Populate INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES. +@param thd connection +@param tables table to fill @return 0 on success */ -static -int -i_s_sys_tablespaces_fill_table( -/*===========================*/ - THD* thd, /*!< in: thread */ - TABLE_LIST* tables, /*!< in/out: tables to fill */ - Item* ) /*!< in: condition (not used) */ -{ - btr_pcur_t pcur; - const rec_t* rec; - mem_heap_t* heap; - mtr_t mtr; - - DBUG_ENTER("i_s_sys_tablespaces_fill_table"); - RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name.str); - - /* deny access to user without PROCESS_ACL privilege */ - if (check_global_access(thd, PROCESS_ACL)) { - DBUG_RETURN(0); - } - - heap = mem_heap_create(1000); - mutex_enter(&dict_sys.mutex); - mtr_start(&mtr); - - for (rec = dict_startscan_system(&pcur, &mtr, SYS_TABLESPACES); - rec != NULL; - rec = dict_getnext_system(&pcur, &mtr)) { - - const char* err_msg; - uint32_t space; - const char* name; - ulint flags; - - /* Extract necessary information from a SYS_TABLESPACES row */ - err_msg = dict_process_sys_tablespaces( - heap, rec, &space, &name, &flags); - - mtr_commit(&mtr); - mutex_exit(&dict_sys.mutex); - - if (!err_msg) { - i_s_dict_fill_sys_tablespaces( - thd, space, name, flags, - tables->table); - } else { - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_CANT_FIND_SYSTEM_REC, "%s", - err_msg); - } - - mem_heap_empty(heap); - - /* Get the next record */ - mutex_enter(&dict_sys.mutex); - mtr_start(&mtr); - } - - mtr_commit(&mtr); - mutex_exit(&dict_sys.mutex); - mem_heap_free(heap); - - DBUG_RETURN(0); +static int i_s_sys_tablespaces_fill_table(THD *thd, TABLE_LIST *tables, Item*) +{ + DBUG_ENTER("i_s_sys_tablespaces_fill_table"); + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name.str); + + if (check_global_access(thd, PROCESS_ACL)) + DBUG_RETURN(0); + + int err= 0; + + mutex_enter(&fil_system.mutex); + fil_system.freeze_space_list++; + + for (fil_space_t *space= UT_LIST_GET_FIRST(fil_system.space_list); + space; space= UT_LIST_GET_NEXT(space_list, space)) + { + if (space->purpose == FIL_TYPE_TABLESPACE && !space->is_stopping() && + space->chain.start) + { + space->reacquire(); + mutex_exit(&fil_system.mutex); + err= i_s_sys_tablespaces_fill(thd, *space, tables->table); + mutex_enter(&fil_system.mutex); + space->release(); + if (err) + break; + } + } + + fil_system.freeze_space_list--; + mutex_exit(&fil_system.mutex); + DBUG_RETURN(err); } + /*******************************************************************//** Bind the dynamic table INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES @return 0 on success */ @@ -6715,7 +6632,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablespaces = /* general descriptive text (for SHOW PLUGINS) */ /* const char* */ - STRUCT_FLD(descr, "InnoDB SYS_TABLESPACES"), + STRUCT_FLD(descr, "InnoDB tablespaces"), /* the plugin license (PLUGIN_LICENSE_XXX) */ /* int */ @@ -6745,185 +6662,6 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_tablespaces = }; namespace Show { -/** SYS_DATAFILES ************************************************/ -/* Fields of the dynamic table INFORMATION_SCHEMA.INNODB_SYS_DATAFILES */ -static ST_FIELD_INFO innodb_sys_datafiles_fields_info[] = -{ -#define SYS_DATAFILES_SPACE 0 - Column("SPACE", ULong(), NOT_NULL), - -#define SYS_DATAFILES_PATH 1 - Column("PATH", Varchar(OS_FILE_MAX_PATH), NOT_NULL), - - CEnd() -}; -} // namespace Show - -/**********************************************************************//** -Function to fill INFORMATION_SCHEMA.INNODB_SYS_DATAFILES with information -collected by scanning SYS_DATAFILESS table. -@return 0 on success */ -static -int -i_s_dict_fill_sys_datafiles( -/*========================*/ - THD* thd, /*!< in: thread */ - uint32_t space, /*!< in: space ID */ - const char* path, /*!< in: absolute path */ - TABLE* table_to_fill) /*!< in/out: fill this table */ -{ - Field** fields; - - DBUG_ENTER("i_s_dict_fill_sys_datafiles"); - - fields = table_to_fill->field; - - OK(fields[SYS_DATAFILES_SPACE]->store(space, true)); - - OK(field_store_string(fields[SYS_DATAFILES_PATH], path)); - - OK(schema_table_store_record(thd, table_to_fill)); - - DBUG_RETURN(0); -} -/*******************************************************************//** -Function to populate INFORMATION_SCHEMA.INNODB_SYS_DATAFILES table. -Loop through each record in SYS_DATAFILES, and extract the column -information and fill the INFORMATION_SCHEMA.INNODB_SYS_DATAFILES table. -@return 0 on success */ -static -int -i_s_sys_datafiles_fill_table( -/*=========================*/ - THD* thd, /*!< in: thread */ - TABLE_LIST* tables, /*!< in/out: tables to fill */ - Item* ) /*!< in: condition (not used) */ -{ - btr_pcur_t pcur; - const rec_t* rec; - mem_heap_t* heap; - mtr_t mtr; - - DBUG_ENTER("i_s_sys_datafiles_fill_table"); - RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name.str); - - /* deny access to user without PROCESS_ACL privilege */ - if (check_global_access(thd, PROCESS_ACL)) { - DBUG_RETURN(0); - } - - heap = mem_heap_create(1000); - mutex_enter(&dict_sys.mutex); - mtr_start(&mtr); - - rec = dict_startscan_system(&pcur, &mtr, SYS_DATAFILES); - - while (rec) { - const char* err_msg; - uint32_t space; - const char* path; - - /* Extract necessary information from a SYS_DATAFILES row */ - err_msg = dict_process_sys_datafiles( - heap, rec, &space, &path); - - mtr_commit(&mtr); - mutex_exit(&dict_sys.mutex); - - if (!err_msg) { - i_s_dict_fill_sys_datafiles( - thd, space, path, tables->table); - } else { - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_CANT_FIND_SYSTEM_REC, "%s", - err_msg); - } - - mem_heap_empty(heap); - - /* Get the next record */ - mutex_enter(&dict_sys.mutex); - mtr_start(&mtr); - rec = dict_getnext_system(&pcur, &mtr); - } - - mtr_commit(&mtr); - mutex_exit(&dict_sys.mutex); - mem_heap_free(heap); - - DBUG_RETURN(0); -} -/*******************************************************************//** -Bind the dynamic table INFORMATION_SCHEMA.INNODB_SYS_DATAFILES -@return 0 on success */ -static -int -innodb_sys_datafiles_init( -/*======================*/ - void* p) /*!< in/out: table schema object */ -{ - ST_SCHEMA_TABLE* schema; - - DBUG_ENTER("innodb_sys_datafiles_init"); - - schema = (ST_SCHEMA_TABLE*) p; - - schema->fields_info = Show::innodb_sys_datafiles_fields_info; - schema->fill_table = i_s_sys_datafiles_fill_table; - - DBUG_RETURN(0); -} - -UNIV_INTERN struct st_maria_plugin i_s_innodb_sys_datafiles = -{ - /* the plugin type (a MYSQL_XXX_PLUGIN value) */ - /* int */ - STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN), - - /* pointer to type-specific plugin descriptor */ - /* void* */ - STRUCT_FLD(info, &i_s_info), - - /* plugin name */ - /* const char* */ - STRUCT_FLD(name, "INNODB_SYS_DATAFILES"), - - /* plugin author (for SHOW PLUGINS) */ - /* const char* */ - STRUCT_FLD(author, plugin_author), - - /* general descriptive text (for SHOW PLUGINS) */ - /* const char* */ - STRUCT_FLD(descr, "InnoDB SYS_DATAFILES"), - - /* the plugin license (PLUGIN_LICENSE_XXX) */ - /* int */ - STRUCT_FLD(license, PLUGIN_LICENSE_GPL), - - /* the function to invoke when plugin is loaded */ - /* int (*)(void*); */ - STRUCT_FLD(init, innodb_sys_datafiles_init), - - /* the function to invoke when plugin is unloaded */ - /* int (*)(void*); */ - STRUCT_FLD(deinit, i_s_common_deinit), - - /* plugin version (for SHOW PLUGINS) */ - /* unsigned int */ - STRUCT_FLD(version, INNODB_VERSION_SHORT), - - /* struct st_mysql_show_var* */ - STRUCT_FLD(status_vars, NULL), - - /* struct st_mysql_sys_var** */ - STRUCT_FLD(system_vars, NULL), - - /* Maria extension */ - STRUCT_FLD(version_info, INNODB_VERSION_STR), - STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE), -}; - -namespace Show { /** TABLESPACES_ENCRYPTION ********************************************/ /* Fields of the table INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION */ static ST_FIELD_INFO innodb_tablespaces_encryption_fields_info[] = @@ -6963,8 +6701,7 @@ static ST_FIELD_INFO innodb_tablespaces_encryption_fields_info[] = } // namespace Show /**********************************************************************//** -Function to fill INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION -with information collected by scanning SYS_TABLESPACES table. +Function to fill INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION. @param[in] thd thread handle @param[in] space Tablespace @param[in] table_to_fill I_S table to fill @@ -7289,7 +7026,7 @@ UNIV_INTERN struct st_maria_plugin i_s_innodb_mutexes = /* general descriptive text (for SHOW PLUGINS) */ /* const char* */ - STRUCT_FLD(descr, "InnoDB SYS_DATAFILES"), + STRUCT_FLD(descr, "Information on InnoDB rw-locks"), /* the plugin license (PLUGIN_LICENSE_XXX) */ /* int */ diff --git a/storage/innobase/handler/i_s.h b/storage/innobase/handler/i_s.h index 385c249d9d5..d5fb8247311 100644 --- a/storage/innobase/handler/i_s.h +++ b/storage/innobase/handler/i_s.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2019, MariaDB Corporation. +Copyright (c) 2014, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -59,7 +59,6 @@ extern struct st_maria_plugin i_s_innodb_sys_fields; extern struct st_maria_plugin i_s_innodb_sys_foreign; extern struct st_maria_plugin i_s_innodb_sys_foreign_cols; extern struct st_maria_plugin i_s_innodb_sys_tablespaces; -extern struct st_maria_plugin i_s_innodb_sys_datafiles; extern struct st_maria_plugin i_s_innodb_mutexes; extern struct st_maria_plugin i_s_innodb_sys_virtual; extern struct st_maria_plugin i_s_innodb_tablespaces_encryption; diff --git a/storage/innobase/include/dict0boot.h b/storage/innobase/include/dict0boot.h index 0f96df8fd9f..857342b18bd 100644 --- a/storage/innobase/include/dict0boot.h +++ b/storage/innobase/include/dict0boot.h @@ -267,37 +267,6 @@ enum dict_fld_sys_foreign_cols_enum { DICT_FLD__SYS_FOREIGN_COLS__REF_COL_NAME = 5, DICT_NUM_FIELDS__SYS_FOREIGN_COLS = 6 }; -/* The columns in SYS_TABLESPACES */ -enum dict_col_sys_tablespaces_enum { - DICT_COL__SYS_TABLESPACES__SPACE = 0, - DICT_COL__SYS_TABLESPACES__NAME = 1, - DICT_COL__SYS_TABLESPACES__FLAGS = 2, - DICT_NUM_COLS__SYS_TABLESPACES = 3 -}; -/* The field numbers in the SYS_TABLESPACES clustered index */ -enum dict_fld_sys_tablespaces_enum { - DICT_FLD__SYS_TABLESPACES__SPACE = 0, - DICT_FLD__SYS_TABLESPACES__DB_TRX_ID = 1, - DICT_FLD__SYS_TABLESPACES__DB_ROLL_PTR = 2, - DICT_FLD__SYS_TABLESPACES__NAME = 3, - DICT_FLD__SYS_TABLESPACES__FLAGS = 4, - DICT_NUM_FIELDS__SYS_TABLESPACES = 5 -}; -/* The columns in SYS_DATAFILES */ -enum dict_col_sys_datafiles_enum { - DICT_COL__SYS_DATAFILES__SPACE = 0, - DICT_COL__SYS_DATAFILES__PATH = 1, - DICT_NUM_COLS__SYS_DATAFILES = 2 -}; -/* The field numbers in the SYS_DATAFILES clustered index */ -enum dict_fld_sys_datafiles_enum { - DICT_FLD__SYS_DATAFILES__SPACE = 0, - DICT_FLD__SYS_DATAFILES__DB_TRX_ID = 1, - DICT_FLD__SYS_DATAFILES__DB_ROLL_PTR = 2, - DICT_FLD__SYS_DATAFILES__PATH = 3, - DICT_NUM_FIELDS__SYS_DATAFILES = 4 -}; - /* The columns in SYS_VIRTUAL */ enum dict_col_sys_virtual_enum { DICT_COL__SYS_VIRTUAL__TABLE_ID = 0, diff --git a/storage/innobase/include/dict0crea.h b/storage/innobase/include/dict0crea.h index 13706d6bfad..72108614f14 100644 --- a/storage/innobase/include/dict0crea.h +++ b/storage/innobase/include/dict0crea.h @@ -167,14 +167,6 @@ dict_foreigns_has_s_base_col( const dict_foreign_set& local_fk_set, const dict_table_t* table); -/****************************************************************//** -Creates the tablespaces and datafiles system tables inside InnoDB -at server bootstrap or server start if they are not found or are -not of the right form. -@return DB_SUCCESS or error code */ -dberr_t -dict_create_or_check_sys_tablespace(void); -/*=====================================*/ /** Creates the virtual column system tables inside InnoDB at server bootstrap or server start if they are not found or are not of the right form. @@ -182,22 +174,6 @@ not of the right form. dberr_t dict_create_or_check_sys_virtual(); -/** Put a tablespace definition into the data dictionary, -replacing what was there previously. -@param[in] space Tablespace id -@param[in] name Tablespace name -@param[in] flags Tablespace flags -@param[in] path Tablespace path -@param[in] trx Transaction -@return error code or DB_SUCCESS */ -dberr_t -dict_replace_tablespace_in_dictionary( - ulint space_id, - const char* name, - ulint flags, - const char* path, - trx_t* trx); - /********************************************************************//** Add a foreign key definition to the data dictionary tables. @return error code or DB_SUCCESS */ diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 276252e625c..9667ad7a731 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -1803,20 +1803,6 @@ dict_table_decode_n_col( ulint* n_col, ulint* n_v_col); -/** Look for any dictionary objects that are found in the given tablespace. -@param[in] space_id Tablespace ID to search for. -@return true if tablespace is empty. */ -bool -dict_space_is_empty( - ulint space_id); - -/** Find the space_id for the given name in sys_tablespaces. -@param[in] name Tablespace name to search for. -@return the tablespace ID. */ -ulint -dict_space_get_id( - const char* name); - /** Free the virtual column template @param[in,out] vc_templ virtual column template */ UNIV_INLINE diff --git a/storage/innobase/include/dict0load.h b/storage/innobase/include/dict0load.h index f067571ca5b..1a777c7d1a0 100644 --- a/storage/innobase/include/dict0load.h +++ b/storage/innobase/include/dict0load.h @@ -47,8 +47,6 @@ enum dict_system_id_t { SYS_FIELDS, SYS_FOREIGN, SYS_FOREIGN_COLS, - SYS_TABLESPACES, - SYS_DATAFILES, SYS_VIRTUAL, /* This must be last item. Defines the number of system tables. */ @@ -56,13 +54,11 @@ enum dict_system_id_t { }; /** Check each tablespace found in the data dictionary. -Look at each table defined in SYS_TABLES that has a space_id > 0. -If the tablespace is not yet in the fil_system cache, look up the -tablespace in SYS_DATAFILES to ensure the correct path. +Then look at each table defined in SYS_TABLES that has a space_id > 0 +to find all the file-per-table tablespaces. In a crash recovery we already have some tablespace objects created from -processing the REDO log. Any other tablespace in SYS_TABLESPACES not -previously used in recovery will be opened here. We will compare the +processing the REDO log. We will compare the space_id information in the data dictionary to what we find in the tablespace file. In addition, more validation will be done if recovery was needed and force_recovery is not set. @@ -80,7 +76,6 @@ dict_get_first_table_name_in_db( const char* name); /*!< in: database name which ends to '/' */ /** Make sure the data_file_name is saved in dict_table_t if needed. -Try to read it from the fil_system first, then from SYS_DATAFILES. @param[in] table Table object @param[in] dict_mutex_own true if dict_sys.mutex is owned already */ void @@ -259,51 +254,5 @@ dict_process_sys_foreign_col_rec( const char** ref_col_name, /*!< out: referenced column name in referenced table */ ulint* pos); /*!< out: column position */ -/********************************************************************//** -This function parses a SYS_TABLESPACES record, extracts necessary -information from the record and returns to caller. -@return error message, or NULL on success */ -const char* -dict_process_sys_tablespaces( -/*=========================*/ - mem_heap_t* heap, /*!< in/out: heap memory */ - const rec_t* rec, /*!< in: current SYS_TABLESPACES rec */ - uint32_t* space, /*!< out: tablespace identifier */ - const char** name, /*!< out: tablespace name */ - ulint* flags); /*!< out: tablespace flags */ -/********************************************************************//** -This function parses a SYS_DATAFILES record, extracts necessary -information from the record and returns to caller. -@return error message, or NULL on success */ -const char* -dict_process_sys_datafiles( -/*=======================*/ - mem_heap_t* heap, /*!< in/out: heap memory */ - const rec_t* rec, /*!< in: current SYS_DATAFILES rec */ - uint32_t* space, /*!< out: tablespace identifier */ - const char** path); /*!< out: datafile path */ - -/** Update the record for space_id in SYS_TABLESPACES to this filepath. -@param[in] space_id Tablespace ID -@param[in] filepath Tablespace filepath -@return DB_SUCCESS if OK, dberr_t if the insert failed */ -dberr_t -dict_update_filepath( - ulint space_id, - const char* filepath); - -/** Replace records in SYS_TABLESPACES and SYS_DATAFILES associated with -the given space_id using an independent transaction. -@param[in] space_id Tablespace ID -@param[in] name Tablespace name -@param[in] filepath First filepath -@param[in] fsp_flags Tablespace flags -@return DB_SUCCESS if OK, dberr_t if the insert failed */ -dberr_t -dict_replace_tablespace_and_filepath( - ulint space_id, - const char* name, - const char* filepath, - ulint fsp_flags); #endif diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index e645ce31232..e5424aca038 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -1624,7 +1624,6 @@ If the fix_dict boolean is set, then it is safe to use an internal SQL statement to update the dictionary tables if they are incorrect. @param[in] validate true if we should validate the tablespace -@param[in] fix_dict true if the dictionary is available to be fixed @param[in] purpose FIL_TYPE_TABLESPACE or FIL_TYPE_TEMPORARY @param[in] id tablespace ID @param[in] flags expected FSP_SPACE_FLAGS @@ -1637,7 +1636,6 @@ If file-per-table, it is the table name in the databasename/tablename format fil_space_t* fil_ibd_open( bool validate, - bool fix_dict, fil_type_t purpose, ulint id, ulint flags, diff --git a/storage/innobase/include/srv0start.h b/storage/innobase/include/srv0start.h index 324e3f0478d..9033cd916c3 100644 --- a/storage/innobase/include/srv0start.h +++ b/storage/innobase/include/srv0start.h @@ -96,8 +96,6 @@ extern lsn_t srv_shutdown_lsn; /** TRUE if the server is being started */ extern bool srv_is_being_started; -/** TRUE if SYS_TABLESPACES is available for lookups */ -extern bool srv_sys_tablespaces_open; /** TRUE if the server is being started, before rolling back any incomplete transactions */ extern bool srv_startup_is_before_trx_rollback_phase; diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 8376fbb4ba6..36f821e0e9b 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -4038,6 +4038,8 @@ row_import_for_mysql( Find the space ID in SYS_TABLES since this is an ALTER TABLE. */ dict_get_and_save_data_dir_path(table, true); + ut_ad(!DICT_TF_HAS_DATA_DIR(table->flags) || table->data_dir_path); + if (DICT_TF_HAS_DATA_DIR(table->flags)) { ut_a(table->data_dir_path); @@ -4069,7 +4071,7 @@ row_import_for_mysql( ulint fsp_flags = dict_tf_to_fsp_flags(table->flags); table->space = fil_ibd_open( - true, true, FIL_TYPE_IMPORT, table->space_id, + true, FIL_TYPE_IMPORT, table->space_id, fsp_flags, table->name, filepath, &err); ut_ad((table->space == NULL) == (err != DB_SUCCESS)); diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 33aa578873f..1558f0a9064 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2363,21 +2363,6 @@ err_exit: err = trx->error_state; - /* Update SYS_TABLESPACES and SYS_DATAFILES if a new file-per-table - tablespace was created. */ - if (err == DB_SUCCESS && dict_table_is_file_per_table(table)) { - err = dict_replace_tablespace_in_dictionary( - table->space_id, table->name.m_name, - table->space->flags, - table->space->chain.start->name, trx); - - if (err != DB_SUCCESS) { - - /* We must delete the link file. */ - RemoteDatafile::delete_link_file(table->name.m_name); - } - } - switch (err) { case DB_SUCCESS: break; @@ -3653,23 +3638,6 @@ do_drop: "DELETE FROM SYS_TABLES WHERE NAME=:name;\n" "END;\n", FALSE, trx) : err; - - if (err == DB_SUCCESS && table->space - && dict_table_get_low("SYS_TABLESPACES") - && dict_table_get_low("SYS_DATAFILES")) { - info = pars_info_create(); - pars_info_add_int4_literal(info, "id", - lint(table->space_id)); - err = que_eval_sql( - info, - "PROCEDURE DROP_SPACE_PROC () IS\n" - "BEGIN\n" - "DELETE FROM SYS_TABLESPACES\n" - "WHERE SPACE = :id;\n" - "DELETE FROM SYS_DATAFILES\n" - "WHERE SPACE = :id;\n" - "END;\n", FALSE, trx); - } } switch (err) { @@ -4285,38 +4253,6 @@ row_rename_table_for_mysql( "END;\n" , FALSE, trx); - /* SYS_TABLESPACES and SYS_DATAFILES need to be updated if - the table is in a single-table tablespace. */ - if (err != DB_SUCCESS || !dict_table_is_file_per_table(table)) { - } else if (table->space) { - /* If old path and new path are the same means tablename - has not changed and only the database name holding the table - has changed so we need to make the complete filepath again. */ - char* new_path = dict_tables_have_same_db(old_name, new_name) - ? os_file_make_new_pathname( - table->space->chain.start->name, new_name) - : fil_make_filepath(NULL, new_name, IBD, false); - - info = pars_info_create(); - - pars_info_add_str_literal(info, "new_table_name", new_name); - pars_info_add_str_literal(info, "new_path_name", new_path); - pars_info_add_int4_literal(info, "space_id", table->space_id); - - err = que_eval_sql(info, - "PROCEDURE RENAME_SPACE () IS\n" - "BEGIN\n" - "UPDATE SYS_TABLESPACES" - " SET NAME = :new_table_name\n" - " WHERE SPACE = :space_id;\n" - "UPDATE SYS_DATAFILES" - " SET PATH = :new_path_name\n" - " WHERE SPACE = :space_id;\n" - "END;\n" - , FALSE, trx); - - ut_free(new_path); - } if (err != DB_SUCCESS) { goto end; } diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index b53c7888509..718732f139c 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -121,8 +121,6 @@ incomplete transactions */ bool srv_startup_is_before_trx_rollback_phase; /** TRUE if the server is being started */ bool srv_is_being_started; -/** TRUE if SYS_TABLESPACES is available for lookups */ -bool srv_sys_tablespaces_open; /** TRUE if the server was successfully started */ bool srv_was_started; /** The original value of srv_log_file_size (innodb_log_file_size) */ @@ -1768,17 +1766,7 @@ file_checked: trx_rollback_recovered(false); } - /* FIXME: Skip the following if srv_read_only_mode, - while avoiding "Allocated tablespace ID" warnings. */ if (srv_force_recovery <= SRV_FORCE_NO_IBUF_MERGE) { - /* Open or Create SYS_TABLESPACES and SYS_DATAFILES - so that tablespace names and other metadata can be - found. */ - err = dict_create_or_check_sys_tablespace(); - if (err != DB_SUCCESS) { - return(srv_init_abort(err)); - } - /* The following call is necessary for the insert buffer to work with multiple tablespaces. We must know the mapping between space id's and .ibd file @@ -1848,10 +1836,7 @@ skip_monitors: /* Create the SYS_FOREIGN and SYS_FOREIGN_COLS system tables */ err = dict_create_or_check_foreign_constraint_tables(); if (err == DB_SUCCESS) { - err = dict_create_or_check_sys_tablespace(); - if (err == DB_SUCCESS) { - err = dict_create_or_check_sys_virtual(); - } + err = dict_create_or_check_sys_virtual(); } switch (err) { case DB_SUCCESS: diff --git a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result index ac6e2bcc633..37a53036b62 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result @@ -321,6 +321,4 @@ ID FOR_NAME REF_NAME N_COLS TYPE SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; ID FOR_COL_NAME REF_COL_NAME POS SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES; -SPACE NAME FLAG ROW_FORMAT PAGE_SIZE ZIP_PAGE_SIZE FS_BLOCK_SIZE FILE_SIZE ALLOCATED_SIZE -SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES; -SPACE PATH +SPACE NAME FLAG ROW_FORMAT PAGE_SIZE FILENAME FS_BLOCK_SIZE FILE_SIZE ALLOCATED_SIZE diff --git a/storage/rocksdb/mysql-test/rocksdb/t/innodb_i_s_tables_disabled-master.opt b/storage/rocksdb/mysql-test/rocksdb/t/innodb_i_s_tables_disabled-master.opt index b3565b5fa82..5e9d95e0bf0 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/innodb_i_s_tables_disabled-master.opt +++ b/storage/rocksdb/mysql-test/rocksdb/t/innodb_i_s_tables_disabled-master.opt @@ -1,5 +1,4 @@ --loose-enable-innodb_trx ---loose-enable-innodb_file_status --loose-enable-innodb_locks --loose-enable-innodb_lock_waits --loose-enable-innodb_cmp @@ -26,5 +25,3 @@ --loose-enable-innodb_sys_foreign --loose-enable-innodb_sys_foreign_cols --loose-enable-innodb_sys_tablespaces ---loose-enable-innodb_sys_datafiles ---loose-enable-innodb_sys_docstore_fields diff --git a/storage/rocksdb/mysql-test/rocksdb/t/innodb_i_s_tables_disabled.test b/storage/rocksdb/mysql-test/rocksdb/t/innodb_i_s_tables_disabled.test index 4ff48e13089..524b37a7127 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/innodb_i_s_tables_disabled.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/innodb_i_s_tables_disabled.test @@ -9,8 +9,6 @@ --disable_warnings SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX; -#Not in MariaDB: SELECT * FROM INFORMATION_SCHEMA.INNODB_FILE_STATUS; - SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS; SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS; SELECT * FROM INFORMATION_SCHEMA.INNODB_CMP; @@ -37,7 +35,5 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FIELDS; SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN; SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN_COLS; SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES; -SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_DATAFILES; -#Not in MariaDB: SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_DOCSTORE_FIELDS; --enable_warnings |