From 85d5ed12849bca6aba503b11139b944cfbd53fd7 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Sun, 19 May 2024 15:46:58 +0200 Subject: [PATCH] Update mysql: add default_character_set option to ynh_mysql_dump_db --- helpers/mysql | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/helpers/mysql b/helpers/mysql index 94179f2fd..e4bcb42f6 100644 --- a/helpers/mysql +++ b/helpers/mysql @@ -136,13 +136,15 @@ ynh_mysql_drop_db() { # Requires YunoHost version 2.2.4 or higher. ynh_mysql_dump_db() { # Declare an array to define the options of this helper. - local legacy_args=d - local -A args_array=([d]=database=) + local legacy_args=dc + local -A args_array=( [d]=database= [c]=default_character_set= ) local database + local default_character_set # Manage arguments with getopts ynh_handle_getopts_args "$@" + default_character_set="${default_character_set:-latin1}" - mysqldump --single-transaction --skip-dump-date --routines "$database" + mysqldump --single-transaction --skip-dump-date --routines --default-character-set=$default_character_set "$database" } # Create a user