Skip to content

Commit

Permalink
MDEV-31251 MDEV-30968 breaks running mariabackup on older mariadb (op…
Browse files Browse the repository at this point in the history
…endir(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.
  • Loading branch information
abarkov committed Apr 8, 2024
1 parent 73291de commit 11986ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
"aws-kms-key") ||
!backup_files_from_datadir(ds_data,
aria_log_dir_path,
"aria_log")) {
(aria_log_dir_path &&
!backup_files_from_datadir(ds_data,
aria_log_dir_path,
"aria_log"))) {
return false;
}

Expand Down

0 comments on commit 11986ec

Please sign in to comment.