Commit 11986ec6 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-31251 MDEV-30968 breaks running mariabackup on older mariadb (opendir(NULL))

The problem happened when running mariabackup agains a pre-MDEV-30971 server,
i.e. not having yet the system variable @@aria_log_dir_path.

As a result, backup_start() called the function backup_files_from_datadir()
with a NULL value, which further caused a crash.

Fix:
Perform this call:

    backup_files_from_datadir(.., aria_log_dir_path, ..)

only if aria_log_dir_path is not NULL. Otherwise,
assume that Aria log files are in their default location,
so they've just copied by the previous call:

    backup_files_from_datadir(.., fil_path_to_mysql_datadir, ..)

Thanks to Walter Doekes for a patch proposal.
parent 73291de7
...@@ -1439,9 +1439,10 @@ bool backup_start(ds_ctxt *ds_data, ds_ctxt *ds_meta, ...@@ -1439,9 +1439,10 @@ bool backup_start(ds_ctxt *ds_data, ds_ctxt *ds_meta,
if (!backup_files_from_datadir(ds_data, fil_path_to_mysql_datadir, if (!backup_files_from_datadir(ds_data, fil_path_to_mysql_datadir,
"aws-kms-key") || "aws-kms-key") ||
!backup_files_from_datadir(ds_data, (aria_log_dir_path &&
aria_log_dir_path, !backup_files_from_datadir(ds_data,
"aria_log")) { aria_log_dir_path,
"aria_log"))) {
return false; return false;
} }
......
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