diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 13:22:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 13:22:53 +0000 |
commit | 347c164c35eddab388009470e6848cb361ac93f8 (patch) | |
tree | 2c0c44eac690f510bb0a35b2a13b36d606b77b6b /storage/maria/ma_control_file.c | |
parent | Releasing progress-linux version 1:10.11.7-4~progress7.99u1. (diff) | |
download | mariadb-347c164c35eddab388009470e6848cb361ac93f8.tar.xz mariadb-347c164c35eddab388009470e6848cb361ac93f8.zip |
Merging upstream version 1:10.11.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'storage/maria/ma_control_file.c')
-rw-r--r-- | storage/maria/ma_control_file.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/storage/maria/ma_control_file.c b/storage/maria/ma_control_file.c index 21befb70..03513c46 100644 --- a/storage/maria/ma_control_file.c +++ b/storage/maria/ma_control_file.c @@ -272,7 +272,8 @@ static int lock_control_file(const char *name, my_bool do_retry) CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing, my_bool print_error, - my_bool wait_for_lock) + my_bool wait_for_lock, + int open_flags) { uchar buffer[CF_MAX_SIZE]; char name[FN_REFLEN], errmsg_buff[256]; @@ -280,7 +281,6 @@ CONTROL_FILE_ERROR ma_control_file_open(my_bool create_if_missing, " file is probably in use by another process"; uint new_cf_create_time_size, new_cf_changeable_size, new_block_size; my_off_t file_size; - int open_flags= O_BINARY | /*O_DIRECT |*/ O_RDWR | O_CLOEXEC; int error= CONTROL_FILE_UNKNOWN_ERROR; DBUG_ENTER("ma_control_file_open"); @@ -460,6 +460,15 @@ err: DBUG_RETURN(error); } +/* + The most common way to open the control file when writing tests +*/ + +CONTROL_FILE_ERROR ma_control_file_open_or_create() +{ + return ma_control_file_open(TRUE, TRUE, TRUE, + control_file_open_flags); +} /* Write information durably to the control file; stores this information into @@ -630,7 +639,7 @@ my_bool print_aria_log_control() int error= CONTROL_FILE_UNKNOWN_ERROR; uint recovery_fails; File file; - DBUG_ENTER("ma_control_file_open"); + DBUG_ENTER("print_aria_log_control"); if (fn_format(name, CONTROL_FILE_BASE_NAME, maria_data_root, "", MYF(MY_WME)) == NullS) |