mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
Merge 10.6 into 10.11
This commit is contained in:
commit
a54d151fc1
129 changed files with 1398 additions and 1726 deletions
|
@ -657,7 +657,6 @@ error:
|
|||
pthread_cond_signal(&count_threshhold);
|
||||
pthread_mutex_unlock(&counter_mutex);
|
||||
mysql_thread_end();
|
||||
pthread_exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -990,7 +990,6 @@ end_thread:
|
|||
cn->mysql= 0;
|
||||
cn->query_done= 1;
|
||||
mysql_thread_end();
|
||||
pthread_exit(0);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -915,13 +915,15 @@ datafiles_iter_next(datafiles_iter_t *it)
|
|||
fil_system.space_list.begin() :
|
||||
std::next(it->space);
|
||||
|
||||
while (it->space != fil_system.space_list.end() &&
|
||||
(it->space->purpose != FIL_TYPE_TABLESPACE ||
|
||||
UT_LIST_GET_LEN(it->space->chain) == 0))
|
||||
while (it->space != fil_system.space_list.end()
|
||||
&& UT_LIST_GET_LEN(it->space->chain) == 0)
|
||||
++it->space;
|
||||
if (it->space == fil_system.space_list.end())
|
||||
goto end;
|
||||
|
||||
ut_ad(!it->space->is_temporary());
|
||||
ut_ad(!it->space->is_being_imported());
|
||||
|
||||
it->node = UT_LIST_GET_FIRST(it->space->chain);
|
||||
|
||||
end:
|
||||
|
@ -1113,7 +1115,8 @@ static void backup_file_op(uint32_t space_id, int type,
|
|||
std::string space_name = filename_to_spacename(name, len);
|
||||
ddl_tracker.id_to_name[space_id] = space_name;
|
||||
ddl_tracker.delete_defer(space_id, space_name);
|
||||
msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
|
||||
msg("DDL tracking : create %" PRIu32 " \"%.*s\"",
|
||||
space_id, int(len), name);
|
||||
}
|
||||
break;
|
||||
case FILE_MODIFY:
|
||||
|
@ -1129,7 +1132,7 @@ static void backup_file_op(uint32_t space_id, int type,
|
|||
ddl_tracker.id_to_name[space_id] = new_space_name;
|
||||
ddl_tracker.rename_defer(space_id, old_space_name,
|
||||
new_space_name);
|
||||
msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
|
||||
msg("DDL tracking : rename %" PRIu32 " \"%.*s\",\"%.*s\"",
|
||||
space_id, int(len), name, int(new_len), new_name);
|
||||
}
|
||||
break;
|
||||
|
@ -1137,7 +1140,8 @@ static void backup_file_op(uint32_t space_id, int type,
|
|||
ddl_tracker.drops.insert(space_id);
|
||||
ddl_tracker.delete_defer(
|
||||
space_id, filename_to_spacename(name, len));
|
||||
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
|
||||
msg("DDL tracking : delete %" PRIu32 " \"%.*s\"",
|
||||
space_id, int(len), name);
|
||||
break;
|
||||
default:
|
||||
ut_ad(0);
|
||||
|
@ -1188,13 +1192,14 @@ static void backup_file_op_fail(uint32_t space_id, int type,
|
|||
const std::string spacename{filename_to_spacename(name, len)};
|
||||
switch (type) {
|
||||
case FILE_CREATE:
|
||||
msg("DDL tracking : create %u \"%.*s\"", space_id, int(len), name);
|
||||
msg("DDL tracking : create %" PRIu32 " \"%.*s\"",
|
||||
space_id, int(len), name);
|
||||
fail = !check_if_skip_table(spacename.c_str());
|
||||
break;
|
||||
case FILE_MODIFY:
|
||||
break;
|
||||
case FILE_RENAME:
|
||||
msg("DDL tracking : rename %u \"%.*s\",\"%.*s\"",
|
||||
msg("DDL tracking : rename %" PRIu32 " \"%.*s\",\"%.*s\"",
|
||||
space_id, int(len), name, int(new_len), new_name);
|
||||
fail = !check_if_skip_table(spacename.c_str())
|
||||
|| !check_if_skip_table(
|
||||
|
@ -1203,7 +1208,8 @@ static void backup_file_op_fail(uint32_t space_id, int type,
|
|||
case FILE_DELETE:
|
||||
fail = !check_if_skip_table(spacename.c_str())
|
||||
&& !check_if_fts_table(spacename.c_str());
|
||||
msg("DDL tracking : delete %u \"%.*s\"", space_id, int(len), name);
|
||||
msg("DDL tracking : delete %" PRIu32 " \"%.*s\"",
|
||||
space_id, int(len), name);
|
||||
break;
|
||||
default:
|
||||
ut_ad(0);
|
||||
|
@ -1224,7 +1230,7 @@ static void backup_undo_trunc(uint32_t space_id)
|
|||
|
||||
/* Function to store the space id of page0 INIT_PAGE
|
||||
@param space_id space id which has page0 init page */
|
||||
static void backup_first_page_op(space_id_t space_id)
|
||||
static void backup_first_page_op(uint32_t space_id)
|
||||
{
|
||||
first_page_init_ids.insert(space_id);
|
||||
}
|
||||
|
@ -3934,8 +3940,8 @@ static void xb_load_single_table_tablespace(const char *dirname,
|
|||
if (err == DB_SUCCESS && file->space_id() != SRV_TMP_SPACE_ID) {
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
space = fil_space_t::create(
|
||||
file->space_id(), file->flags(),
|
||||
FIL_TYPE_TABLESPACE, nullptr/* TODO: crypt_data */,
|
||||
uint32_t(file->space_id()), file->flags(), false,
|
||||
nullptr/* TODO: crypt_data */,
|
||||
FIL_ENCRYPTION_DEFAULT,
|
||||
file->handle() != OS_FILE_CLOSED);
|
||||
ut_ad(space);
|
||||
|
@ -5670,8 +5676,8 @@ void CorruptedPages::backup_fix_ddl(ds_ctxt *ds_data, ds_ctxt *ds_meta)
|
|||
iter != ddl_tracker.tables_in_backup.end();
|
||||
iter++) {
|
||||
|
||||
const std::string name = iter->second;
|
||||
uint32_t id = iter->first;
|
||||
const std::string &name = iter->second;
|
||||
|
||||
if (ddl_tracker.drops.find(id) != ddl_tracker.drops.end()) {
|
||||
dropped_tables.insert(name);
|
||||
|
@ -5698,7 +5704,7 @@ void CorruptedPages::backup_fix_ddl(ds_ctxt *ds_data, ds_ctxt *ds_meta)
|
|||
iter++) {
|
||||
|
||||
uint32_t id = iter->first;
|
||||
std::string name = iter->second;
|
||||
const std::string &name = iter->second;
|
||||
|
||||
if (ddl_tracker.tables_in_backup.find(id) != ddl_tracker.tables_in_backup.end()) {
|
||||
/* already processed above */
|
||||
|
@ -5995,8 +6001,8 @@ exit:
|
|||
|
||||
char tmpname[FN_REFLEN];
|
||||
|
||||
snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#%u",
|
||||
dbname, fil_space->id);
|
||||
snprintf(tmpname, FN_REFLEN, "%s/xtrabackup_tmp_#%"
|
||||
PRIu32, dbname, fil_space->id);
|
||||
|
||||
msg("mariabackup: Renaming %s to %s.ibd",
|
||||
fil_space->chain.start->name, tmpname);
|
||||
|
@ -6051,8 +6057,8 @@ exit:
|
|||
ut_ad(fil_space_t::physical_size(flags) == info.page_size);
|
||||
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
fil_space_t* space = fil_space_t::create(info.space_id, flags,
|
||||
FIL_TYPE_TABLESPACE, 0,
|
||||
fil_space_t* space = fil_space_t::create(uint32_t(info.space_id),
|
||||
flags, false, 0,
|
||||
FIL_ENCRYPTION_DEFAULT, true);
|
||||
mysql_mutex_unlock(&fil_system.mutex);
|
||||
if (space) {
|
||||
|
|
|
@ -78,5 +78,7 @@
|
|||
{ "HA_ERR_ABORTED_BY_USER", HA_ERR_ABORTED_BY_USER, "" },
|
||||
{ "HA_ERR_DISK_FULL", HA_ERR_DISK_FULL, "" },
|
||||
{ "HA_ERR_INCOMPATIBLE_DEFINITION", HA_ERR_INCOMPATIBLE_DEFINITION, "" },
|
||||
{ "HA_ERR_NO_ENCRYPTION", HA_ERR_NO_ENCRYPTION, "" },
|
||||
{ "HA_ERR_COMMIT_ERROR", HA_ERR_COMMIT_ERROR, "" },
|
||||
{ "HA_ERR_PARTITION_LIST", HA_ERR_PARTITION_LIST, ""},
|
||||
{ "HA_ERR_NO_ENCRYPTION", HA_ERR_NO_ENCRYPTION, ""},
|
||||
{ "HA_ERR_ROLLBACK", HA_ERR_ROLLBACK, "" },
|
||||
|
|
|
@ -535,7 +535,8 @@ enum ha_base_keytype {
|
|||
#define HA_ERR_COMMIT_ERROR 197
|
||||
#define HA_ERR_PARTITION_LIST 198
|
||||
#define HA_ERR_NO_ENCRYPTION 199
|
||||
#define HA_ERR_LAST 199 /* Copy of last error nr * */
|
||||
#define HA_ERR_ROLLBACK 200 /* Automatic rollback done */
|
||||
#define HA_ERR_LAST 200 /* Copy of last error nr * */
|
||||
|
||||
/* Number of different errors */
|
||||
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
|
||||
|
|
|
@ -110,7 +110,8 @@ static const char *handler_error_messages[]=
|
|||
"Sequence values are conflicting",
|
||||
"Error during commit",
|
||||
"Cannot select partitions",
|
||||
"Cannot initialize encryption. Check that all encryption parameters have been set"
|
||||
"Cannot initialize encryption. Check that all encryption parameters have been set",
|
||||
"Transaction was aborted",
|
||||
};
|
||||
|
||||
#endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */
|
||||
|
|
|
@ -257,9 +257,9 @@ extern void (*my_sigtstp_cleanup)(void),
|
|||
/* Executed before jump to shell */
|
||||
(*my_sigtstp_restart)(void);
|
||||
/* Executed when coming from shell */
|
||||
extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation mask */
|
||||
extern int my_umask_dir,
|
||||
my_recived_signals, /* Signals we have got */
|
||||
extern MYSQL_PLUGIN_IMPORT mode_t my_umask; /* Default creation mask */
|
||||
extern mode_t my_umask_dir;
|
||||
extern int my_recived_signals, /* Signals we have got */
|
||||
my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
|
||||
my_dont_interrupt; /* call remember_intr when set */
|
||||
#ifdef _WIN32
|
||||
|
@ -625,7 +625,7 @@ extern File my_open(const char *FileName,int Flags,myf MyFlags);
|
|||
extern File my_register_filename(File fd, const char *FileName,
|
||||
enum file_type type_of_file,
|
||||
uint error_message_number, myf MyFlags);
|
||||
extern File my_create(const char *FileName,int CreateFlags,
|
||||
extern File my_create(const char *FileName, mode_t CreateFlags,
|
||||
int AccessFlags, myf MyFlags);
|
||||
extern int my_close(File Filedes,myf MyFlags);
|
||||
extern int my_mkdir(const char *dir, int Flags, myf MyFlags);
|
||||
|
@ -633,7 +633,7 @@ extern int my_readlink(char *to, const char *filename, myf MyFlags);
|
|||
extern int my_is_symlink(const char *filename);
|
||||
extern int my_realpath(char *to, const char *filename, myf MyFlags);
|
||||
extern File my_create_with_symlink(const char *linkname, const char *filename,
|
||||
int createflags, int access_flags,
|
||||
mode_t createflags, int access_flags,
|
||||
myf MyFlags);
|
||||
extern int my_rename_with_symlink(const char *from,const char *to,myf MyFlags);
|
||||
extern int my_symlink(const char *content, const char *linkname, myf MyFlags);
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
# Bug #24200: Provide backwards compatibility mode for 4.x "rollback on
|
||||
# transaction timeout"
|
||||
#
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
-- source include/have_innodb.inc
|
||||
-- source include/not_binlog_format_row.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # Bug #39022: Mysql randomly crashing in lock_sec_rec_cons_read_sees
|
||||
--echo #
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
--source include/have_metadata_lock_info.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
# Save the initial number of concurrent sessions.
|
||||
--source include/count_sessions.inc
|
||||
|
||||
|
|
|
@ -212,6 +212,23 @@ use `a
|
|||
b`;
|
||||
SET timestamp=1234567890;
|
||||
select count(*) from mysql.global_priv where length(priv)>2
|
||||
#
|
||||
# MDEV-31366 Assertion `thd->start_time' failed in bool LOGGER::slow_log_print(THD*, const char*, size_t, ulonglong)
|
||||
#
|
||||
TRUNCATE mysql.slow_log;
|
||||
SET global log_output='TABLE';
|
||||
SET timestamp=0.99;
|
||||
SET long_query_time=0.00001;
|
||||
SELECT SLEEP(0.1);
|
||||
SLEEP(0.1)
|
||||
0
|
||||
SELECT COUNT(*)>0 AS c1 FROM mysql.slow_log;
|
||||
c1
|
||||
1
|
||||
SET global log_output=default;
|
||||
SET timestamp=default;
|
||||
SET long_query_time=default;
|
||||
TRUNCATE mysql.slow_log;
|
||||
# End of 10.5 tests
|
||||
#
|
||||
# MDEV-34251 Conditional jump or move depends on uninitialised value in
|
||||
|
|
|
@ -225,6 +225,21 @@ let SEARCH_PATTERN= use \`a\n.*2;
|
|||
let SEARCH_OUTPUT=matches;
|
||||
source include/search_pattern_in_file.inc;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-31366 Assertion `thd->start_time' failed in bool LOGGER::slow_log_print(THD*, const char*, size_t, ulonglong)
|
||||
--echo #
|
||||
|
||||
TRUNCATE mysql.slow_log;
|
||||
SET global log_output='TABLE';
|
||||
SET timestamp=0.99;
|
||||
SET long_query_time=0.00001;
|
||||
SELECT SLEEP(0.1);
|
||||
SELECT COUNT(*)>0 AS c1 FROM mysql.slow_log;
|
||||
SET global log_output=default;
|
||||
SET timestamp=default;
|
||||
SET long_query_time=default;
|
||||
TRUNCATE mysql.slow_log;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
--echo #
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
--source include/have_partition.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-18707 Server crash in my_hash_sort_bin, ASAN heap-use-after-free in Field::is_null, server hang, corrupted double-linked list
|
||||
--echo #
|
||||
|
|
|
@ -5,6 +5,9 @@ let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
|||
|
||||
call mtr.add_suppression("InnoDB: Table .* does not exist in the InnoDB internal data dictionary .*");
|
||||
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # Bug#11766879/Bug#60106: DIFF BETWEEN # OF INDEXES IN MYSQL VS INNODB,
|
||||
|
|
|
@ -2037,7 +2037,7 @@ SUCCESS
|
|||
execute stmt;
|
||||
Warnings:
|
||||
Note 1050 Table 't2' already exists
|
||||
call p_verify_reprepare_count(1);
|
||||
call p_verify_reprepare_count(0);
|
||||
SUCCESS
|
||||
|
||||
select * from t2;
|
||||
|
|
|
@ -1686,7 +1686,7 @@ drop table t2;
|
|||
execute stmt;
|
||||
call p_verify_reprepare_count(0);
|
||||
execute stmt;
|
||||
call p_verify_reprepare_count(1);
|
||||
call p_verify_reprepare_count(0);
|
||||
select * from t2;
|
||||
execute stmt;
|
||||
call p_verify_reprepare_count(0);
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
--source include/have_sequence.inc
|
||||
--source include/innodb_stable_estimates.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
SET SESSION DEFAULT_STORAGE_ENGINE='InnoDB';
|
||||
|
||||
SET @save_stats_persistent=@@GLOBAL.innodb_stats_persistent;
|
||||
|
|
|
@ -2,13 +2,16 @@
|
|||
# WL#1756
|
||||
#
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--source include/not_embedded.inc
|
||||
|
||||
# Save the initial number of concurrent sessions
|
||||
--source include/count_sessions.inc
|
||||
|
||||
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
|
|
|
@ -10,6 +10,5 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
galera_sequences : MDEV-32561 WSREP FSM failure: no such a transition REPLICATING -> COMMITTED
|
||||
galera_as_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback()
|
||||
galera_slave_replay : MDEV-32780 galera_as_slave_replay: assertion in the wsrep::transaction::before_rollback()
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
connection node_2;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
CREATE TABLE t1(a int not null primary key auto_increment,b int) engine=InnoDB;
|
||||
insert into t1 values (NULL,1);
|
||||
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
|
||||
connection node_2a;
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
begin;
|
||||
update t1 set a = 5;
|
||||
connection node_2;
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
connection node_2;
|
||||
connection node_1;
|
||||
connection node_2;
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
call mtr.add_suppression("WSREP: Trying to continue unpaused monitor");
|
||||
connection node_1;
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
call mtr.add_suppression("WSREP: Trying to continue unpaused monitor");
|
||||
CREATE TABLE t1 ENGINE=InnoDB select 1 as a, 1 as b union select 2, 2;
|
||||
ALTER TABLE t1 add primary key(a);
|
||||
|
|
|
@ -314,3 +314,14 @@ NEXTVAL(t)
|
|||
connection node_1;
|
||||
DROP TABLE t1;
|
||||
DROP SEQUENCE t;
|
||||
|
||||
MDEV-33245 SIGSEGV in wsrep_check_sequence | Sql_cmd_alter_sequence::execute
|
||||
|
||||
CREATE TABLE t (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES (0);
|
||||
CREATE TABLE t1 (c VARCHAR) ENGINE=InnoDB;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ENGINE=InnoDB' at line 1
|
||||
ALTER SEQUENCE IF EXISTS t MINVALUE=1;
|
||||
ERROR 42000: This version of MariaDB doesn't yet support 'CACHE without INCREMENT BY 0 in Galera cluster'
|
||||
DROP TABLE t;
|
||||
End of 10.5 tests
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
#
|
||||
|
||||
--connection node_2
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
CREATE TABLE t1(a int not null primary key auto_increment,b int) engine=InnoDB;
|
||||
insert into t1 values (NULL,1);
|
||||
|
||||
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
|
||||
--connection node_2a
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
begin;
|
||||
update t1 set a = 5;
|
||||
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
--source include/big_test.inc
|
||||
|
||||
--connection node_2
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
call mtr.add_suppression("WSREP: Trying to continue unpaused monitor");
|
||||
|
||||
--connection node_1
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
call mtr.add_suppression("WSREP: Trying to continue unpaused monitor");
|
||||
|
||||
CREATE TABLE t1 ENGINE=InnoDB select 1 as a, 1 as b union select 2, 2;
|
||||
|
|
|
@ -341,3 +341,18 @@ SELECT NEXTVAL(t);
|
|||
--connection node_1
|
||||
DROP TABLE t1;
|
||||
DROP SEQUENCE t;
|
||||
|
||||
--echo
|
||||
--echo MDEV-33245 SIGSEGV in wsrep_check_sequence | Sql_cmd_alter_sequence::execute
|
||||
--echo
|
||||
|
||||
CREATE TABLE t (a INT) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES (0);
|
||||
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE TABLE t1 (c VARCHAR) ENGINE=InnoDB;
|
||||
--error ER_NOT_SUPPORTED_YET
|
||||
ALTER SEQUENCE IF EXISTS t MINVALUE=1;
|
||||
|
||||
DROP TABLE t;
|
||||
--echo End of 10.5 tests
|
||||
|
|
|
@ -456,7 +456,7 @@ restore: t1 .ibd and .cfg files
|
|||
SET SESSION debug_dbug=@saved_debug_dbug;
|
||||
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
|
||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||
ERROR HY000: Got error 42 'Tablespace not found' from ./test/t1.ibd
|
||||
ERROR HY000: Got error 41 'Tablespace not found' from ./test/t1.ibd
|
||||
SET SESSION debug_dbug=@saved_debug_dbug;
|
||||
restore: t1 .ibd and .cfg files
|
||||
SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
--source include/have_debug_sync.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
# Two parallel connection with autoinc column after restart.
|
||||
|
||||
CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY)ENGINE=INNODB;
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
let $have_deadlock=`select @@GLOBAL.innodb_deadlock_detect`;
|
||||
|
||||
connection default;
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pkey int NOT NULL PRIMARY KEY,
|
||||
c int
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
--source include/have_debug_sync.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--connect(cancel_purge,localhost,root,,)
|
||||
# Purge can cause deadlock in the test, requesting page's RW_X_LATCH for trx
|
||||
# ids reseting, after trx 2 acqured RW_S_LATCH and suspended in debug sync point
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
--source include/have_debug_sync.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
# Purge can cause deadlock in the test, requesting page's RW_X_LATCH for trx
|
||||
# ids reseting, after trx 2 acqured RW_S_LATCH and suspended in debug sync point
|
||||
# lock_trx_handle_wait_enter, waiting for upd_cont signal, which must be
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
--source include/have_debug_sync.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
# Purge can cause deadlock in the test, requesting page's RW_X_LATCH for trx
|
||||
# ids reseting, after trx 2 acqured RW_S_LATCH and suspended in debug sync point
|
||||
# lock_trx_handle_wait_enter, waiting for upd_cont signal, which must be
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
--source include/count_sessions.inc
|
||||
--source include/default_charset.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
SET GLOBAL innodb_stats_persistent = 0;
|
||||
|
||||
--echo #
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/have_partition.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
#
|
||||
# Check and select innodb lock type
|
||||
#
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
# Bug#42419 Server crash with "Pure virtual method called" on two concurrent connections
|
||||
#
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--source include/not_embedded.inc
|
||||
|
||||
let $innodb_lock_wait_timeout= query_get_value(SHOW VARIABLES LIKE 'innodb_lock_wait_timeout%', Value, 1);
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
--source include/have_innodb.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
#
|
||||
# Bug #41453: Assertion `m_status == DA_ERROR' failed in
|
||||
# Diagnostics_area::sql_errno
|
||||
|
|
|
@ -6,6 +6,10 @@
|
|||
# be heavier than ones that had not.
|
||||
#
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
SET default_storage_engine=InnoDB;
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
--source include/have_debug_sync.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--connect (pause_purge,localhost,root)
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t VALUES (3);
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
--source include/have_innodb.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-26642 Weird SELECT view when a record is
|
||||
--echo # modified to the same value by two transactions
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
--echo #
|
||||
|
||||
call mtr.add_suppression("\\[Warning\\] InnoDB: Over 67 percent of the buffer pool");
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
CREATE TABLE t1 (col1 INT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
--source include/innodb_stable_estimates.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk INT,
|
||||
f1 VARCHAR(10) NOT NULL,
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
# concurrent CREATE OR REPLACE and transactional UPDATE
|
||||
#
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--source include/have_innodb.inc
|
||||
|
||||
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
source include/have_innodb.inc;
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
#
|
||||
# MDEV-20354 All but last insert ignored in InnoDB tables when table locked
|
||||
#
|
||||
|
|
|
@ -249,9 +249,33 @@ id title
|
|||
7 mysql
|
||||
TRUNCATE TABLE articles;
|
||||
INSERT INTO articles(id, title) VALUES(1, 'mysql');
|
||||
CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
BEGIN;
|
||||
INSERT INTO t SET a=1;
|
||||
SAVEPOINT t;
|
||||
INSERT INTO articles(id, title) VALUES(2, 'mysql');
|
||||
SELECT * FROM articles WHERE MATCH(title) AGAINST('mysql');
|
||||
id title
|
||||
1 mysql
|
||||
ROLLBACK TO SAVEPOINT t;
|
||||
SELECT * FROM articles WHERE MATCH(title) AGAINST('mysql');
|
||||
id title
|
||||
1 mysql
|
||||
SELECT * FROM t;
|
||||
a
|
||||
1
|
||||
COMMIT;
|
||||
SELECT * FROM articles WHERE MATCH(title) AGAINST('mysql');
|
||||
id title
|
||||
1 mysql
|
||||
BEGIN;
|
||||
INSERT INTO t SET a=2;
|
||||
INSERT INTO articles(id, title) VALUES(2, 'mysql');
|
||||
ROLLBACK;
|
||||
SELECT * FROM t;
|
||||
a
|
||||
1
|
||||
DROP TABLE t;
|
||||
INSERT INTO articles(id, title) VALUES(3, 'mysql');
|
||||
SELECT * FROM articles WHERE MATCH(title) AGAINST('mysql');
|
||||
id title
|
||||
|
|
|
@ -366,12 +366,28 @@ TRUNCATE TABLE articles;
|
|||
|
||||
INSERT INTO articles(id, title) VALUES(1, 'mysql');
|
||||
|
||||
CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
BEGIN;
|
||||
INSERT INTO t SET a=1;
|
||||
SAVEPOINT t;
|
||||
INSERT INTO articles(id, title) VALUES(2, 'mysql');
|
||||
SELECT * FROM articles WHERE MATCH(title) AGAINST('mysql');
|
||||
ROLLBACK TO SAVEPOINT t;
|
||||
SELECT * FROM articles WHERE MATCH(title) AGAINST('mysql');
|
||||
SELECT * FROM t;
|
||||
COMMIT;
|
||||
|
||||
SELECT * FROM articles WHERE MATCH(title) AGAINST('mysql');
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO t SET a=2;
|
||||
INSERT INTO articles(id, title) VALUES(2, 'mysql');
|
||||
|
||||
ROLLBACK;
|
||||
|
||||
SELECT * FROM t;
|
||||
DROP TABLE t;
|
||||
|
||||
INSERT INTO articles(id, title) VALUES(3, 'mysql');
|
||||
|
||||
SELECT * FROM articles WHERE MATCH(title) AGAINST('mysql');
|
||||
|
|
|
@ -91,7 +91,7 @@ restore: t1 .ibd and .cfg files
|
|||
SET SESSION debug_dbug=@saved_debug_dbug;
|
||||
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
|
||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||
ERROR HY000: Got error 42 'Tablespace not found' from ./test/t1.ibd
|
||||
ERROR HY000: Got error 41 'Tablespace not found' from ./test/t1.ibd
|
||||
SET SESSION debug_dbug=@saved_debug_dbug;
|
||||
restore: t1 .ibd and .cfg files
|
||||
SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/have_debug.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--echo *** Test all-to-all replication with --gtid-ignore-duplicates ***
|
||||
|
||||
|
|
|
@ -30,4 +30,13 @@ DROP USER u2;
|
|||
set global server_audit_logging=off;
|
||||
UNINSTALL PLUGIN ed25519;
|
||||
UNINSTALL PLUGIN server_audit;
|
||||
#
|
||||
# MDEV-35604: SIGSEGV in filter_query_type | log_statement_ex / auditing
|
||||
#
|
||||
INSTALL PLUGIN server_audit SONAME 'server_audit';
|
||||
SET GLOBAL server_audit_logging=ON;
|
||||
SET STATEMENT max_error_count=1 SELECT 1;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT 1' at line 1
|
||||
SET GLOBAL server_audit_logging=OFF;
|
||||
UNINSTALL SONAME 'server_audit';
|
||||
# end of 10.5 tests
|
||||
|
|
|
@ -56,4 +56,20 @@ UNINSTALL PLUGIN ed25519;
|
|||
UNINSTALL PLUGIN server_audit;
|
||||
--enable_warnings
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35604: SIGSEGV in filter_query_type | log_statement_ex / auditing
|
||||
--echo #
|
||||
|
||||
INSTALL PLUGIN server_audit SONAME 'server_audit';
|
||||
SET GLOBAL server_audit_logging=ON;
|
||||
|
||||
--ERROR ER_PARSE_ERROR
|
||||
SET STATEMENT max_error_count=1 SELECT 1;
|
||||
|
||||
# Cleanup
|
||||
SET GLOBAL server_audit_logging=OFF;
|
||||
--disable_warnings
|
||||
UNINSTALL SONAME 'server_audit';
|
||||
--enable_warnings
|
||||
|
||||
--echo # end of 10.5 tests
|
||||
|
|
|
@ -36,9 +36,9 @@ Table Op Msg_type Msg_text
|
|||
test.t1 analyze status Engine-independent statistics collected
|
||||
test.t1 analyze status OK
|
||||
FLUSH LOGS;
|
||||
FOUND 1 /GTID 0-1-8 ddl/ in mysqlbinlog.out
|
||||
FOUND 1 /GTID 0-1-9 ddl/ in mysqlbinlog.out
|
||||
FOUND 1 /GTID 0-1-10 ddl/ in mysqlbinlog.out
|
||||
FOUND 1 /GTID 0-1-11 ddl/ in mysqlbinlog.out
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
|
@ -63,9 +63,9 @@ ALTER TABLE t1 REPAIR PARTITION p0;
|
|||
Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
FLUSH LOGS;
|
||||
FOUND 1 /GTID 0-1-14 ddl/ in mysqlbinlog.out
|
||||
FOUND 1 /GTID 0-1-15 ddl/ in mysqlbinlog.out
|
||||
FOUND 1 /GTID 0-1-16 ddl/ in mysqlbinlog.out
|
||||
FOUND 1 /GTID 0-1-17 ddl/ in mysqlbinlog.out
|
||||
#
|
||||
# Clean up
|
||||
#
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
--let $rpl_topology=1->2
|
||||
--source include/rpl_init.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--connection server_1
|
||||
FLUSH TABLES;
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
--source include/have_debug.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--echo MDEV-31655: Parallel replication deadlock victim preference code erroneously removed
|
||||
# The problem was that InnoDB would choose the wrong deadlock victim.
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
--source include/have_debug.inc
|
||||
--source include/have_binlog_format_statement.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--connection master
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
CREATE TABLE t1(a INT) ENGINE=INNODB;
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
--source include/have_debug_sync.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--connection server_2
|
||||
SET sql_log_bin=0;
|
||||
CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
|
||||
call mtr.add_suppression("Can't find record in 't1'");
|
||||
call mtr.add_suppression("Can't find record in 't2'");
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--connection server_1
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
--let $rpl_topology=1->2
|
||||
--source include/rpl_init.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--connection server_1
|
||||
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||
CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
--source include/have_perfschema.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--let $xid_num = 19
|
||||
--let $repeat = 17
|
||||
--let $workers = 7
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
--source include/master-slave.inc
|
||||
|
||||
call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
--echo *** Provoke a deadlock on the slave, check that transaction retry succeeds. ***
|
||||
--connection master
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
source suite/versioning/engines.inc;
|
||||
source suite/versioning/common.inc;
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Transaction was aborted due to ");
|
||||
--enable_query_log
|
||||
|
||||
replace_result $sys_datatype_expl SYS_DATATYPE;
|
||||
eval create table t1(
|
||||
x int unsigned,
|
||||
|
|
|
@ -251,7 +251,7 @@ my_bool allocate_dynamic(DYNAMIC_ARRAY *array, size_t max_elements)
|
|||
if (!(new_ptr= (uchar *) my_malloc(array->m_psi_key, size *
|
||||
array->size_of_element,
|
||||
MYF(array->malloc_flags | MY_WME))))
|
||||
DBUG_RETURN(0);
|
||||
DBUG_RETURN(TRUE);
|
||||
memcpy(new_ptr, array->buffer,
|
||||
array->elements * array->size_of_element);
|
||||
array->malloc_flags&= ~MY_INIT_BUFFER_USED;
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
*/
|
||||
|
||||
|
||||
File my_create(const char *FileName, int CreateFlags, int access_flags,
|
||||
File my_create(const char *FileName, mode_t CreateFlags, int access_flags,
|
||||
myf MyFlags)
|
||||
{
|
||||
int fd;
|
||||
DBUG_ENTER("my_create");
|
||||
DBUG_PRINT("my",("Name: '%s' CreateFlags: %d AccessFlags: %d MyFlags: %lu",
|
||||
DBUG_PRINT("my",("Name: '%s' CreateFlags: %u AccessFlags: %d MyFlags: %lu",
|
||||
FileName, CreateFlags, access_flags, MyFlags));
|
||||
#if defined(_WIN32)
|
||||
fd= my_win_open(FileName, access_flags | O_CREAT);
|
||||
|
|
|
@ -54,7 +54,7 @@ size_t my_system_page_size= 8192; /* Default if no sysconf() */
|
|||
|
||||
ulonglong my_thread_stack_size= (sizeof(void*) <= 4)? 65536: ((256-16)*1024);
|
||||
|
||||
static ulong atoi_octal(const char *str)
|
||||
static mode_t atoi_octal(const char *str)
|
||||
{
|
||||
long int tmp;
|
||||
while (*str && my_isspace(&my_charset_latin1, *str))
|
||||
|
@ -62,7 +62,7 @@ static ulong atoi_octal(const char *str)
|
|||
str2int(str,
|
||||
(*str == '0' ? 8 : 10), /* Octalt or decimalt */
|
||||
0, INT_MAX, &tmp);
|
||||
return (ulong) tmp;
|
||||
return (mode_t) tmp;
|
||||
}
|
||||
|
||||
MYSQL_FILE *mysql_stdin= NULL;
|
||||
|
@ -155,10 +155,10 @@ my_bool my_init(void)
|
|||
|
||||
/* Default creation of new files */
|
||||
if ((str= getenv("UMASK")) != 0)
|
||||
my_umask= (int) (atoi_octal(str) | 0600);
|
||||
my_umask= atoi_octal(str) | 0600;
|
||||
/* Default creation of new dir's */
|
||||
if ((str= getenv("UMASK_DIR")) != 0)
|
||||
my_umask_dir= (int) (atoi_octal(str) | 0700);
|
||||
my_umask_dir= atoi_octal(str) | 0700;
|
||||
|
||||
init_glob_errs();
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "my_atomic.h"
|
||||
|
||||
CREATE_NOSYMLINK_FUNCTION(
|
||||
open_nosymlinks(const char *pathname, int flags, int mode),
|
||||
open_nosymlinks(const char *pathname, int flags, mode_t mode),
|
||||
openat(dfd, filename, O_NOFOLLOW | flags, mode),
|
||||
open(pathname, O_NOFOLLOW | flags, mode)
|
||||
);
|
||||
|
|
|
@ -64,7 +64,7 @@ char curr_dir[FN_REFLEN]= {0},
|
|||
home_dir_buff[FN_REFLEN]= {0};
|
||||
ulong my_stream_opened=0,my_tmp_file_created=0;
|
||||
ulong my_file_total_opened= 0;
|
||||
int my_umask=0664, my_umask_dir=0777;
|
||||
mode_t my_umask=0664, my_umask_dir=0777;
|
||||
#ifdef _WIN32
|
||||
SECURITY_ATTRIBUTES my_dir_security_attributes= {sizeof(SECURITY_ATTRIBUTES),NULL,FALSE};
|
||||
#endif
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <m_string.h>
|
||||
|
||||
File my_create_with_symlink(const char *linkname, const char *filename,
|
||||
int createflags, int access_flags, myf MyFlags)
|
||||
mode_t createflags, int access_flags, myf MyFlags)
|
||||
{
|
||||
File file;
|
||||
int tmp_errno;
|
||||
|
|
|
@ -566,8 +566,7 @@ static void *alarm_handler(void *arg __attribute__((unused)))
|
|||
alarm_thread_running= 0;
|
||||
mysql_cond_signal(&COND_alarm);
|
||||
mysql_mutex_unlock(&LOCK_alarm);
|
||||
pthread_exit(0);
|
||||
return 0; /* Impossible */
|
||||
return 0;
|
||||
}
|
||||
#endif /* USE_ALARM_THREAD */
|
||||
#endif
|
||||
|
|
|
@ -330,8 +330,7 @@ static void *timer_handler(void *arg __attribute__((unused)))
|
|||
}
|
||||
mysql_mutex_unlock(&LOCK_timer);
|
||||
my_thread_end();
|
||||
pthread_exit(0);
|
||||
return 0; /* Impossible */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -290,7 +290,6 @@ pthread_handler_t background_thread(void *arg __attribute__((unused)))
|
|||
}
|
||||
|
||||
my_thread_end();
|
||||
pthread_exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@ IF(WIN32 OR WITHOUT_SERVER)
|
|||
RETURN()
|
||||
ENDIF()
|
||||
|
||||
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-deprecated-declarations")
|
||||
|
||||
INCLUDE_DIRECTORIES(libhsclient)
|
||||
|
||||
# Handlersocket client library. We do not distribute it,
|
||||
|
|
|
@ -9,6 +9,11 @@
|
|||
#ifndef DENA_DATABASE_HPP
|
||||
#define DENA_DATABASE_HPP
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* auto_ptr is deprecated */
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
|
|
@ -19,6 +19,11 @@
|
|||
#include "string_ref.hpp"
|
||||
#include "string_buffer.hpp"
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* auto_ptr is deprecated */
|
||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
namespace dena {
|
||||
|
||||
struct hstcpcli_filter {
|
||||
|
|
|
@ -1782,6 +1782,8 @@ static int filter_query_type(const char *query, struct sa_keyword *kwd)
|
|||
char fword[MAX_KEYWORD + 1], nword[MAX_KEYWORD + 1];
|
||||
int len, nlen= 0;
|
||||
const struct sa_keyword *l_keywords;
|
||||
if (!query)
|
||||
return SQLCOM_NOTHING;
|
||||
|
||||
while (*query && (is_space(*query) || *query == '(' || *query == '/'))
|
||||
{
|
||||
|
|
|
@ -1117,7 +1117,7 @@ get_openssl()
|
|||
{
|
||||
# If the OPENSSL_BINARY variable is already defined, just return:
|
||||
if [ -n "${OPENSSL_BINARY+x}" ]; then
|
||||
return
|
||||
return 0
|
||||
fi
|
||||
# Let's look for openssl:
|
||||
OPENSSL_BINARY=$(commandex 'openssl')
|
||||
|
@ -1556,7 +1556,7 @@ cleanup_pid()
|
|||
fi
|
||||
done
|
||||
elif ps -p $pid >/dev/null 2>&1; then
|
||||
wsrep_log_warning "Unable to kill PID=$pid ($pid_file)"
|
||||
wsrep_log_warning "Unable to kill PID=$pid${pid_file:+ ($pid_file)}"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
@ -1863,6 +1863,8 @@ create_dirs()
|
|||
cd "$OLD_PWD"
|
||||
[ $simplify -ne 0 -a "$ar_log_dir" = "$DATA_DIR" ] && ar_log_dir=""
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
wait_previous_sst()
|
||||
|
|
|
@ -439,17 +439,30 @@ get_transfer()
|
|||
get_footprint()
|
||||
{
|
||||
cd "$DATA_DIR"
|
||||
local payload_data=$(find $findopt . \
|
||||
-regex '.*undo[0-9]+$\|.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' \
|
||||
-type f -print0 | du --files0-from=- --block-size=1 -c -s | \
|
||||
awk 'END { print $1 }')
|
||||
local payload_data
|
||||
if [ "$OS" = 'Linux' ]; then
|
||||
payload_data=$(find $findopt . \
|
||||
-regex '.*undo[0-9]+$\|.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' \
|
||||
-type f -print0 | du --files0-from=- --bytes -c -s | \
|
||||
awk 'END { print $1 }')
|
||||
else
|
||||
payload_data=$(find $findopt . \
|
||||
-regex '.*undo[0-9]+$|.*\.ibd$|.*\.MYI$\.*\.MYD$|.*ibdata1$' \
|
||||
-type f -print0 | xargs -0 stat -f '%z' | \
|
||||
awk '{ sum += $1 } END { print sum }')
|
||||
fi
|
||||
local payload_undo=0
|
||||
if [ -n "$ib_undo_dir" -a "$ib_undo_dir" != '.' -a \
|
||||
"$ib_undo_dir" != "$DATA_DIR" -a -d "$ib_undo_dir" ]
|
||||
then
|
||||
cd "$ib_undo_dir"
|
||||
payload_undo=$(find . -regex '.*undo[0-9]+$' -type f -print0 | \
|
||||
du --files0-from=- --block-size=1 -c -s | awk 'END { print $1 }')
|
||||
if [ "$OS" = 'Linux' ]; then
|
||||
payload_undo=$(find . -regex '.*undo[0-9]+$' -type f -print0 | \
|
||||
du --files0-from=- --bytes -c -s | awk 'END { print $1 }')
|
||||
else
|
||||
payload_undo=$(find . -regex '.*undo[0-9]+$' -type f -print0 | \
|
||||
xargs -0 stat -f '%z' | awk '{ sum += $1 } END { print sum }')
|
||||
fi
|
||||
fi
|
||||
cd "$OLD_PWD"
|
||||
|
||||
|
@ -676,24 +689,25 @@ cleanup_at_exit()
|
|||
|
||||
[ "$(pwd)" != "$OLD_PWD" ] && cd "$OLD_PWD"
|
||||
|
||||
if [ $estatus -ne 0 ]; then
|
||||
wsrep_log_error "Removing $MAGIC_FILE file due to signal"
|
||||
if [ "$WSREP_SST_OPT_ROLE" = 'donor' -o $estatus -ne 0 ]; then
|
||||
if [ $estatus -ne 0 ]; then
|
||||
wsrep_log_error "Removing $MAGIC_FILE file due to signal"
|
||||
fi
|
||||
[ -f "$MAGIC_FILE" ] && rm -f "$MAGIC_FILE" || :
|
||||
[ -f "$DONOR_MAGIC_FILE" ] && rm -f "$DONOR_MAGIC_FILE" || :
|
||||
[ -f "$DATA/$IST_FILE" ] && rm -f "$DATA/$IST_FILE" || :
|
||||
fi
|
||||
|
||||
if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
|
||||
if [ -n "$BACKUP_PID" ]; then
|
||||
if ps -p $BACKUP_PID >/dev/null 2>&1; then
|
||||
wsrep_log_error \
|
||||
"mariadb-backup process is still running. Killing..."
|
||||
cleanup_pid $CHECK_PID
|
||||
"SST streaming process is still running. Killing..."
|
||||
cleanup_pid $BACKUP_PID
|
||||
fi
|
||||
fi
|
||||
wsrep_log_info "Removing the sst_in_progress file"
|
||||
wsrep_cleanup_progress_file
|
||||
else
|
||||
[ -f "$DATA/$IST_FILE" ] && rm -f "$DATA/$IST_FILE" || :
|
||||
fi
|
||||
|
||||
if [ -n "$progress" -a -p "$progress" ]; then
|
||||
|
@ -1340,6 +1354,7 @@ else # joiner
|
|||
[ -f "$DATA/xtrabackup_checkpoints" ] && rm -f "$DATA/xtrabackup_checkpoints"
|
||||
[ -f "$DATA/xtrabackup_info" ] && rm -f "$DATA/xtrabackup_info"
|
||||
[ -f "$DATA/xtrabackup_slave_info" ] && rm -f "$DATA/xtrabackup_slave_info"
|
||||
[ -f "$DATA/xtrabackup_binlog_info" ] && rm -f "$DATA/xtrabackup_binlog_info"
|
||||
[ -f "$DATA/xtrabackup_binlog_pos_innodb" ] && rm -f "$DATA/xtrabackup_binlog_pos_innodb"
|
||||
|
||||
TDATA="$DATA"
|
||||
|
|
|
@ -4678,6 +4678,12 @@ void handler::print_error(int error, myf errflag)
|
|||
case HA_ERR_PARTITION_LIST:
|
||||
my_error(ER_VERS_NOT_ALLOWED, errflag, table->s->db.str, table->s->table_name.str);
|
||||
DBUG_VOID_RETURN;
|
||||
case HA_ERR_ROLLBACK:
|
||||
/* Crash if we run with --debug-assert-on-error */
|
||||
DBUG_ASSERT(!debug_assert_if_crashed_table);
|
||||
SET_FATAL_ERROR;
|
||||
textno= ER_ROLLBACK_ONLY;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
/* The error was "unknown" to this function.
|
||||
|
@ -4712,7 +4718,7 @@ void handler::print_error(int error, myf errflag)
|
|||
/* Ensure this becomes a true error */
|
||||
errflag&= ~(ME_WARNING | ME_NOTE);
|
||||
if ((debug_assert_if_crashed_table ||
|
||||
global_system_variables.log_warnings > 1))
|
||||
global_system_variables.log_warnings > 1))
|
||||
{
|
||||
/*
|
||||
Log error to log before we crash or if extended warnings are requested
|
||||
|
|
|
@ -1454,7 +1454,7 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, size_t query_length,
|
|||
user_host_buff);
|
||||
|
||||
DBUG_ASSERT(thd->start_utime);
|
||||
DBUG_ASSERT(thd->start_time);
|
||||
DBUG_ASSERT(thd->start_time || thd->start_time_sec_part);
|
||||
query_utime= (current_utime - thd->start_utime);
|
||||
lock_utime= (thd->utime_after_lock - thd->start_utime);
|
||||
my_hrtime_t current_time= { hrtime_from_time(thd->start_time) +
|
||||
|
|
|
@ -3212,7 +3212,6 @@ pthread_handler_t signal_hand(void *)
|
|||
sigset_t set;
|
||||
int sig;
|
||||
my_thread_init(); // Init new thread
|
||||
DBUG_ENTER("signal_hand");
|
||||
signal_thread_in_use= 1;
|
||||
|
||||
/*
|
||||
|
@ -3278,7 +3277,6 @@ pthread_handler_t signal_hand(void *)
|
|||
/* switch to the old log message processing */
|
||||
logger.set_handlers(global_system_variables.sql_log_slow ? LOG_FILE:LOG_NONE,
|
||||
opt_log ? LOG_FILE:LOG_NONE);
|
||||
DBUG_PRINT("info",("Got signal: %d abort_loop: %d",sig,abort_loop));
|
||||
|
||||
break_connect_loop();
|
||||
DBUG_ASSERT(abort_loop);
|
||||
|
@ -3314,12 +3312,9 @@ pthread_handler_t signal_hand(void *)
|
|||
break; /* purecov: tested */
|
||||
}
|
||||
}
|
||||
DBUG_PRINT("quit", ("signal_handler: calling my_thread_end()"));
|
||||
my_thread_end();
|
||||
DBUG_LEAVE; // Must match DBUG_ENTER()
|
||||
signal_thread_in_use= 0;
|
||||
pthread_exit(0); // Safety
|
||||
return(0); /* purecov: deadcode */
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void check_data_home(const char *path)
|
||||
|
|
|
@ -76,12 +76,32 @@ static inline void output_core_info()
|
|||
if ((fd= open("/proc/self/limits", O_RDONLY)) >= 0)
|
||||
#endif
|
||||
{
|
||||
my_safe_printf_stderr("Resource Limits:\n");
|
||||
while ((len= read(fd, (uchar*)buff, sizeof(buff))) > 0)
|
||||
{
|
||||
my_write_stderr(buff, len);
|
||||
}
|
||||
char *endline= buff;
|
||||
ssize_t remain_len= len= read(fd, buff, sizeof(buff));
|
||||
close(fd);
|
||||
my_safe_printf_stderr("Resource Limits (excludes unlimited resources):\n");
|
||||
/* first line, header */
|
||||
endline= (char *) memchr(buff, '\n', remain_len);
|
||||
if (endline)
|
||||
{
|
||||
endline++;
|
||||
remain_len= buff + len - endline;
|
||||
my_safe_printf_stderr("%.*s", (int) (endline - buff), buff);
|
||||
|
||||
while (remain_len > 27)
|
||||
{
|
||||
char *newendline= (char *) memchr(endline, '\n', remain_len);
|
||||
if (!newendline)
|
||||
break;
|
||||
*newendline= '\0';
|
||||
newendline++;
|
||||
if (endline[26] != 'u') /* skip unlimited limits */
|
||||
my_safe_printf_stderr("%s\n", endline);
|
||||
|
||||
remain_len-= newendline - endline;
|
||||
endline= newendline;
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef __linux__
|
||||
if ((fd= open("/proc/sys/kernel/core_pattern", O_RDONLY)) >= 0)
|
||||
|
@ -144,7 +164,6 @@ extern "C" sig_handler handle_fatal_signal(int sig)
|
|||
We will try and print the query at the end of the signal handler, in case
|
||||
we're wrong.
|
||||
*/
|
||||
bool print_invalid_query_pointer= false;
|
||||
#endif
|
||||
|
||||
if (segfaulted)
|
||||
|
@ -174,57 +193,19 @@ extern "C" sig_handler handle_fatal_signal(int sig)
|
|||
goto end;
|
||||
}
|
||||
|
||||
my_safe_printf_stderr("[ERROR] mysqld got " SIGNAL_FMT " ;\n",sig);
|
||||
my_safe_printf_stderr("[ERROR] %s got " SIGNAL_FMT " ;\n", my_progname, sig);
|
||||
|
||||
my_safe_printf_stderr("%s",
|
||||
"Sorry, we probably made a mistake, and this is a bug.\n\n"
|
||||
"Your assistance in bug reporting will enable us to fix this for the next release.\n"
|
||||
"To report this bug, see https://mariadb.com/kb/en/reporting-bugs\n\n");
|
||||
|
||||
my_safe_printf_stderr("%s",
|
||||
"We will try our best to scrape up some info that will hopefully help\n"
|
||||
"diagnose the problem, but since we have already crashed, \n"
|
||||
"something is definitely wrong and this may fail.\n\n");
|
||||
"To report this bug, see https://mariadb.com/kb/en/reporting-bugs about how to report\n"
|
||||
"a bug on https://jira.mariadb.org/.\n\n"
|
||||
"Please include the information from the server start above, to the end of the\n"
|
||||
"information below.\n\n");
|
||||
|
||||
set_server_version(server_version, sizeof(server_version));
|
||||
my_safe_printf_stderr("Server version: %s source revision: %s\n",
|
||||
server_version, SOURCE_REVISION);
|
||||
|
||||
if (dflt_key_cache)
|
||||
my_safe_printf_stderr("key_buffer_size=%zu\n",
|
||||
dflt_key_cache->key_cache_mem_size);
|
||||
|
||||
my_safe_printf_stderr("read_buffer_size=%lu\n",
|
||||
global_system_variables.read_buff_size);
|
||||
|
||||
my_safe_printf_stderr("max_used_connections=%lu\n",
|
||||
max_used_connections);
|
||||
|
||||
if (thread_scheduler)
|
||||
my_safe_printf_stderr("max_threads=%lu\n",
|
||||
thread_scheduler->max_threads +
|
||||
extra_max_connections);
|
||||
|
||||
my_safe_printf_stderr("thread_count=%u\n", THD_count::value());
|
||||
|
||||
if (dflt_key_cache && thread_scheduler)
|
||||
{
|
||||
size_t used_mem=
|
||||
(dflt_key_cache->key_cache_mem_size +
|
||||
(global_system_variables.read_buff_size +
|
||||
(size_t) global_system_variables.sortbuff_size) *
|
||||
(thread_scheduler->max_threads + extra_max_connections) +
|
||||
(max_connections + extra_max_connections) * sizeof(THD)) / 1024;
|
||||
|
||||
my_safe_printf_stderr("It is possible that mysqld could use up to \n"
|
||||
"key_buffer_size + "
|
||||
"(read_buffer_size + sort_buffer_size)*max_threads = "
|
||||
"%zu K bytes of memory\n", used_mem);
|
||||
|
||||
my_safe_printf_stderr("%s",
|
||||
"Hope that's ok; if not, decrease some variables in "
|
||||
"the equation.\n\n");
|
||||
}
|
||||
my_safe_printf_stderr("Server version: %s source revision: %s\n\n",
|
||||
server_version, SOURCE_REVISION);
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
Wsrep_server_state::handle_fatal_signal();
|
||||
|
@ -235,12 +216,14 @@ extern "C" sig_handler handle_fatal_signal(int sig)
|
|||
|
||||
if (opt_stack_trace)
|
||||
{
|
||||
my_safe_printf_stderr("Thread pointer: %p\n", thd);
|
||||
my_safe_printf_stderr("%s",
|
||||
"Attempting backtrace. You can use the following "
|
||||
"information to find out\n"
|
||||
"where mysqld died. If you see no messages after this, something went\n"
|
||||
"terribly wrong...\n");
|
||||
"The information page at "
|
||||
"https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/\n"
|
||||
"contains instructions to obtain a better version of the backtrace below.\n"
|
||||
"Following these instructions will help MariaDB developers provide a fix quicker.\n\n"
|
||||
"Attempting backtrace. Include this in the bug report.\n"
|
||||
"(note: Retrieving this information may fail)\n\n");
|
||||
my_safe_printf_stderr("Thread pointer: %p\n", thd);
|
||||
my_print_stacktrace(thd ? (uchar*) thd->thread_stack : NULL,
|
||||
(ulong)my_thread_stack_size, 0);
|
||||
}
|
||||
|
@ -288,20 +271,12 @@ extern "C" sig_handler handle_fatal_signal(int sig)
|
|||
kreason= "KILL_WAIT_TIMEOUT";
|
||||
break;
|
||||
}
|
||||
my_safe_printf_stderr("%s", "\n"
|
||||
"Trying to get some variables.\n"
|
||||
"Some pointers may be invalid and cause the dump to abort.\n");
|
||||
|
||||
my_safe_printf_stderr("Query (%p): ", thd->query());
|
||||
if (my_safe_print_str(thd->query(), MY_MIN(65536U, thd->query_length())))
|
||||
{
|
||||
// Query was found invalid. We will try to print it at the end.
|
||||
print_invalid_query_pointer= true;
|
||||
}
|
||||
|
||||
my_safe_printf_stderr("\nConnection ID (thread ID): %lu\n",
|
||||
(ulong) thd->thread_id);
|
||||
my_safe_printf_stderr("Status: %s\n\n", kreason);
|
||||
my_safe_printf_stderr("Status: %s\n", kreason);
|
||||
my_safe_printf_stderr("Query (%p): ", thd->query());
|
||||
my_safe_print_str(thd->query(), MY_MIN(65536U, thd->query_length()));
|
||||
my_safe_printf_stderr("%s", "Optimizer switch: ");
|
||||
ulonglong optsw= thd->variables.optimizer_switch;
|
||||
for (uint i= 0; optimizer_switch_names[i+1]; i++, optsw >>= 1)
|
||||
|
@ -313,52 +288,9 @@ extern "C" sig_handler handle_fatal_signal(int sig)
|
|||
}
|
||||
my_safe_printf_stderr("%s", "\n\n");
|
||||
}
|
||||
my_safe_printf_stderr("%s",
|
||||
"The manual page at "
|
||||
"https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mariadbd/ contains\n"
|
||||
"information that should help you find out what is causing the crash.\n");
|
||||
|
||||
#endif /* HAVE_STACKTRACE */
|
||||
|
||||
#ifdef HAVE_INITGROUPS
|
||||
if (calling_initgroups)
|
||||
{
|
||||
my_safe_printf_stderr("%s", "\n"
|
||||
"This crash occurred while the server was calling initgroups(). This is\n"
|
||||
"often due to the use of a mysqld that is statically linked against \n"
|
||||
"glibc and configured to use LDAP in /etc/nsswitch.conf.\n"
|
||||
"You will need to either upgrade to a version of glibc that does not\n"
|
||||
"have this problem (2.3.4 or later when used with nscd),\n"
|
||||
"disable LDAP in your nsswitch.conf, or use a "
|
||||
"mysqld that is not statically linked.\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (locked_in_memory)
|
||||
{
|
||||
my_safe_printf_stderr("%s", "\n"
|
||||
"The \"--memlock\" argument, which was enabled, "
|
||||
"uses system calls that are\n"
|
||||
"unreliable and unstable on some operating systems and "
|
||||
"operating-system versions (notably, some versions of Linux).\n"
|
||||
"This crash could be due to use of those buggy OS calls.\n"
|
||||
"You should consider whether you really need the "
|
||||
"\"--memlock\" parameter and/or consult the OS distributer about "
|
||||
"\"mlockall\" bugs.\n");
|
||||
}
|
||||
|
||||
#ifdef HAVE_STACKTRACE
|
||||
if (print_invalid_query_pointer)
|
||||
{
|
||||
my_safe_printf_stderr(
|
||||
"\nWe think the query pointer is invalid, but we will try "
|
||||
"to print it anyway. \n"
|
||||
"Query: ");
|
||||
my_write_stderr(thd->query(), MY_MIN(65536U, thd->query_length()));
|
||||
my_safe_printf_stderr("\n\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
output_core_info();
|
||||
#ifdef HAVE_WRITE_CORE
|
||||
if (test_flags & TEST_CORE_ON_SIGNAL)
|
||||
|
|
|
@ -7227,6 +7227,7 @@ alter:
|
|||
{
|
||||
LEX *lex= Lex;
|
||||
lex->sql_command= SQLCOM_ALTER_SEQUENCE;
|
||||
lex->create_info.init();
|
||||
DBUG_ASSERT(!lex->m_sql_cmd);
|
||||
if (Lex->main_select_push())
|
||||
MYSQL_YYABORT;
|
||||
|
|
|
@ -10102,7 +10102,14 @@ bool TABLE_LIST::is_the_same_definition(THD* thd, TABLE_SHARE *s)
|
|||
tabledef_version.length= 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
set_tabledef_version(s);
|
||||
if (m_table_ref_type == TABLE_REF_NULL)
|
||||
{
|
||||
set_table_ref_id(s);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1737,7 +1737,7 @@ struct find_interesting_trx
|
|||
{
|
||||
void operator()(const trx_t &trx)
|
||||
{
|
||||
if (trx.state == TRX_STATE_NOT_STARTED)
|
||||
if (!trx.is_started())
|
||||
return;
|
||||
if (trx.mysql_thd == nullptr)
|
||||
return;
|
||||
|
@ -1746,12 +1746,12 @@ struct find_interesting_trx
|
|||
|
||||
if (!found)
|
||||
{
|
||||
ib::warn() << "The following trx might hold "
|
||||
sql_print_warning("InnoDB: The following trx might hold "
|
||||
"the blocks in buffer pool to "
|
||||
"be withdrawn. Buffer pool "
|
||||
"resizing can complete only "
|
||||
"after all the transactions "
|
||||
"below release the blocks.";
|
||||
"below release the blocks.");
|
||||
found= true;
|
||||
}
|
||||
|
||||
|
@ -3620,6 +3620,8 @@ retry:
|
|||
ut_ad(!bpage->is_io_fixed(state));
|
||||
ut_ad(bpage->buf_fix_count(state));
|
||||
}
|
||||
else
|
||||
state= bpage->state();
|
||||
|
||||
ut_ad(state >= buf_page_t::FREED);
|
||||
ut_ad(state < buf_page_t::READ_FIX);
|
||||
|
@ -3941,8 +3943,7 @@ static dberr_t buf_page_check_corrupt(buf_page_t *bpage,
|
|||
const bool seems_encrypted = !node.space->full_crc32() && key_version
|
||||
&& node.space->crypt_data
|
||||
&& node.space->crypt_data->type != CRYPT_SCHEME_UNENCRYPTED;
|
||||
ut_ad(node.space->purpose != FIL_TYPE_TEMPORARY ||
|
||||
node.space->full_crc32());
|
||||
ut_ad(!node.space->is_temporary() || node.space->full_crc32());
|
||||
|
||||
/* If traditional checksums match, we assume that page is
|
||||
not anymore encrypted. */
|
||||
|
@ -3950,7 +3951,7 @@ static dberr_t buf_page_check_corrupt(buf_page_t *bpage,
|
|||
&& !buf_is_zeroes(span<const byte>(dst_frame,
|
||||
node.space->physical_size()))
|
||||
&& (key_version || node.space->is_compressed()
|
||||
|| node.space->purpose == FIL_TYPE_TEMPORARY)) {
|
||||
|| node.space->is_temporary())) {
|
||||
if (buf_page_full_crc32_is_corrupted(
|
||||
bpage->id().space(), dst_frame,
|
||||
node.space->is_compressed())) {
|
||||
|
|
|
@ -745,7 +745,8 @@ void buf_dblwr_t::add_to_batch(const IORequest &request, size_t size)
|
|||
ut_ad(request.bpage);
|
||||
ut_ad(request.bpage->in_file());
|
||||
ut_ad(request.node);
|
||||
ut_ad(request.node->space->purpose == FIL_TYPE_TABLESPACE);
|
||||
ut_ad(!request.node->space->is_temporary());
|
||||
ut_ad(!request.node->space->is_being_imported());
|
||||
ut_ad(request.node->space->id == request.bpage->id().space());
|
||||
ut_ad(request.node->space->referenced());
|
||||
ut_ad(!srv_read_only_mode);
|
||||
|
|
|
@ -601,7 +601,7 @@ static byte *buf_page_encrypt(fil_space_t* space, buf_page_t* bpage, byte* s,
|
|||
|
||||
fil_space_crypt_t *crypt_data= space->crypt_data;
|
||||
bool encrypted, page_compressed;
|
||||
if (space->purpose == FIL_TYPE_TEMPORARY)
|
||||
if (space->is_temporary())
|
||||
{
|
||||
ut_ad(!crypt_data);
|
||||
encrypted= innodb_encrypt_temporary_tables;
|
||||
|
@ -647,13 +647,13 @@ static byte *buf_page_encrypt(fil_space_t* space, buf_page_t* bpage, byte* s,
|
|||
if (!page_compressed)
|
||||
{
|
||||
not_compressed:
|
||||
d= space->purpose == FIL_TYPE_TEMPORARY
|
||||
d= space->is_temporary()
|
||||
? buf_tmp_page_encrypt(page_no, s, d)
|
||||
: fil_space_encrypt(space, page_no, s, d);
|
||||
}
|
||||
else
|
||||
{
|
||||
ut_ad(space->purpose != FIL_TYPE_TEMPORARY);
|
||||
ut_ad(!space->is_temporary());
|
||||
/* First we compress the page content */
|
||||
buf_tmp_reserve_compression_buf(*slot);
|
||||
byte *tmp= (*slot)->comp_buf;
|
||||
|
@ -730,8 +730,7 @@ bool buf_page_t::flush(fil_space_t *space)
|
|||
mysql_mutex_assert_not_owner(&buf_pool.flush_list_mutex);
|
||||
ut_ad(in_file());
|
||||
ut_ad(in_LRU_list);
|
||||
ut_ad((space->purpose == FIL_TYPE_TEMPORARY) ==
|
||||
(space == fil_system.temp_space));
|
||||
ut_ad((space->is_temporary()) == (space == fil_system.temp_space));
|
||||
ut_ad(space->referenced());
|
||||
|
||||
const auto s= state();
|
||||
|
@ -741,12 +740,12 @@ bool buf_page_t::flush(fil_space_t *space)
|
|||
(FIL_PAGE_LSN + (zip.data ? zip.data : frame)));
|
||||
ut_ad(lsn
|
||||
? lsn >= oldest_modification() || oldest_modification() == 2
|
||||
: space->purpose != FIL_TYPE_TABLESPACE);
|
||||
: (space->is_temporary() || space->is_being_imported()));
|
||||
|
||||
if (s < UNFIXED)
|
||||
{
|
||||
ut_a(s >= FREED);
|
||||
if (UNIV_LIKELY(space->purpose == FIL_TYPE_TABLESPACE))
|
||||
if (!space->is_temporary() && !space->is_being_imported())
|
||||
{
|
||||
freed:
|
||||
if (lsn > log_sys.get_flushed_lsn())
|
||||
|
@ -762,7 +761,8 @@ bool buf_page_t::flush(fil_space_t *space)
|
|||
|
||||
if (UNIV_UNLIKELY(lsn < space->get_create_lsn()))
|
||||
{
|
||||
ut_ad(space->purpose == FIL_TYPE_TABLESPACE);
|
||||
ut_ad(!space->is_temporary());
|
||||
ut_ad(!space->is_being_imported());
|
||||
goto freed;
|
||||
}
|
||||
|
||||
|
@ -846,7 +846,7 @@ bool buf_page_t::flush(fil_space_t *space)
|
|||
|
||||
if ((s & LRU_MASK) == REINIT || !space->use_doublewrite())
|
||||
{
|
||||
if (UNIV_LIKELY(space->purpose == FIL_TYPE_TABLESPACE) &&
|
||||
if (!space->is_temporary() && !space->is_being_imported() &&
|
||||
lsn > log_sys.get_flushed_lsn())
|
||||
log_write_up_to(lsn, true);
|
||||
space->io(IORequest{type, this, slot}, physical_offset(), size,
|
||||
|
@ -1697,7 +1697,7 @@ done:
|
|||
if (acquired)
|
||||
space->release();
|
||||
|
||||
if (space->purpose == FIL_TYPE_IMPORT)
|
||||
if (space->is_being_imported())
|
||||
os_aio_wait_until_no_pending_writes(true);
|
||||
else
|
||||
buf_dblwr.flush_buffered_writes();
|
||||
|
|
|
@ -970,8 +970,10 @@ void dict_check_tablespaces_and_store_max_id(const std::set<uint32_t> *spaces)
|
|||
const bool not_dropped{!rec_get_deleted_flag(rec, 0)};
|
||||
|
||||
/* Check that the .ibd file exists. */
|
||||
if (fil_ibd_open(not_dropped, FIL_TYPE_TABLESPACE,
|
||||
space_id, dict_tf_to_fsp_flags(flags),
|
||||
if (fil_ibd_open(space_id, dict_tf_to_fsp_flags(flags),
|
||||
not_dropped
|
||||
? fil_space_t::VALIDATE_NOTHING
|
||||
: fil_space_t::MAYBE_MISSING,
|
||||
name, filepath)) {
|
||||
} else if (!not_dropped) {
|
||||
} else if (srv_operation == SRV_OPERATION_NORMAL
|
||||
|
@ -2289,8 +2291,8 @@ dict_load_tablespace(
|
|||
}
|
||||
|
||||
table->space = fil_ibd_open(
|
||||
2, FIL_TYPE_TABLESPACE, table->space_id,
|
||||
dict_tf_to_fsp_flags(table->flags),
|
||||
table->space_id, dict_tf_to_fsp_flags(table->flags),
|
||||
fil_space_t::VALIDATE_SPACE_ID,
|
||||
{table->name.m_name, strlen(table->name.m_name)}, filepath);
|
||||
|
||||
if (!table->space) {
|
||||
|
|
|
@ -136,9 +136,6 @@ dict_table_t *dict_table_t::create(const span<const char> &name,
|
|||
ulint n_cols, ulint n_v_cols, ulint flags,
|
||||
ulint flags2)
|
||||
{
|
||||
ut_ad(!space || space->purpose == FIL_TYPE_TABLESPACE ||
|
||||
space->purpose == FIL_TYPE_TEMPORARY ||
|
||||
space->purpose == FIL_TYPE_IMPORT);
|
||||
ut_a(dict_tf2_is_valid(flags, flags2));
|
||||
ut_a(!(flags2 & DICT_TF2_UNUSED_BIT_MASK));
|
||||
|
||||
|
|
|
@ -1068,7 +1068,8 @@ default_encrypt_list only when
|
|||
default encrypt */
|
||||
static bool fil_crypt_must_remove(const fil_space_t &space)
|
||||
{
|
||||
ut_ad(space.purpose == FIL_TYPE_TABLESPACE);
|
||||
ut_ad(!space.is_temporary());
|
||||
ut_ad(!space.is_being_imported());
|
||||
fil_space_crypt_t *crypt_data = space.crypt_data;
|
||||
mysql_mutex_assert_owner(&fil_system.mutex);
|
||||
const ulong encrypt_tables= srv_encrypt_tables;
|
||||
|
@ -1104,7 +1105,8 @@ fil_crypt_space_needs_rotation(
|
|||
fil_space_t* space = &*state->space;
|
||||
|
||||
ut_ad(space->referenced());
|
||||
ut_ad(space->purpose == FIL_TYPE_TABLESPACE);
|
||||
ut_ad(!space->is_temporary());
|
||||
ut_ad(!space->is_being_imported());
|
||||
|
||||
fil_space_crypt_t *crypt_data = space->crypt_data;
|
||||
|
||||
|
@ -1456,7 +1458,7 @@ space_list_t::iterator fil_space_t::next(space_list_t::iterator space,
|
|||
|
||||
for (; space != fil_system.space_list.end(); ++space)
|
||||
{
|
||||
if (space->purpose != FIL_TYPE_TABLESPACE)
|
||||
if (space->is_temporary() || space->is_being_imported())
|
||||
continue;
|
||||
const uint32_t n= space->acquire_low();
|
||||
if (UNIV_LIKELY(!(n & (STOPPING | CLOSING))))
|
||||
|
@ -2138,9 +2140,9 @@ static void fil_crypt_default_encrypt_tables_fill()
|
|||
mysql_mutex_assert_owner(&fil_system.mutex);
|
||||
|
||||
for (fil_space_t& space : fil_system.space_list) {
|
||||
if (space.purpose != FIL_TYPE_TABLESPACE
|
||||
|| space.is_in_default_encrypt
|
||||
if (space.is_in_default_encrypt
|
||||
|| UT_LIST_GET_LEN(space.chain) == 0
|
||||
|| space.is_temporary() || space.is_being_imported()
|
||||
|| !space.acquire_if_not_stopped()) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -78,17 +78,11 @@ bool fil_space_t::try_to_close(fil_space_t *ignore_space, bool print_info)
|
|||
mysql_mutex_assert_owner(&fil_system.mutex);
|
||||
for (fil_space_t &space : fil_system.space_list)
|
||||
{
|
||||
if (&space == ignore_space)
|
||||
if (&space == ignore_space || space.is_being_imported() ||
|
||||
space.id == TRX_SYS_SPACE || space.id == SRV_TMP_SPACE_ID ||
|
||||
srv_is_undo_tablespace(space.id))
|
||||
continue;
|
||||
switch (space.purpose) {
|
||||
case FIL_TYPE_TEMPORARY:
|
||||
continue;
|
||||
case FIL_TYPE_IMPORT:
|
||||
break;
|
||||
case FIL_TYPE_TABLESPACE:
|
||||
if (space.id == TRX_SYS_SPACE || srv_is_undo_tablespace(space.id))
|
||||
continue;
|
||||
}
|
||||
ut_ad(!space.is_temporary());
|
||||
|
||||
/* We are using an approximation of LRU replacement policy. In
|
||||
fil_node_open_file_low(), newly opened files are moved to the end
|
||||
|
@ -435,7 +429,7 @@ static bool fil_node_open_file(fil_node_t *node, const byte *page, bool no_lsn)
|
|||
srv_operation == SRV_OPERATION_BACKUP ||
|
||||
srv_operation == SRV_OPERATION_RESTORE ||
|
||||
srv_operation == SRV_OPERATION_RESTORE_DELTA);
|
||||
ut_ad(node->space->purpose != FIL_TYPE_TEMPORARY);
|
||||
ut_ad(!node->space->is_temporary());
|
||||
ut_ad(node->space->referenced());
|
||||
|
||||
const auto old_time= fil_system.n_open_exceeded_time;
|
||||
|
@ -496,7 +490,7 @@ void fil_node_t::prepare_to_close_or_detach()
|
|||
srv_operation == SRV_OPERATION_RESTORE_DELTA);
|
||||
ut_a(is_open());
|
||||
ut_a(!being_extended);
|
||||
ut_a(space->is_ready_to_close() || space->purpose == FIL_TYPE_TEMPORARY ||
|
||||
ut_a(space->is_ready_to_close() || space->is_temporary() ||
|
||||
srv_fast_shutdown == 2 || !srv_was_started);
|
||||
|
||||
ut_a(fil_system.n_open > 0);
|
||||
|
@ -653,14 +647,13 @@ fil_space_extend_must_retry(
|
|||
mysql_mutex_lock(&fil_system.mutex);
|
||||
break;
|
||||
default:
|
||||
ut_ad(space->purpose == FIL_TYPE_TABLESPACE
|
||||
|| space->purpose == FIL_TYPE_IMPORT);
|
||||
if (space->purpose == FIL_TYPE_TABLESPACE) {
|
||||
ut_ad(!space->is_temporary());
|
||||
if (!space->is_being_imported()) {
|
||||
goto do_flush;
|
||||
}
|
||||
break;
|
||||
case SRV_TMP_SPACE_ID:
|
||||
ut_ad(space->purpose == FIL_TYPE_TEMPORARY);
|
||||
ut_ad(space->is_temporary());
|
||||
srv_tmp_space.set_last_file_size(pages_in_MiB);
|
||||
break;
|
||||
}
|
||||
|
@ -674,8 +667,7 @@ ATTRIBUTE_COLD bool fil_space_t::prepare_acquired()
|
|||
ut_ad(referenced());
|
||||
mysql_mutex_assert_owner(&fil_system.mutex);
|
||||
fil_node_t *node= UT_LIST_GET_LAST(chain);
|
||||
ut_ad(!id || purpose == FIL_TYPE_TEMPORARY ||
|
||||
node == UT_LIST_GET_FIRST(chain));
|
||||
ut_ad(!id || is_temporary() || node == UT_LIST_GET_FIRST(chain));
|
||||
|
||||
const bool is_open= node &&
|
||||
(node->is_open() || fil_node_open_file(node, nullptr, false));
|
||||
|
@ -737,7 +729,7 @@ ATTRIBUTE_COLD bool fil_space_t::acquire_and_prepare()
|
|||
@return whether the tablespace is at least as big as requested */
|
||||
bool fil_space_extend(fil_space_t *space, uint32_t size)
|
||||
{
|
||||
ut_ad(!srv_read_only_mode || space->purpose == FIL_TYPE_TEMPORARY);
|
||||
ut_ad(!srv_read_only_mode || space->is_temporary());
|
||||
bool success= false;
|
||||
const bool acquired= space->acquire();
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
|
@ -944,111 +936,85 @@ bool fil_space_free(uint32_t id, bool x_latched)
|
|||
return(space != NULL);
|
||||
}
|
||||
|
||||
/** Create a tablespace in fil_system.
|
||||
@param name tablespace name
|
||||
@param id tablespace identifier
|
||||
@param flags tablespace flags
|
||||
@param purpose tablespace purpose
|
||||
@param crypt_data encryption information
|
||||
@param mode encryption mode
|
||||
@param opened true if space files are opened
|
||||
@return pointer to created tablespace, to be filled in with add()
|
||||
@retval nullptr on failure (such as when the same tablespace exists) */
|
||||
fil_space_t *fil_space_t::create(uint32_t id, uint32_t flags,
|
||||
fil_type_t purpose,
|
||||
fil_space_crypt_t *crypt_data,
|
||||
fil_encryption_t mode,
|
||||
bool opened)
|
||||
fil_space_t::fil_space_t(uint32_t id, uint32_t flags, bool being_imported,
|
||||
fil_space_crypt_t *crypt_data) noexcept :
|
||||
id(id), crypt_data(crypt_data), being_imported(being_imported), flags(flags)
|
||||
{
|
||||
fil_space_t* space;
|
||||
UT_LIST_INIT(chain, &fil_node_t::chain);
|
||||
memset((void*) &latch, 0, sizeof latch);
|
||||
latch.SRW_LOCK_INIT(fil_space_latch_key);
|
||||
}
|
||||
|
||||
mysql_mutex_assert_owner(&fil_system.mutex);
|
||||
ut_ad(fil_system.is_initialised());
|
||||
ut_ad(fil_space_t::is_valid_flags(flags & ~FSP_FLAGS_MEM_MASK, id));
|
||||
ut_ad(srv_page_size == UNIV_PAGE_SIZE_ORIG || flags != 0);
|
||||
fil_space_t *fil_space_t::create(uint32_t id, uint32_t flags,
|
||||
bool being_imported,
|
||||
fil_space_crypt_t *crypt_data,
|
||||
fil_encryption_t mode,
|
||||
bool opened) noexcept
|
||||
{
|
||||
mysql_mutex_assert_owner(&fil_system.mutex);
|
||||
ut_ad(fil_system.is_initialised());
|
||||
ut_ad(fil_space_t::is_valid_flags(flags & ~FSP_FLAGS_MEM_MASK, id));
|
||||
ut_ad(srv_page_size == UNIV_PAGE_SIZE_ORIG || flags != 0);
|
||||
|
||||
DBUG_EXECUTE_IF("fil_space_create_failure", return(NULL););
|
||||
DBUG_EXECUTE_IF("fil_space_create_failure", return nullptr;);
|
||||
|
||||
fil_space_t** after = reinterpret_cast<fil_space_t**>(
|
||||
&fil_system.spaces.cell_get(id)->node);
|
||||
for (; *after; after = &(*after)->hash) {
|
||||
ut_a((*after)->id != id);
|
||||
}
|
||||
fil_space_t** after= fil_system.spaces.cell_get(id)->search
|
||||
(&fil_space_t::hash, [id](const fil_space_t *space)
|
||||
{ return !space || space->id == id; });
|
||||
ut_a(!*after);
|
||||
fil_space_t *space= new (ut_malloc_nokey(sizeof(*space)))
|
||||
fil_space_t(id, flags, being_imported, crypt_data);
|
||||
*after= space;
|
||||
|
||||
/* FIXME: if calloc() is defined as an inline function that calls
|
||||
memset() or bzero(), then GCC 6 -flifetime-dse can optimize it away */
|
||||
*after = space = new (ut_zalloc_nokey(sizeof(*space))) fil_space_t;
|
||||
if (crypt_data)
|
||||
DBUG_PRINT("crypt", ("Tablespace %" PRIu32 " encryption %d key id %" PRIu32
|
||||
":%s %s",
|
||||
id, crypt_data->encryption, crypt_data->key_id,
|
||||
fil_crypt_get_mode(crypt_data),
|
||||
fil_crypt_get_type(crypt_data)));
|
||||
|
||||
space->id = id;
|
||||
if (opened)
|
||||
fil_system.add_opened_last_to_space_list(space);
|
||||
else
|
||||
fil_system.space_list.push_back(*space);
|
||||
|
||||
UT_LIST_INIT(space->chain, &fil_node_t::chain);
|
||||
switch (id) {
|
||||
case 0:
|
||||
ut_ad(!fil_system.sys_space);
|
||||
fil_system.sys_space= space;
|
||||
break;
|
||||
case SRV_TMP_SPACE_ID:
|
||||
ut_ad(!fil_system.temp_space);
|
||||
fil_system.temp_space= space;
|
||||
return space;
|
||||
default:
|
||||
if (UNIV_LIKELY(id <= fil_system.max_assigned_id))
|
||||
break;
|
||||
if (UNIV_UNLIKELY(srv_operation == SRV_OPERATION_BACKUP))
|
||||
break;
|
||||
if (!fil_system.space_id_reuse_warned)
|
||||
sql_print_warning("InnoDB: Allocated tablespace ID %" PRIu32
|
||||
", old maximum was %" PRIu32,
|
||||
id, fil_system.max_assigned_id);
|
||||
fil_system.max_assigned_id = id;
|
||||
}
|
||||
|
||||
space->purpose = purpose;
|
||||
space->flags = flags;
|
||||
if ((mode == FIL_ENCRYPTION_ON ||
|
||||
(mode == FIL_ENCRYPTION_OFF || srv_encrypt_tables)) &&
|
||||
!space->is_being_imported() && fil_crypt_must_default_encrypt())
|
||||
{
|
||||
fil_system.default_encrypt_tables.push_back(*space);
|
||||
space->is_in_default_encrypt= true;
|
||||
|
||||
space->crypt_data = crypt_data;
|
||||
space->n_pending.store(CLOSING, std::memory_order_relaxed);
|
||||
if (srv_n_fil_crypt_threads_started)
|
||||
{
|
||||
mysql_mutex_unlock(&fil_system.mutex);
|
||||
fil_crypt_threads_signal();
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
}
|
||||
}
|
||||
|
||||
DBUG_LOG("tablespace", "Created metadata for " << id);
|
||||
if (crypt_data) {
|
||||
DBUG_LOG("crypt",
|
||||
"Tablespace " << id
|
||||
<< " encryption " << crypt_data->encryption
|
||||
<< " key id " << crypt_data->key_id
|
||||
<< ":" << fil_crypt_get_mode(crypt_data)
|
||||
<< " " << fil_crypt_get_type(crypt_data));
|
||||
}
|
||||
|
||||
space->latch.SRW_LOCK_INIT(fil_space_latch_key);
|
||||
|
||||
if (opened)
|
||||
fil_system.add_opened_last_to_space_list(space);
|
||||
else
|
||||
fil_system.space_list.push_back(*space);
|
||||
|
||||
switch (id) {
|
||||
case 0:
|
||||
ut_ad(!fil_system.sys_space);
|
||||
fil_system.sys_space = space;
|
||||
break;
|
||||
case SRV_TMP_SPACE_ID:
|
||||
ut_ad(!fil_system.temp_space);
|
||||
fil_system.temp_space = space;
|
||||
break;
|
||||
default:
|
||||
ut_ad(purpose != FIL_TYPE_TEMPORARY);
|
||||
if (UNIV_LIKELY(id <= fil_system.max_assigned_id)) {
|
||||
break;
|
||||
}
|
||||
if (UNIV_UNLIKELY(srv_operation == SRV_OPERATION_BACKUP)) {
|
||||
break;
|
||||
}
|
||||
if (!fil_system.space_id_reuse_warned) {
|
||||
ib::warn() << "Allocated tablespace ID " << id
|
||||
<< ", old maximum was "
|
||||
<< fil_system.max_assigned_id;
|
||||
}
|
||||
|
||||
fil_system.max_assigned_id = id;
|
||||
}
|
||||
|
||||
const bool rotate = purpose == FIL_TYPE_TABLESPACE
|
||||
&& (mode == FIL_ENCRYPTION_ON || mode == FIL_ENCRYPTION_OFF
|
||||
|| srv_encrypt_tables)
|
||||
&& fil_crypt_must_default_encrypt();
|
||||
|
||||
if (rotate) {
|
||||
fil_system.default_encrypt_tables.push_back(*space);
|
||||
space->is_in_default_encrypt = true;
|
||||
|
||||
if (srv_n_fil_crypt_threads_started) {
|
||||
mysql_mutex_unlock(&fil_system.mutex);
|
||||
fil_crypt_threads_signal();
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
}
|
||||
}
|
||||
|
||||
return(space);
|
||||
return space;
|
||||
}
|
||||
|
||||
/*******************************************************************//**
|
||||
|
@ -1531,6 +1497,7 @@ static void fil_name_write(uint32_t space_id, const char *name,
|
|||
fil_space_t *fil_space_t::drop(uint32_t id, pfs_os_file_t *detached_handle)
|
||||
{
|
||||
ut_a(!is_system_tablespace(id));
|
||||
ut_ad(id != SRV_TMP_SPACE_ID);
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
fil_space_t *space= fil_space_get_by_id(id);
|
||||
|
||||
|
@ -1573,7 +1540,7 @@ fil_space_t *fil_space_t::drop(uint32_t id, pfs_os_file_t *detached_handle)
|
|||
if (space->crypt_data)
|
||||
fil_space_crypt_close_tablespace(space);
|
||||
|
||||
if (space->purpose == FIL_TYPE_TABLESPACE)
|
||||
if (!space->is_being_imported())
|
||||
{
|
||||
if (id >= srv_undo_space_id_start &&
|
||||
id < srv_undo_space_id_start + srv_undo_tablespaces_open)
|
||||
|
@ -1593,8 +1560,6 @@ fil_space_t *fil_space_t::drop(uint32_t id, pfs_os_file_t *detached_handle)
|
|||
|
||||
os_file_delete(innodb_data_file_key, space->chain.start->name);
|
||||
}
|
||||
else
|
||||
ut_ad(space->purpose == FIL_TYPE_IMPORT);
|
||||
|
||||
if (char *cfg_name= fil_make_filepath(space->chain.start->name,
|
||||
fil_space_t::name_type{}, CFG, false))
|
||||
|
@ -1894,7 +1859,7 @@ fil_ibd_create(
|
|||
uint32_t size,
|
||||
fil_encryption_t mode,
|
||||
uint32_t key_id,
|
||||
dberr_t* err)
|
||||
dberr_t* err) noexcept
|
||||
{
|
||||
pfs_os_file_t file;
|
||||
bool success;
|
||||
|
@ -2017,8 +1982,8 @@ err_exit:
|
|||
log_make_checkpoint(););
|
||||
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
if (fil_space_t* space = fil_space_t::create(space_id, flags,
|
||||
FIL_TYPE_TABLESPACE,
|
||||
if (fil_space_t* space = fil_space_t::create(space_id,
|
||||
flags, false,
|
||||
crypt_data, mode, true)) {
|
||||
fil_node_t* node = space->add(path, file, size, false, true);
|
||||
node->find_metadata(IF_WIN(,true));
|
||||
|
@ -2040,51 +2005,17 @@ err_exit:
|
|||
goto err_exit;
|
||||
}
|
||||
|
||||
/** Try to open a single-table tablespace and optionally check that the
|
||||
space id in it is correct. If this does not succeed, print an error message
|
||||
to the .err log. This function is used to open a tablespace when we start
|
||||
mysqld after the dictionary has been booted, and also in IMPORT TABLESPACE.
|
||||
|
||||
NOTE that we assume this operation is used either at the database startup
|
||||
or under the protection of dict_sys.latch, so that two users cannot
|
||||
race here. This operation does not leave the file associated with the
|
||||
tablespace open, but closes it after we have looked at the space id in it.
|
||||
|
||||
If the validate boolean is set, we read the first page of the file and
|
||||
check that the space id in the file is what we expect. We assume that
|
||||
this function runs much faster if no check is made, since accessing the
|
||||
file inode probably is much faster (the OS caches them) than accessing
|
||||
the first page of the file. This boolean may be initially false, but if
|
||||
a remote tablespace is found it will be changed to true.
|
||||
|
||||
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 0=maybe missing, 1=do not validate, 2=validate
|
||||
@param[in] purpose FIL_TYPE_TABLESPACE or FIL_TYPE_TEMPORARY
|
||||
@param[in] id tablespace ID
|
||||
@param[in] flags expected FSP_SPACE_FLAGS
|
||||
@param[in] name table name
|
||||
If file-per-table, it is the table name in the databasename/tablename format
|
||||
@param[in] path_in expected filepath, usually read from dictionary
|
||||
@param[out] err DB_SUCCESS or error code
|
||||
@return tablespace
|
||||
@retval NULL if the tablespace could not be opened */
|
||||
fil_space_t*
|
||||
fil_ibd_open(
|
||||
unsigned validate,
|
||||
fil_type_t purpose,
|
||||
uint32_t id,
|
||||
uint32_t flags,
|
||||
fil_space_t::name_type name,
|
||||
const char* path_in,
|
||||
dberr_t* err)
|
||||
fil_space_t *fil_ibd_open(uint32_t id, uint32_t flags,
|
||||
fil_space_t::validate validate,
|
||||
fil_space_t::name_type name,
|
||||
const char *path_in, dberr_t *err) noexcept
|
||||
{
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
fil_space_t* space = fil_space_get_by_id(id);
|
||||
mysql_mutex_unlock(&fil_system.mutex);
|
||||
if (space) {
|
||||
if (validate > 1 && !srv_read_only_mode) {
|
||||
if (validate == fil_space_t::VALIDATE_SPACE_ID
|
||||
&& !srv_read_only_mode) {
|
||||
fsp_flags_try_adjust(space,
|
||||
flags & ~FSP_FLAGS_MEM_MASK);
|
||||
}
|
||||
|
@ -2140,7 +2071,7 @@ func_exit:
|
|||
/* Dict path is not the default path. Always validate
|
||||
remote files. If default is opened, it was moved. */
|
||||
must_validate = true;
|
||||
} else if (validate > 1) {
|
||||
} else if (validate >= fil_space_t::VALIDATE_SPACE_ID) {
|
||||
must_validate = true;
|
||||
}
|
||||
|
||||
|
@ -2157,7 +2088,8 @@ func_exit:
|
|||
the first server startup. The tables ought to be dropped by
|
||||
drop_garbage_tables_after_restore() a little later. */
|
||||
|
||||
const bool strict = validate && !tablespaces_found
|
||||
const bool strict = (validate != fil_space_t::MAYBE_MISSING)
|
||||
&& !tablespaces_found
|
||||
&& operation_not_for_export
|
||||
&& !(srv_operation == SRV_OPERATION_NORMAL
|
||||
&& srv_start_after_restore
|
||||
|
@ -2288,7 +2220,9 @@ skip_validate:
|
|||
: NULL;
|
||||
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
space = fil_space_t::create(id, flags, purpose, crypt_data);
|
||||
space = fil_space_t::create(id, flags,
|
||||
validate == fil_space_t::VALIDATE_IMPORT,
|
||||
crypt_data);
|
||||
if (!space) {
|
||||
mysql_mutex_unlock(&fil_system.mutex);
|
||||
goto error;
|
||||
|
@ -2306,7 +2240,7 @@ skip_validate:
|
|||
df_remote.close();
|
||||
df_default.close();
|
||||
if (space->acquire()) {
|
||||
if (purpose != FIL_TYPE_IMPORT) {
|
||||
if (validate < fil_space_t::VALIDATE_IMPORT) {
|
||||
fsp_flags_try_adjust(space, flags
|
||||
& ~FSP_FLAGS_MEM_MASK);
|
||||
}
|
||||
|
@ -2591,8 +2525,8 @@ tablespace_check:
|
|||
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
|
||||
space = fil_space_t::create(
|
||||
space_id, flags, FIL_TYPE_TABLESPACE, crypt_data);
|
||||
space = fil_space_t::create(uint32_t(space_id), flags, false,
|
||||
crypt_data);
|
||||
|
||||
if (space == NULL) {
|
||||
mysql_mutex_unlock(&fil_system.mutex);
|
||||
|
@ -2620,16 +2554,14 @@ void fsp_flags_try_adjust(fil_space_t *space, uint32_t flags)
|
|||
{
|
||||
ut_ad(!srv_read_only_mode);
|
||||
ut_ad(fil_space_t::is_valid_flags(flags, space->id));
|
||||
ut_ad(!space->is_being_imported());
|
||||
ut_ad(!space->is_temporary());
|
||||
if (space->full_crc32() || fil_space_t::full_crc32(flags)) {
|
||||
return;
|
||||
}
|
||||
if (!space->size && (space->purpose != FIL_TYPE_TABLESPACE
|
||||
|| !space->get_size())) {
|
||||
if (!space->size || !space->get_size()) {
|
||||
return;
|
||||
}
|
||||
/* This code is executed during server startup while no
|
||||
connections are allowed. We do not need to protect against
|
||||
DROP TABLE by fil_space_acquire(). */
|
||||
mtr_t mtr;
|
||||
mtr.start();
|
||||
if (buf_block_t* b = buf_page_get(
|
||||
|
@ -2720,7 +2652,7 @@ inline void fil_node_t::complete_write()
|
|||
{
|
||||
mysql_mutex_assert_not_owner(&fil_system.mutex);
|
||||
|
||||
if (space->purpose != FIL_TYPE_TEMPORARY &&
|
||||
if (!space->is_temporary() &&
|
||||
srv_file_flush_method != SRV_O_DIRECT_NO_FSYNC &&
|
||||
space->set_needs_flush())
|
||||
{
|
||||
|
@ -3034,8 +2966,8 @@ fil_space_validate_for_mtr_commit(
|
|||
{
|
||||
mysql_mutex_assert_not_owner(&fil_system.mutex);
|
||||
ut_ad(space != NULL);
|
||||
ut_ad(space->purpose == FIL_TYPE_TABLESPACE);
|
||||
ut_ad(!is_predefined_tablespace(space->id));
|
||||
ut_ad(!space->is_being_imported());
|
||||
|
||||
/* We are serving mtr_commit(). While there is an active
|
||||
mini-transaction, we should have !space->is_stopping(). This is
|
||||
|
@ -3218,7 +3150,7 @@ fil_space_t::name_type fil_space_t::name() const
|
|||
if (!UT_LIST_GET_FIRST(chain) || srv_is_undo_tablespace(id))
|
||||
return name_type{};
|
||||
|
||||
ut_ad(purpose != FIL_TYPE_TEMPORARY);
|
||||
ut_ad(!is_temporary());
|
||||
ut_ad(UT_LIST_GET_LEN(chain) == 1);
|
||||
|
||||
const char *path= UT_LIST_GET_FIRST(chain)->name;
|
||||
|
|
|
@ -350,7 +350,7 @@ xdes_get_descriptor_with_space_hdr(
|
|||
ut_ad(limit == space->free_limit
|
||||
|| (space->free_limit == 0
|
||||
&& (init_space
|
||||
|| space->purpose == FIL_TYPE_TEMPORARY
|
||||
|| space->is_temporary()
|
||||
|| (srv_startup_is_before_trx_rollback_phase
|
||||
&& (space->id == TRX_SYS_SPACE
|
||||
|| srv_is_undo_tablespace(space->id))))));
|
||||
|
@ -486,14 +486,15 @@ void fil_space_t::modify_check(const mtr_t& mtr) const
|
|||
case MTR_LOG_NONE:
|
||||
/* These modes are only allowed within a non-bitmap page
|
||||
when there is a higher-level redo log record written. */
|
||||
ut_ad(purpose == FIL_TYPE_TABLESPACE || purpose == FIL_TYPE_TEMPORARY);
|
||||
ut_ad(!is_being_imported());
|
||||
break;
|
||||
case MTR_LOG_NO_REDO:
|
||||
ut_ad(purpose == FIL_TYPE_TEMPORARY || purpose == FIL_TYPE_IMPORT);
|
||||
ut_ad(is_temporary() || is_being_imported());
|
||||
break;
|
||||
default:
|
||||
/* We may only write redo log for a persistent tablespace. */
|
||||
ut_ad(purpose == FIL_TYPE_TABLESPACE);
|
||||
ut_ad(!is_temporary());
|
||||
ut_ad(!is_being_imported());
|
||||
ut_ad(mtr.is_named_space(id));
|
||||
}
|
||||
}
|
||||
|
@ -852,7 +853,7 @@ fsp_fill_free_list(
|
|||
FIL_PAGE_TYPE_XDES);
|
||||
}
|
||||
|
||||
if (space->purpose != FIL_TYPE_TEMPORARY)
|
||||
if (!space->is_temporary())
|
||||
{
|
||||
buf_block_t *f= buf_LRU_get_free_block(false);
|
||||
buf_block_t *block=
|
||||
|
|
|
@ -132,10 +132,8 @@ Tablespace::open_or_create(bool is_temp)
|
|||
|
||||
mysql_mutex_lock(&fil_system.mutex);
|
||||
space = fil_space_t::create(
|
||||
m_space_id, fsp_flags,
|
||||
is_temp
|
||||
? FIL_TYPE_TEMPORARY : FIL_TYPE_TABLESPACE,
|
||||
NULL);
|
||||
uint32_t(m_space_id), fsp_flags,
|
||||
false, nullptr);
|
||||
if (!space) {
|
||||
mysql_mutex_unlock(&fil_system.mutex);
|
||||
return DB_ERROR;
|
||||
|
|
|
@ -953,8 +953,7 @@ SysTablespace::open_or_create(
|
|||
} else if (is_temp) {
|
||||
ut_ad(space_id() == SRV_TMP_SPACE_ID);
|
||||
space = fil_space_t::create(
|
||||
SRV_TMP_SPACE_ID, flags(),
|
||||
FIL_TYPE_TEMPORARY, NULL);
|
||||
SRV_TMP_SPACE_ID, flags(), false, nullptr);
|
||||
ut_ad(space == fil_system.temp_space);
|
||||
if (!space) {
|
||||
err = DB_ERROR;
|
||||
|
@ -965,8 +964,7 @@ SysTablespace::open_or_create(
|
|||
} else {
|
||||
ut_ad(space_id() == TRX_SYS_SPACE);
|
||||
space = fil_space_t::create(
|
||||
TRX_SYS_SPACE, it->flags(),
|
||||
FIL_TYPE_TABLESPACE, NULL);
|
||||
TRX_SYS_SPACE, it->flags(), false, nullptr);
|
||||
ut_ad(space == fil_system.sys_space);
|
||||
if (!space) {
|
||||
err = DB_ERROR;
|
||||
|
|
|
@ -2211,7 +2211,7 @@ fts_savepoint_t*
|
|||
fts_savepoint_create(
|
||||
/*=================*/
|
||||
ib_vector_t* savepoints, /*!< out: InnoDB transaction */
|
||||
const char* name, /*!< in: savepoint name */
|
||||
const void* name, /*!< in: savepoint */
|
||||
mem_heap_t* heap) /*!< in: heap */
|
||||
{
|
||||
fts_savepoint_t* savepoint;
|
||||
|
@ -2220,11 +2220,7 @@ fts_savepoint_create(
|
|||
ib_vector_push(savepoints, NULL));
|
||||
|
||||
memset(savepoint, 0x0, sizeof(*savepoint));
|
||||
|
||||
if (name) {
|
||||
savepoint->name = mem_heap_strdup(heap, name);
|
||||
}
|
||||
|
||||
savepoint->name = name;
|
||||
static_assert(!offsetof(fts_trx_table_t, table), "ABI");
|
||||
savepoint->tables = rbt_create(sizeof(fts_trx_table_t*), fts_ptr2_cmp);
|
||||
|
||||
|
@ -2243,7 +2239,6 @@ fts_trx_create(
|
|||
fts_trx_t* ftt;
|
||||
ib_alloc_t* heap_alloc;
|
||||
mem_heap_t* heap = mem_heap_create(1024);
|
||||
trx_named_savept_t* savep;
|
||||
|
||||
ut_a(trx->fts_trx == NULL);
|
||||
|
||||
|
@ -2263,14 +2258,6 @@ fts_trx_create(
|
|||
fts_savepoint_create(ftt->savepoints, NULL, NULL);
|
||||
fts_savepoint_create(ftt->last_stmt, NULL, NULL);
|
||||
|
||||
/* Copy savepoints that already set before. */
|
||||
for (savep = UT_LIST_GET_FIRST(trx->trx_savepoints);
|
||||
savep != NULL;
|
||||
savep = UT_LIST_GET_NEXT(trx_savepoints, savep)) {
|
||||
|
||||
fts_savepoint_take(ftt, savep->name);
|
||||
}
|
||||
|
||||
return(ftt);
|
||||
}
|
||||
|
||||
|
@ -5410,7 +5397,7 @@ void
|
|||
fts_savepoint_take(
|
||||
/*===============*/
|
||||
fts_trx_t* fts_trx, /*!< in: fts transaction */
|
||||
const char* name) /*!< in: savepoint name */
|
||||
const void* name) /*!< in: savepoint */
|
||||
{
|
||||
mem_heap_t* heap;
|
||||
fts_savepoint_t* savepoint;
|
||||
|
@ -5433,31 +5420,21 @@ fts_savepoint_take(
|
|||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
Lookup a savepoint instance by name.
|
||||
@return ULINT_UNDEFINED if not found */
|
||||
UNIV_INLINE
|
||||
Lookup a savepoint instance.
|
||||
@return 0 if not found */
|
||||
static
|
||||
ulint
|
||||
fts_savepoint_lookup(
|
||||
/*==================*/
|
||||
ib_vector_t* savepoints, /*!< in: savepoints */
|
||||
const char* name) /*!< in: savepoint name */
|
||||
const void* name) /*!< in: savepoint */
|
||||
{
|
||||
ulint i;
|
||||
|
||||
ut_a(ib_vector_size(savepoints) > 0);
|
||||
|
||||
for (i = 1; i < ib_vector_size(savepoints); ++i) {
|
||||
fts_savepoint_t* savepoint;
|
||||
|
||||
savepoint = static_cast<fts_savepoint_t*>(
|
||||
ib_vector_get(savepoints, i));
|
||||
|
||||
if (strcmp(name, savepoint->name) == 0) {
|
||||
return(i);
|
||||
}
|
||||
}
|
||||
|
||||
return(ULINT_UNDEFINED);
|
||||
ut_a(ib_vector_size(savepoints) > 0);
|
||||
for (ulint i= 1; i < ib_vector_size(savepoints); ++i)
|
||||
if (name == static_cast<const fts_savepoint_t*>
|
||||
(ib_vector_get(savepoints, i))->name)
|
||||
return i;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*********************************************************************//**
|
||||
|
@ -5468,7 +5445,7 @@ void
|
|||
fts_savepoint_release(
|
||||
/*==================*/
|
||||
trx_t* trx, /*!< in: transaction */
|
||||
const char* name) /*!< in: savepoint name */
|
||||
const void* name) /*!< in: savepoint name */
|
||||
{
|
||||
ut_a(name != NULL);
|
||||
|
||||
|
@ -5476,10 +5453,7 @@ fts_savepoint_release(
|
|||
|
||||
ut_a(ib_vector_size(savepoints) > 0);
|
||||
|
||||
ulint i = fts_savepoint_lookup(savepoints, name);
|
||||
if (i != ULINT_UNDEFINED) {
|
||||
ut_a(i >= 1);
|
||||
|
||||
if (ulint i = fts_savepoint_lookup(savepoints, name)) {
|
||||
fts_savepoint_t* savepoint;
|
||||
savepoint = static_cast<fts_savepoint_t*>(
|
||||
ib_vector_get(savepoints, i));
|
||||
|
@ -5634,9 +5608,8 @@ void
|
|||
fts_savepoint_rollback(
|
||||
/*===================*/
|
||||
trx_t* trx, /*!< in: transaction */
|
||||
const char* name) /*!< in: savepoint name */
|
||||
const void* name) /*!< in: savepoint */
|
||||
{
|
||||
ulint i;
|
||||
ib_vector_t* savepoints;
|
||||
|
||||
ut_a(name != NULL);
|
||||
|
@ -5645,16 +5618,19 @@ fts_savepoint_rollback(
|
|||
|
||||
/* We pop all savepoints from the the top of the stack up to
|
||||
and including the instance that was found. */
|
||||
i = fts_savepoint_lookup(savepoints, name);
|
||||
ulint i = fts_savepoint_lookup(savepoints, name);
|
||||
|
||||
if (i != ULINT_UNDEFINED) {
|
||||
if (i == 0) {
|
||||
/* fts_trx_create() must have been invoked after
|
||||
this savepoint had been created, and we must roll back
|
||||
everything. */
|
||||
i = 1;
|
||||
}
|
||||
|
||||
{
|
||||
fts_savepoint_t* savepoint;
|
||||
|
||||
ut_a(i > 0);
|
||||
|
||||
while (ib_vector_size(savepoints) > i) {
|
||||
fts_savepoint_t* savepoint;
|
||||
|
||||
savepoint = static_cast<fts_savepoint_t*>(
|
||||
ib_vector_pop(savepoints));
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -465,8 +465,13 @@ protected:
|
|||
@see build_template() */
|
||||
void reset_template();
|
||||
|
||||
/** @return whether the table is read-only */
|
||||
bool is_read_only(bool altering_to_supported= false) const;
|
||||
/** Check the transaction is valid.
|
||||
@param altering_to_supported whether an ALTER TABLE is being run
|
||||
to something else than ROW_FORMAT=COMPRESSED
|
||||
@retval 0 if the transaction is valid for the current operation
|
||||
@retval HA_ERR_TABLE_READONLY if the table is read-only
|
||||
@retval HA_ERR_ROLLBACK if the transaction has been aborted */
|
||||
int is_valid_trx(bool altering_to_supported= false) const noexcept;
|
||||
|
||||
inline void update_thd(THD* thd);
|
||||
void update_thd();
|
||||
|
@ -937,12 +942,3 @@ ib_push_frm_error(
|
|||
@return true if index column length exceeds limit */
|
||||
MY_ATTRIBUTE((warn_unused_result))
|
||||
bool too_big_key_part_length(size_t max_field_len, const KEY& key);
|
||||
|
||||
/** This function is used to rollback one X/Open XA distributed transaction
|
||||
which is in the prepared state
|
||||
|
||||
@param[in] hton InnoDB handlerton
|
||||
@param[in] xid X/Open XA transaction identification
|
||||
|
||||
@return 0 or error number */
|
||||
int innobase_rollback_by_xid(handlerton* hton, XID* xid);
|
||||
|
|
|
@ -2248,7 +2248,7 @@ ha_innobase::check_if_supported_inplace_alter(
|
|||
table->s->table_name.str);
|
||||
}
|
||||
|
||||
if (is_read_only(!high_level_read_only
|
||||
if (is_valid_trx(!high_level_read_only
|
||||
&& (ha_alter_info->handler_flags & ALTER_OPTIONS)
|
||||
&& ha_alter_info->create_info->key_block_size == 0
|
||||
&& ha_alter_info->create_info->row_type
|
||||
|
@ -9170,7 +9170,7 @@ inline bool rollback_inplace_alter_table(Alter_inplace_info *ha_alter_info,
|
|||
/* If we have not started a transaction yet,
|
||||
(almost) nothing has been or needs to be done. */
|
||||
dict_sys.lock(SRW_LOCK_CALL);
|
||||
else if (ctx->trx->state == TRX_STATE_NOT_STARTED)
|
||||
else if (!ctx->trx->is_started())
|
||||
goto free_and_exit;
|
||||
else if (ctx->new_table)
|
||||
{
|
||||
|
@ -11402,7 +11402,7 @@ lock_fail:
|
|||
to remove the newly created table or
|
||||
index from data dictionary and table cache
|
||||
in rollback_inplace_alter_table() */
|
||||
if (trx->state == TRX_STATE_NOT_STARTED) {
|
||||
if (!trx->is_started()) {
|
||||
trx_start_for_ddl(trx);
|
||||
}
|
||||
|
||||
|
@ -11569,7 +11569,7 @@ err_index:
|
|||
purge_sys.resume_FTS();
|
||||
}
|
||||
|
||||
if (trx->state == TRX_STATE_NOT_STARTED) {
|
||||
if (!trx->is_started()) {
|
||||
/* Transaction may have been rolled back
|
||||
due to a lock wait timeout, deadlock,
|
||||
or a KILL statement. So restart the
|
||||
|
|
|
@ -6268,7 +6268,8 @@ static int i_s_sys_tablespaces_fill_table(THD *thd, TABLE_LIST *tables, Item*)
|
|||
|
||||
for (fil_space_t &space : fil_system.space_list)
|
||||
{
|
||||
if (space.purpose == FIL_TYPE_TABLESPACE && !space.is_stopping() &&
|
||||
if (!space.is_temporary() && !space.is_being_imported() &&
|
||||
!space.is_stopping() &&
|
||||
space.chain.start)
|
||||
{
|
||||
space.reacquire();
|
||||
|
@ -6497,7 +6498,7 @@ i_s_tablespaces_encryption_fill_table(
|
|||
fil_system.freeze_space_list++;
|
||||
|
||||
for (fil_space_t& space : fil_system.space_list) {
|
||||
if (space.purpose == FIL_TYPE_TABLESPACE
|
||||
if (!space.is_temporary() && !space.is_being_imported()
|
||||
&& !space.is_stopping()) {
|
||||
space.reacquire();
|
||||
mysql_mutex_unlock(&fil_system.mutex);
|
||||
|
|
|
@ -738,13 +738,15 @@ ibuf_set_free_bits_func(
|
|||
mtr.start();
|
||||
const page_id_t id(block->page.id());
|
||||
const fil_space_t *space= mtr.set_named_space_id(id.space());
|
||||
/* all callers of ibuf_update_free_bits_if_full() or ibuf_reset_free_bits()
|
||||
check this */
|
||||
ut_ad(!space->is_temporary());
|
||||
|
||||
if (buf_block_t *bitmap_page=
|
||||
ibuf_bitmap_get_map_page(id, block->zip_size(), &mtr))
|
||||
{
|
||||
if (space->purpose != FIL_TYPE_TABLESPACE)
|
||||
if (space->is_being_imported()) /* IndexPurge may invoke this */
|
||||
mtr.set_log_mode(MTR_LOG_NO_REDO);
|
||||
|
||||
#ifdef UNIV_IBUF_DEBUG
|
||||
if (max_val != ULINT_UNDEFINED)
|
||||
{
|
||||
|
@ -925,8 +927,7 @@ ibuf_page_low(
|
|||
return(false);
|
||||
}
|
||||
|
||||
compile_time_assert(IBUF_SPACE_ID == 0);
|
||||
ut_ad(fil_system.sys_space->purpose == FIL_TYPE_TABLESPACE);
|
||||
static_assert(IBUF_SPACE_ID == 0, "compatiblity");
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
if (x_latch) {
|
||||
|
@ -4505,7 +4506,7 @@ ibuf_print(
|
|||
dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space)
|
||||
{
|
||||
ut_ad(trx->mysql_thd);
|
||||
ut_ad(space->purpose == FIL_TYPE_IMPORT);
|
||||
ut_ad(space->is_being_imported());
|
||||
|
||||
const unsigned zip_size = space->zip_size();
|
||||
const unsigned physical_size = space->physical_size();
|
||||
|
|
|
@ -68,8 +68,6 @@ enum dberr_t {
|
|||
noticed */
|
||||
DB_CANNOT_DROP_CONSTRAINT, /*!< dropping a foreign key constraint
|
||||
from a table failed */
|
||||
DB_NO_SAVEPOINT, /*!< no savepoint exists with the given
|
||||
name */
|
||||
DB_TABLESPACE_EXISTS, /*!< we cannot create a new single-table
|
||||
tablespace because a file of the same
|
||||
name already exists */
|
||||
|
|
|
@ -100,16 +100,6 @@ class page_id_t;
|
|||
/** Structure containing encryption specification */
|
||||
struct fil_space_crypt_t;
|
||||
|
||||
/** File types */
|
||||
enum fil_type_t {
|
||||
/** temporary tablespace (temporary undo log or tables) */
|
||||
FIL_TYPE_TEMPORARY,
|
||||
/** a tablespace that is being imported (no logging until finished) */
|
||||
FIL_TYPE_IMPORT,
|
||||
/** persistent tablespace (for system, undo log or tables) */
|
||||
FIL_TYPE_TABLESPACE,
|
||||
};
|
||||
|
||||
struct fil_node_t;
|
||||
|
||||
/** Structure to store first and last value of range */
|
||||
|
@ -344,39 +334,43 @@ struct fil_space_t final
|
|||
{
|
||||
#ifndef UNIV_INNOCHECKSUM
|
||||
friend fil_node_t;
|
||||
|
||||
/** Constructor; see @fil_space_t::create() */
|
||||
inline explicit fil_space_t(uint32_t id, uint32_t flags, bool being_imported,
|
||||
fil_space_crypt_t *crypt_data) noexcept;
|
||||
|
||||
~fil_space_t()
|
||||
{
|
||||
ut_ad(!latch_owner);
|
||||
latch.destroy();
|
||||
}
|
||||
|
||||
/** fil_system.spaces chain node */
|
||||
fil_space_t *hash;
|
||||
/** LSN of the most recent fil_names_write_if_was_clean().
|
||||
Reset to 0 by fil_names_clear(). Protected by exclusive log_sys.latch.
|
||||
If and only if max_lsn is nonzero, this is in fil_system.named_spaces. */
|
||||
lsn_t max_lsn;
|
||||
/** tablespace identifier */
|
||||
uint32_t id;
|
||||
fil_type_t purpose;/*!< purpose */
|
||||
UT_LIST_BASE_NODE_T(fil_node_t) chain;
|
||||
/*!< base node for the file chain */
|
||||
uint32_t size; /*!< tablespace file size in pages;
|
||||
0 if not known yet */
|
||||
uint32_t size_in_header;
|
||||
/* FSP_SIZE in the tablespace header;
|
||||
0 if not known yet */
|
||||
uint32_t free_len;
|
||||
/*!< length of the FSP_FREE list */
|
||||
uint32_t free_limit;
|
||||
/*!< contents of FSP_FREE_LIMIT */
|
||||
uint32_t recv_size;
|
||||
/*!< recovered tablespace size in pages;
|
||||
0 if no size change was read from the redo log,
|
||||
or if the size change was implemented */
|
||||
uint32_t n_reserved_extents;
|
||||
/*!< number of reserved free extents for
|
||||
ongoing operations like B-tree page split */
|
||||
|
||||
/** fil_system.spaces chain node */
|
||||
fil_space_t *hash= nullptr;
|
||||
/** log_sys.get_lsn() of the most recent fil_names_write_if_was_clean().
|
||||
Reset to 0 by fil_names_clear(). Protected by log_sys.mutex.
|
||||
If and only if this is nonzero, the tablespace will be in named_spaces. */
|
||||
lsn_t max_lsn= 0;
|
||||
/** base node for the chain of data files; multiple entries are
|
||||
only possible for is_temporary() or id==0 */
|
||||
UT_LIST_BASE_NODE_T(fil_node_t) chain;
|
||||
/** tablespace size in pages; 0 if not determined yet */
|
||||
uint32_t size= 0;
|
||||
/** FSP_SIZE in the tablespace header; 0 if not determined yet */
|
||||
uint32_t size_in_header= 0;
|
||||
/** length of the FSP_FREE list */
|
||||
uint32_t free_len= 0;
|
||||
/** contents of FSP_FREE_LIMIT */
|
||||
uint32_t free_limit= 0;
|
||||
/** recovered tablespace size in pages; 0 if no size change was read
|
||||
from the redo log, or if the size change was applied */
|
||||
uint32_t recv_size= 0;
|
||||
/** number of reserved free extents for ongoing operations like
|
||||
B-tree page split */
|
||||
uint32_t n_reserved_extents= 0;
|
||||
private:
|
||||
#ifdef UNIV_DEBUG
|
||||
fil_space_t *next_in_space_list();
|
||||
|
@ -387,10 +381,10 @@ private:
|
|||
#endif
|
||||
|
||||
/** the committed size of the tablespace in pages */
|
||||
Atomic_relaxed<uint32_t> committed_size;
|
||||
Atomic_relaxed<uint32_t> committed_size{0};
|
||||
/** Number of pending operations on the file.
|
||||
The tablespace cannot be freed while (n_pending & PENDING) != 0. */
|
||||
std::atomic<uint32_t> n_pending;
|
||||
std::atomic<uint32_t> n_pending{CLOSING};
|
||||
/** Flag in n_pending that indicates that the tablespace is about to be
|
||||
deleted, and no further operations should be performed */
|
||||
static constexpr uint32_t STOPPING_READS= 1U << 31;
|
||||
|
@ -412,20 +406,23 @@ private:
|
|||
/** latch protecting all page allocation bitmap pages */
|
||||
IF_DBUG(srw_lock_debug, srw_lock) latch;
|
||||
/** the thread that holds the exclusive latch, or 0 */
|
||||
pthread_t latch_owner;
|
||||
pthread_t latch_owner= 0;
|
||||
public:
|
||||
/** MariaDB encryption data */
|
||||
fil_space_crypt_t *crypt_data;
|
||||
fil_space_crypt_t *crypt_data= nullptr;
|
||||
|
||||
/** Whether needs_flush(), or this is in fil_system.unflushed_spaces */
|
||||
bool is_in_unflushed_spaces;
|
||||
bool is_in_unflushed_spaces= false;
|
||||
|
||||
/** Whether this in fil_system.default_encrypt_tables (needs key rotation) */
|
||||
bool is_in_default_encrypt;
|
||||
bool is_in_default_encrypt= false;
|
||||
|
||||
private:
|
||||
/** Whether the tablespace is being imported */
|
||||
bool being_imported= false;
|
||||
|
||||
/** Whether any corrupton of this tablespace has been reported */
|
||||
mutable std::atomic_flag is_corrupted;
|
||||
mutable std::atomic_flag is_corrupted{false};
|
||||
|
||||
public:
|
||||
/** mutex to protect freed_ranges and last_freed_lsn */
|
||||
|
@ -435,11 +432,18 @@ private:
|
|||
range_set freed_ranges;
|
||||
|
||||
/** LSN of freeing last page; protected by freed_range_mutex */
|
||||
lsn_t last_freed_lsn;
|
||||
lsn_t last_freed_lsn= 0;
|
||||
|
||||
/** LSN of undo tablespace creation or 0; protected by latch */
|
||||
lsn_t create_lsn;
|
||||
lsn_t create_lsn= 0;
|
||||
public:
|
||||
/** @return whether this is the temporary tablespace */
|
||||
bool is_temporary() const noexcept
|
||||
{ return UNIV_UNLIKELY(id == SRV_TMP_SPACE_ID); }
|
||||
/** @return whether this tablespace is being imported */
|
||||
bool is_being_imported() const noexcept
|
||||
{ return UNIV_UNLIKELY(being_imported); }
|
||||
|
||||
/** @return whether doublewrite buffering is needed */
|
||||
inline bool use_doublewrite() const;
|
||||
|
||||
|
@ -509,7 +513,7 @@ public:
|
|||
MY_ATTRIBUTE((nonnull));
|
||||
|
||||
/** Note that the tablespace has been imported.
|
||||
Initially, purpose=FIL_TYPE_IMPORT so that no redo log is
|
||||
Initially, purpose=IMPORT so that no redo log is
|
||||
written while the space ID is being updated in each page. */
|
||||
inline void set_imported();
|
||||
|
||||
|
@ -886,18 +890,18 @@ public:
|
|||
#ifndef UNIV_INNOCHECKSUM
|
||||
MY_ATTRIBUTE((warn_unused_result))
|
||||
/** Create a tablespace in fil_system.
|
||||
@param id tablespace identifier
|
||||
@param flags tablespace flags
|
||||
@param purpose tablespace purpose
|
||||
@param crypt_data encryption information
|
||||
@param mode encryption mode
|
||||
@param opened true if space files are opened
|
||||
@param id tablespace identifier
|
||||
@param flags tablespace flags
|
||||
@param being_imported whether this is IMPORT TABLESPACE
|
||||
@param crypt_data encryption information
|
||||
@param mode encryption mode
|
||||
@param opened whether the tablespace files are open
|
||||
@return pointer to created tablespace, to be filled in with add()
|
||||
@retval nullptr on failure (such as when the same tablespace exists) */
|
||||
static fil_space_t *create(uint32_t id, uint32_t flags,
|
||||
fil_type_t purpose, fil_space_crypt_t *crypt_data,
|
||||
static fil_space_t *create(uint32_t id, uint32_t flags, bool being_imported,
|
||||
fil_space_crypt_t *crypt_data,
|
||||
fil_encryption_t mode= FIL_ENCRYPTION_DEFAULT,
|
||||
bool opened= false);
|
||||
bool opened= false) noexcept;
|
||||
|
||||
MY_ATTRIBUTE((warn_unused_result))
|
||||
/** Acquire a tablespace reference.
|
||||
|
@ -1018,6 +1022,18 @@ public:
|
|||
/** @return the tablespace name (databasename/tablename) */
|
||||
name_type name() const;
|
||||
|
||||
/** How to validate tablespace files that are being opened */
|
||||
enum validate {
|
||||
/** the file may be missing */
|
||||
MAYBE_MISSING= 0,
|
||||
/** do not validate */
|
||||
VALIDATE_NOTHING,
|
||||
/** validate the tablespace ID */
|
||||
VALIDATE_SPACE_ID,
|
||||
/** opening a file for ALTER TABLE...IMPORT TABLESPACE */
|
||||
VALIDATE_IMPORT
|
||||
};
|
||||
|
||||
private:
|
||||
/** @return whether the file is usable for io() */
|
||||
ATTRIBUTE_COLD bool prepare_acquired();
|
||||
|
@ -1102,8 +1118,8 @@ inline bool fil_space_t::use_doublewrite() const
|
|||
|
||||
inline void fil_space_t::set_imported()
|
||||
{
|
||||
ut_ad(purpose == FIL_TYPE_IMPORT);
|
||||
purpose= FIL_TYPE_TABLESPACE;
|
||||
ut_ad(being_imported);
|
||||
being_imported= false;
|
||||
UT_LIST_GET_FIRST(chain)->find_metadata();
|
||||
}
|
||||
|
||||
|
@ -1415,7 +1431,8 @@ public:
|
|||
ulint n_open;
|
||||
/** last time we noted n_open exceeding the limit; protected by mutex */
|
||||
time_t n_open_exceeded_time;
|
||||
/** maximum persistent tablespace id that has ever been assigned */
|
||||
/** maximum space id in the existing tables; on InnoDB startup this is
|
||||
initialized based on the data dictionary contents */
|
||||
uint32_t max_assigned_id;
|
||||
/** nonzero if fil_node_open_file_low() should avoid moving the tablespace
|
||||
to the end of space_list, for FIFO policy of try_to_close() */
|
||||
|
@ -1518,7 +1535,7 @@ template<bool have_reference> inline void fil_space_t::flush()
|
|||
{
|
||||
mysql_mutex_assert_not_owner(&fil_system.mutex);
|
||||
ut_ad(!have_reference || (pending() & PENDING));
|
||||
ut_ad(purpose == FIL_TYPE_TABLESPACE || purpose == FIL_TYPE_IMPORT);
|
||||
ut_ad(!is_temporary());
|
||||
if (srv_file_flush_method == SRV_O_DIRECT_NO_FSYNC)
|
||||
{
|
||||
ut_ad(!is_in_unflushed_spaces);
|
||||
|
@ -1641,7 +1658,7 @@ fil_ibd_create(
|
|||
uint32_t size,
|
||||
fil_encryption_t mode,
|
||||
uint32_t key_id,
|
||||
dberr_t* err)
|
||||
dberr_t* err) noexcept
|
||||
MY_ATTRIBUTE((nonnull, warn_unused_result));
|
||||
|
||||
/** Try to adjust FSP_SPACE_FLAGS if they differ from the expectations.
|
||||
|
@ -1650,43 +1667,28 @@ fil_ibd_create(
|
|||
@param[in] flags desired tablespace flags */
|
||||
void fsp_flags_try_adjust(fil_space_t *space, uint32_t flags);
|
||||
|
||||
/********************************************************************//**
|
||||
/**
|
||||
Tries to open a single-table tablespace and optionally checks the space id is
|
||||
right in it. If does not succeed, prints an error message to the .err log. This
|
||||
function is used to open a tablespace when we start up mysqld, and also in
|
||||
IMPORT TABLESPACE.
|
||||
NOTE that we assume this operation is used either at the database startup
|
||||
or under the protection of dict_sys.latch, so that two users cannot
|
||||
race here. This operation does not leave the file associated with the
|
||||
tablespace open, but closes it after we have looked at the space id in it.
|
||||
|
||||
If the validate boolean is set, we read the first page of the file and
|
||||
check that the space id in the file is what we expect. We assume that
|
||||
this function runs much faster if no check is made, since accessing the
|
||||
file inode probably is much faster (the OS caches them) than accessing
|
||||
the first page of the file. This boolean may be initially false, but if
|
||||
a remote tablespace is found it will be changed to true.
|
||||
NOTE that we assume this operation is used either at the database
|
||||
startup or under the protection of MDL, to prevent concurrent access
|
||||
to the same tablespace.
|
||||
|
||||
@param[in] validate 0=maybe missing, 1=do not validate, 2=validate
|
||||
@param[in] purpose FIL_TYPE_TABLESPACE or FIL_TYPE_TEMPORARY
|
||||
@param[in] id tablespace ID
|
||||
@param[in] flags expected FSP_SPACE_FLAGS
|
||||
@param[in] name table name
|
||||
If file-per-table, it is the table name in the databasename/tablename format
|
||||
@param[in] path_in expected filepath, usually read from dictionary
|
||||
@param[out] err DB_SUCCESS or error code
|
||||
@param id tablespace identifier
|
||||
@param flags expected FSP_SPACE_FLAGS
|
||||
@param validate how to validate files
|
||||
@param name the table name in databasename/tablename format
|
||||
@param path_in expected filepath, usually read from dictionary
|
||||
@param err DB_SUCCESS or error code
|
||||
@return tablespace
|
||||
@retval NULL if the tablespace could not be opened */
|
||||
fil_space_t*
|
||||
fil_ibd_open(
|
||||
unsigned validate,
|
||||
fil_type_t purpose,
|
||||
uint32_t id,
|
||||
uint32_t flags,
|
||||
fil_space_t::name_type name,
|
||||
const char* path_in,
|
||||
dberr_t* err = NULL)
|
||||
MY_ATTRIBUTE((warn_unused_result));
|
||||
@retval nullptr if the tablespace could not be opened */
|
||||
fil_space_t *fil_ibd_open(uint32_t id, uint32_t flags,
|
||||
fil_space_t::validate validate,
|
||||
fil_space_t::name_type name,
|
||||
const char *path_in, dberr_t *err= nullptr) noexcept;
|
||||
|
||||
enum fil_load_status {
|
||||
/** The tablespace file(s) were found and valid. */
|
||||
|
|
|
@ -201,9 +201,9 @@ struct fts_trx_t {
|
|||
|
||||
/** Information required for transaction savepoint handling. */
|
||||
struct fts_savepoint_t {
|
||||
char* name; /*!< First entry is always NULL, the
|
||||
default instance. Otherwise the name
|
||||
of the savepoint */
|
||||
const void* name; /*!< First entry is always NULL, the
|
||||
default instance. Otherwise the
|
||||
savepoint */
|
||||
|
||||
ib_rbt_t* tables; /*!< Modified FTS tables */
|
||||
};
|
||||
|
@ -666,7 +666,7 @@ void
|
|||
fts_savepoint_take(
|
||||
/*===============*/
|
||||
fts_trx_t* fts_trx, /*!< in: fts transaction */
|
||||
const char* name); /*!< in: savepoint name */
|
||||
const void* name); /*!< in: savepoint */
|
||||
|
||||
/**********************************************************************//**
|
||||
Refresh last statement savepoint. */
|
||||
|
@ -681,7 +681,7 @@ void
|
|||
fts_savepoint_release(
|
||||
/*==================*/
|
||||
trx_t* trx, /*!< in: transaction */
|
||||
const char* name); /*!< in: savepoint name */
|
||||
const void* name); /*!< in: savepoint */
|
||||
|
||||
/** Clear cache.
|
||||
@param[in,out] cache fts cache */
|
||||
|
@ -702,7 +702,7 @@ void
|
|||
fts_savepoint_rollback(
|
||||
/*===================*/
|
||||
trx_t* trx, /*!< in: transaction */
|
||||
const char* name); /*!< in: savepoint name */
|
||||
const void* name); /*!< in: savepoint */
|
||||
|
||||
/*********************************************************************//**
|
||||
Rollback to and including savepoint indentified by name. */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue