Skip to content

Commit

Permalink
do not pass mariadbd arguments with whitespace to mariadb-install-db
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex1s committed May 5, 2024
1 parent d7a950d commit 8ef2bab
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions 10.11/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,18 @@ _mariadb_version() {
docker_init_database_dir() {
mysql_note "Initializing database files"
installArgs=( --datadir="$DATADIR" --rpm --auth-root-authentication-method=normal )
# "Other options are passed to mariadbd." (so we pass all "mariadbd" arguments directly here)
mariadb-install-db "${installArgs[@]}" "${@:2}" \

mariadbdArgs=()
for arg in "${@:2}"; do
# Check if the argument contains whitespace
if [[ ! "$arg" =~ [[:space:]] ]]; then
mariadbdArgs+=("$arg")
else
mysql_warn Not passing argument \'$arg\' to mariadb-install-db because mariadb-install-db does not support arguments with whitespace.
fi
done

mariadb-install-db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--old-mode='UTF8_IS_UTF8MB3' \
--default-time-zone=SYSTEM --enforce-storage-engine= \
Expand Down

0 comments on commit 8ef2bab

Please sign in to comment.