Skip to content
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

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion 10.11/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

This comment was marked as spam.

mysql_warn Not passing argument \'$arg\' to mariadb-install-db because mariadb-install-db does not support arguments with whitespace.

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you are asking me ...
... but I would agree with you.

Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator

Choose a reason for hiding this comment

The 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= \
Expand Down
12 changes: 11 additions & 1 deletion 10.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,17 @@ docker_init_database_dir() {
mysql_note "Initializing database files"
installArgs=( --datadir="$DATADIR" --rpm --auth-root-authentication-method=normal )
# "Other options are passed to mysqld." (so we pass all "mysqld" arguments directly here)
mysql_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.
fi
done
mysql_install_db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--default-time-zone=SYSTEM --enforce-storage-engine= \
--skip-log-bin \
Expand Down
12 changes: 11 additions & 1 deletion 10.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,17 @@ docker_init_database_dir() {
mysql_note "Initializing database files"
installArgs=( --datadir="$DATADIR" --rpm --auth-root-authentication-method=normal )
# "Other options are passed to mysqld." (so we pass all "mysqld" arguments directly here)
mysql_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.
fi
done
mysql_install_db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--default-time-zone=SYSTEM --enforce-storage-engine= \
--skip-log-bin \
Expand Down
12 changes: 11 additions & 1 deletion 10.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,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.
fi
done
mariadb-install-db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--old-mode='UTF8_IS_UTF8MB3' \
--default-time-zone=SYSTEM --enforce-storage-engine= \
Expand Down
12 changes: 11 additions & 1 deletion 11.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
fi
done
mariadb-install-db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--old-mode='UTF8_IS_UTF8MB3' \
--default-time-zone=SYSTEM --enforce-storage-engine= \
Expand Down
12 changes: 11 additions & 1 deletion 11.1/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
fi
done
mariadb-install-db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--old-mode='UTF8_IS_UTF8MB3' \
--default-time-zone=SYSTEM --enforce-storage-engine= \
Expand Down
12 changes: 11 additions & 1 deletion 11.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
fi
done
mariadb-install-db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--old-mode='UTF8_IS_UTF8MB3' \
--default-time-zone=SYSTEM --enforce-storage-engine= \
Expand Down
12 changes: 11 additions & 1 deletion 11.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
fi
done
mariadb-install-db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--old-mode='UTF8_IS_UTF8MB3' \
--default-time-zone=SYSTEM --enforce-storage-engine= \
Expand Down
12 changes: 11 additions & 1 deletion 11.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
fi
done
mariadb-install-db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--old-mode='UTF8_IS_UTF8MB3' \
--default-time-zone=SYSTEM --enforce-storage-engine= \
Expand Down
12 changes: 11 additions & 1 deletion 11.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
fi
done
mariadb-install-db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--old-mode='UTF8_IS_UTF8MB3' \
--default-time-zone=SYSTEM --enforce-storage-engine= \
Expand Down
12 changes: 11 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 mysqld." (so we pass all "mysqld" arguments directly here)
mysql_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.
fi
done
mysql_install_db "${installArgs[@]}" "${mariadbdArgs[@]}" \
--skip-test-db \
--old-mode='UTF8_IS_UTF8MB3' \
--default-time-zone=SYSTEM --enforce-storage-engine= \
Expand Down
Loading