MDEV-35509 mariabackup.alter_copy_race crashes with abort in backup_file_op_fail

The bug was that backup_file_op_fail() was using a static variable
initialized by arguments. This does not work as static variables
will only be initialized on the first call and not change for future
calls, even when the arguments changes.

Fixed by removing 'static'.
This commit is contained in:
Monty 2024-11-26 20:20:54 +02:00
parent e81ed928ff
commit c34a2feceb

View file

@ -1185,7 +1185,7 @@ static void backup_file_op_fail(uint32_t space_id, int type,
const byte* new_name, ulint new_len)
{
bool fail = false;
const static std::string spacename{filename_to_spacename(name, len)};
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);