-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
do not pass mariadbd arguments with whitespace to mariadb-install-db #575
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,7 +228,17 @@ 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}" \ | ||
|
||
local 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be warning or error? Warnings could be silently ignored in the automation and lead to potential failures. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if you are asking me ... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I consider an error as something that cannot proceed and a warning is something that might be impacting. As the original example showed there are some things that make little difference to the way mariadb-install-db processes. Regardless I'm hoping that this is only a temporary change until the server implementation is made cleaner with some actual shell programming expertise. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM but I would rewrite the if: if [[ "$arg" =~ [[:space:]] ]]; then
warning
else
OK
fi seems much more simple to understand. |
||
fi | ||
done | ||
mariadb-install-db "${installArgs[@]}" "${mariadbdArgs[@]}" \ | ||
--skip-test-db \ | ||
--old-mode='UTF8_IS_UTF8MB3' \ | ||
--default-time-zone=SYSTEM --enforce-storage-engine= \ | ||
|
This comment was marked as spam.
Sorry, something went wrong.