From b0a0e546712534b30ac13e8b2829f23654facbc5 Mon Sep 17 00:00:00 2001 From: Marc Bennewitz Date: Sat, 14 Nov 2020 15:40:20 +0100 Subject: [PATCH] Execute SQL in entrypoint with "--comments" The primary reason to disable this seems to be to avoid normally-unnecessary data transfer, but in this case we're explicitly connecting over the local unix socket, so streaming the comments to the server and letting it strip them should be *almost* as efficient as the client doing so. --- 5.6/docker-entrypoint.sh | 2 +- 5.7/docker-entrypoint.sh | 2 +- 8.0/docker-entrypoint.sh | 2 +- template/docker-entrypoint.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 83d6ffe5e..bd0dc689d 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -208,7 +208,7 @@ docker_process_sql() { set -- --database="$MYSQL_DATABASE" "$@" fi - mysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@" + mysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" --comments "$@" } # Initializes database with timezone info and root password, plus optional extra db/user diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 83d6ffe5e..bd0dc689d 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -208,7 +208,7 @@ docker_process_sql() { set -- --database="$MYSQL_DATABASE" "$@" fi - mysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@" + mysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" --comments "$@" } # Initializes database with timezone info and root password, plus optional extra db/user diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 83d6ffe5e..bd0dc689d 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -208,7 +208,7 @@ docker_process_sql() { set -- --database="$MYSQL_DATABASE" "$@" fi - mysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@" + mysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" --comments "$@" } # Initializes database with timezone info and root password, plus optional extra db/user diff --git a/template/docker-entrypoint.sh b/template/docker-entrypoint.sh index 83d6ffe5e..bd0dc689d 100755 --- a/template/docker-entrypoint.sh +++ b/template/docker-entrypoint.sh @@ -208,7 +208,7 @@ docker_process_sql() { set -- --database="$MYSQL_DATABASE" "$@" fi - mysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" "$@" + mysql --defaults-extra-file=<( _mysql_passfile "${passfileArgs[@]}") --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" --comments "$@" } # Initializes database with timezone info and root password, plus optional extra db/user