mirror of
https://github.com/MariaDB/server.git
synced 2025-09-11 05:52:26 +03:00
A consistency check for fil_space_t::name is causing recovery failures
in MDEV-25180 (Atomic ALTER TABLE). So, we'd better remove that field
altogether.
fil_space_t::name was more or less a copy of dict_table_t::name
(except for some special cases), and it was not being used for
anything useful.
There used to be a name_hash, but it had been removed already in
commit a75dbfd718
(MDEV-12266).
We will also remove os_normalize_path(), OS_PATH_SEPARATOR,
OS_PATH_SEPATOR_ALT. On Microsoft Windows, we will treat \ and /
roughly in the same way. The intention is that for per-table
tablespaces, the filenames will always follow the pattern
prefix/databasename/tablename.ibd. (Any \ in the prefix must not
be converted.)
ut_basename_noext(): Remove (unused function).
read_link_file(): Replaces RemoteDatafile::read_link_file().
We will ensure that the last two path component separators are
forward slashes (converting up to 2 trailing backslashes on
Microsoft Windows), so that everywhere else we can
assume that data file names end in "/databasename/tablename.ibd".
Note: On Microsoft Windows, path names that start with \\?\ must
not contain / as path component separators. Previously, such paths
did work in the DATA DIRECTORY argument of InnoDB tables.
Reviewed by: Vladislav Vaintroub
309 lines
11 KiB
Plaintext
309 lines
11 KiB
Plaintext
# Testcase for the following bugs
|
|
# Bug#16691130 - ASSERT WHEN INNODB_LOG_GROUP_HOME_DIR DOES NOT EXIST
|
|
# Bug#16418661 - CHANGING NAME IN FOR INNODB_DATA_FILE_PATH SHOULD NOT SUCCEED WITH LOG FILES
|
|
# Start mysqld without the possibility to create innodb_undo_tablespaces
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
FOUND 1 /\[ERROR\] InnoDB: Could not create undo tablespace '.*undo002'/ in mysqld.1.err
|
|
# Remove undo001,undo002,ibdata1,ibdata2,ib_logfile101
|
|
# Start mysqld with non existent innodb_log_group_home_dir
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend --innodb_log_group_home_dir=/path/to/non-existent/
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
FOUND 1 /File .path.to.non-existent.*ib_logfile101: 'create' returned OS error \d+/ in mysqld.1.err
|
|
# Remove ibdata1 & ibdata2
|
|
# Successfully let InnoDB create tablespaces
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine='innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
1
|
|
1
|
|
# Backup tmp/logfile/*
|
|
# 1. With ibdata2, Without ibdata1
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
FOUND 1 /The data file '.*ibdata1' was not found but one of the other data files '.*ibdata2' exists/ in mysqld.1.err
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
ibdata2
|
|
undo001
|
|
undo002
|
|
undo003
|
|
# 2. With ibdata1, without ibdata2
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
FOUND 1 /InnoDB: Tablespace size stored in header is \d+ pages, but the sum of data file sizes is \d+ pages/ in mysqld.1.err
|
|
FOUND 1 /InnoDB: Cannot start InnoDB. The tail of the system tablespace is missing/ in mysqld.1.err
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
ibdata1
|
|
ibdata2
|
|
undo001
|
|
undo002
|
|
undo003
|
|
# 3. Without ibdata1 & ibdata2
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
undo001
|
|
undo002
|
|
undo003
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
FOUND 1 /InnoDB: undo tablespace .*undo001.* exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\./ in mysqld.1.err
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
undo001
|
|
undo002
|
|
undo003
|
|
# 4. Without ibdata*, ib_logfile* and with undo00*
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
undo001
|
|
undo002
|
|
undo003
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
undo001
|
|
undo002
|
|
undo003
|
|
# 5. Without ibdata*,ib_logfile* files & Without undo002
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
undo001
|
|
undo003
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
undo001
|
|
undo003
|
|
# 6. Without ibdata*,ib_logfile* files & Without undo001, undo002
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
undo003
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
FOUND 1 /undo tablespace .*undo003.* exists\. Creating system tablespace with existing undo tablespaces is not supported\. Please delete all undo tablespaces before creating new system tablespace\./ in mysqld.1.err
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
undo003
|
|
# 7. With ibdata files & Without undo002
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
ibdata1
|
|
ibdata2
|
|
undo001
|
|
undo003
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
FOUND 1 /InnoDB: Expected to open innodb_undo_tablespaces=3 but was able to find only 1/ in mysqld.1.err
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
ibdata1
|
|
ibdata2
|
|
undo001
|
|
undo003
|
|
# 8. With ibdata files & Without undo001, undo002
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
ibdata1
|
|
ibdata2
|
|
undo003
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
FOUND 1 /InnoDB: Expected to open innodb_undo_tablespaces=3 but was able to find only 0/ in mysqld.1.err
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
ibdata1
|
|
ibdata2
|
|
undo003
|
|
# 9. Without ibdata*, without undo*
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
FOUND 1 /redo log file .*ib_logfile0.* exists\. Creating system tablespace with existing redo log file is not recommended\. Please delete redo log file before creating new system tablespace\./ in mysqld.1.err
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
# 10. With ibdata*, without ib_logfile0
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine = 'innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
|
InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
ibdata1
|
|
ibdata2
|
|
undo001
|
|
undo002
|
|
undo003
|
|
# 11. With ibdata*
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
ibdata1
|
|
ibdata2
|
|
undo001
|
|
undo002
|
|
undo003
|
|
# restart: --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_file --innodb-undo-logs=20 --innodb-undo-tablespaces=3 --innodb-data-file-path=ibdata1:16M;ibdata2:10M:autoextend
|
|
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES
|
|
WHERE engine='innodb'
|
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
|
1
|
|
1
|
|
NOT FOUND /Resizing redo log from 1\*\d+ to 3\*\d+ bytes; LSN=\d+/ in mysqld.1.err
|
|
# restart
|
|
# Cleanup
|
|
bak_ib_logfile0
|
|
bak_ibdata1
|
|
bak_ibdata2
|
|
bak_undo001
|
|
bak_undo002
|
|
bak_undo003
|
|
ib_buffer_pool
|
|
ib_logfile0
|
|
ibdata1
|
|
ibdata2
|
|
undo001
|
|
undo002
|
|
undo003
|