Commit 12995559 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.4 into 10.5

parents 476ff092 eaa4968f
......@@ -1462,7 +1462,12 @@ int main(int argc, char **argv)
open_mysql_upgrade_file();
if (opt_check_upgrade)
exit(upgrade_already_done(0) == 0);
{
int upgrade_needed = upgrade_already_done(0);
free_used_memory();
my_end(my_end_arg);
exit(upgrade_needed == 0);
}
/* Find mysqlcheck */
find_tool(mysqlcheck_path, IF_WIN("mariadb-check.exe", "mariadb-check"), self_name);
......
Running mysql_upgrade with --check-if-upgrade-is-needed
Checking for absence of temporary files by mysql_upgrade
No temporary files found
End of 10.4 tests
-- source include/mysql_upgrade_preparation.inc
#
# MDEV-31925 mysqld_upgrade --check-if-upgrade-is-needed leaks files
#
# Run mysql_upgrade with --check-if-upgrade-is-needed
--echo Running mysql_upgrade with --check-if-upgrade-is-needed
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed 2>&1
# Check if temporary files related to mysql_upgrade are cleared
--echo Checking for absence of temporary files by mysql_upgrade
--perl
# Use the temporary directory path from the MySQL configuration
my $tmpdir = "$ENV{MYSQL_TMP_DIR}";
die "Test failed: Found temporary file left by mysql_upgrade\n" if (glob("$tmpdir/mysql_upgrade-*"));
print "No temporary files found\n";
EOF
let $MYSQLD_DATADIR= `select @@datadir`;
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
--echo End of 10.4 tests
......@@ -182,6 +182,13 @@ BINLOG_GTID_POS('master-bin.000001',18446744073709551616)
NULL
Warnings:
Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated
SET sql_log_bin= 0;
CREATE TABLE t1 AS SELECT MASTER_POS_WAIT(@binlog_file, 4, 0);
SELECT BINLOG_GTID_POS(@binlog_file, 4);
BINLOG_GTID_POS(@binlog_file, 4)
NULL
DROP TABLE t1;
SET sql_log_bin= 1;
*** Some tests of @@GLOBAL.gtid_binlog_state ***
connection server_2;
include/sync_with_master_gtid.inc
......
......@@ -182,6 +182,13 @@ BINLOG_GTID_POS('master-bin.000001',18446744073709551616)
NULL
Warnings:
Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated
SET sql_log_bin= 0;
CREATE TABLE t1 AS SELECT MASTER_POS_WAIT(@binlog_file, 4, 0);
SELECT BINLOG_GTID_POS(@binlog_file, 4);
BINLOG_GTID_POS(@binlog_file, 4)
NULL
DROP TABLE t1;
SET sql_log_bin= 1;
*** Some tests of @@GLOBAL.gtid_binlog_state ***
connection server_2;
include/sync_with_master_gtid.inc
......
......@@ -162,6 +162,13 @@ eval SELECT BINLOG_GTID_POS('$valid_binlog_name',0);
eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551615);
eval SELECT BINLOG_GTID_POS('$valid_binlog_name',18446744073709551616);
# MDEV-33045: Server crashes in Item_func_binlog_gtid_pos::val_str / Binary_string::c_ptr_safe
SET sql_log_bin= 0;
CREATE TABLE t1 AS SELECT MASTER_POS_WAIT(@binlog_file, 4, 0);
SELECT BINLOG_GTID_POS(@binlog_file, 4);
DROP TABLE t1;
SET sql_log_bin= 1;
--echo *** Some tests of @@GLOBAL.gtid_binlog_state ***
--connection server_2
......
......@@ -3213,12 +3213,12 @@ String *Item_func_binlog_gtid_pos::val_str(String *str)
String name_str, *name;
longlong pos;
if (args[0]->null_value || args[1]->null_value)
goto err;
name= args[0]->val_str(&name_str);
pos= args[1]->val_int();
if (args[0]->null_value || args[1]->null_value)
goto err;
if (pos < 0 || pos > UINT_MAX32)
goto err;
......
......@@ -862,8 +862,7 @@ retry_event_group(rpl_group_info *rgi, rpl_parallel_thread *rpt,
thd->wait_for_commit_ptr->unregister_wait_for_prior_commit();
DBUG_EXECUTE_IF("inject_mdev8031", {
/* Simulate that we get deadlock killed at this exact point. */
rgi->killed_for_retry= rpl_group_info::RETRY_KILL_KILLED;
thd->set_killed(KILL_CONNECTION);
slave_background_kill_request(thd);
});
#ifdef ENABLED_DEBUG_SYNC
DBUG_EXECUTE_IF("rpl_parallel_simulate_wait_at_retry", {
......@@ -2567,8 +2566,10 @@ rpl_parallel::stop_during_until()
bool
rpl_parallel::workers_idle(Relay_log_info *rli)
{
return rli->last_inuse_relaylog->queued_count ==
rli->last_inuse_relaylog->dequeued_count;
mysql_mutex_assert_owner(&rli->data_lock);
return !rli->last_inuse_relaylog ||
rli->last_inuse_relaylog->queued_count ==
rli->last_inuse_relaylog->dequeued_count;
}
......
......@@ -5426,19 +5426,25 @@ pthread_handler_t handle_slave_sql(void *arg)
}
else
rli->gtid_skip_flag = GTID_SKIP_NOT;
mysql_mutex_lock(&rli->data_lock);
if (init_relay_log_pos(rli,
rli->group_relay_log_name,
rli->group_relay_log_pos,
1 /*need data lock*/, &errmsg,
0 /*need data lock*/, &errmsg,
1 /*look for a description_event*/))
{
rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, NULL,
"Error initializing relay log position: %s", errmsg);
mysql_mutex_unlock(&rli->data_lock);
goto err_before_start;
}
rli->reset_inuse_relaylog();
if (rli->alloc_inuse_relaylog(rli->group_relay_log_name))
{
mysql_mutex_unlock(&rli->data_lock);
goto err_before_start;
}
mysql_mutex_unlock(&rli->data_lock);
strcpy(rli->future_event_master_log_name, rli->group_master_log_name);
THD_CHECK_SENTRY(thd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment