diff options
author | Anel Husakovic <anel@mariadb.org> | 2023-03-02 12:05:36 +0100 |
---|---|---|
committer | Andrew Hutchings <andrew@linuxjedi.co.uk> | 2023-03-08 12:26:00 +0000 |
commit | 7300ab32cc7fe3865c059d3bce57dc63a32dff13 (patch) | |
tree | feb6716e3353e33f32b3e54caafb31073ea96acf /client | |
parent | f0ab1a28c99f0ac1694f5abe433f958470f51031 (diff) | |
download | mariadb-git-7300ab32cc7fe3865c059d3bce57dc63a32dff13.tar.gz |
Update handling of mysqlbinlog's `die()` function
- Update per Monty's review for commit 5328dbdaa237d97e443120f2e08437fb274198c2
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqlbinlog.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index fb70ff62d63..8770b3651cc 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1896,11 +1896,11 @@ static void cleanup() } -static void die() +static void die(int err) { cleanup(); - my_end(MY_DONT_FREE_DBUG); - exit(1); + my_end(0); + exit(err); } @@ -1937,7 +1937,7 @@ static my_time_t convert_str_to_timestamp(const char* str) l_time.time_type != MYSQL_TIMESTAMP_DATETIME || status.warnings) { error("Incorrect date and time argument: %s", str); - die(); + die(1); } /* Note that Feb 30th, Apr 31st cause no error messages and are mapped to @@ -1996,7 +1996,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt->name)) <= 0) { sf_leaking_memory= 1; /* no memory leak reports here */ - die(); + die(1); } break; #ifdef WHEN_FLASHBACK_REVIEW_READY @@ -2021,7 +2021,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt->name)) <= 0) { sf_leaking_memory= 1; /* no memory leak reports here */ - die(); + die(1); } opt_base64_output_mode= (enum_base64_output_mode) (val - 1); } @@ -2107,7 +2107,7 @@ static int parse_args(int *argc, char*** argv) if ((ho_error=handle_options(argc, argv, my_options, get_one_option))) { - die(); + die(ho_error); } if (debug_info_flag) my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; @@ -3078,7 +3078,7 @@ int main(int argc, char** argv) if (!remote_opt) { error("The --raw mode only works with --read-from-remote-server"); - die(); + die(1); } if (one_database) warning("The --database option is ignored in raw mode"); @@ -3100,7 +3100,7 @@ int main(int argc, char** argv) O_WRONLY | O_BINARY, MYF(MY_WME)))) { error("Could not create log file '%s'", result_file_name); - die(); + die(1); } } else |