summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2023-02-03 16:00:11 +1100
committerDaniel Black <daniel@mariadb.org>2023-02-07 20:14:26 +1100
commitecc93c9824886bb7a06afe9022bf694a60e35cee (patch)
tree2e007fb3341b58dc410a4835d1cbe39666923714 /extra
parent762fe015c15cdf5e0bdc57ac1f9f6f71e7484560 (diff)
downloadmariadb-git-ecc93c9824886bb7a06afe9022bf694a60e35cee.tar.gz
MDEV-30492 Crash when use mariabackup.exe with config 'innodb_flush_method=async_unbuffered'
Normalize innodb_flush_method, the same as the service, before attempting to print it.
Diffstat (limited to 'extra')
-rw-r--r--extra/mariabackup/xtrabackup.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index bb440eec7f8..f7a5d00b92c 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -1896,6 +1896,17 @@ xb_get_one_option(int optid,
break;
case OPT_INNODB_FLUSH_METHOD:
+#ifdef _WIN32
+ /* From: storage/innobase/handler/ha_innodb.cc:innodb_init_params */
+ switch (srv_file_flush_method) {
+ case SRV_ALL_O_DIRECT_FSYNC + 1 /* "async_unbuffered"="unbuffered" */:
+ srv_file_flush_method= SRV_ALL_O_DIRECT_FSYNC;
+ break;
+ case SRV_ALL_O_DIRECT_FSYNC + 2 /* "normal"="fsync" */:
+ srv_file_flush_method= SRV_FSYNC;
+ break;
+ }
+#endif
ut_a(srv_file_flush_method
<= IF_WIN(SRV_ALL_O_DIRECT_FSYNC, SRV_O_DIRECT_NO_FSYNC));
ADD_PRINT_PARAM_OPT(innodb_flush_method_names[srv_file_flush_method]);