File tree Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -97,21 +97,25 @@ docker_temp_server_start() {
9797 if [ " $result " != " 0" ]; then
9898 mysql_error " Unable to start server. Status code $result ."
9999 fi
100+
101+ # For 5.7+ the server is ready for use as soon as startup command unblocks
102+ if [ " ${MYSQL_MAJOR} " = " 5.5" ] || [ " ${MYSQL_MAJOR} " = " 5.6" ]; then
103+ mysql_note " Waiting for server startup"
104+ for i in {30..0}; do
105+ if echo ' SELECT 1' | " ${mysql[@]} " & > /dev/null; then
106+ break
107+ fi
108+ sleep 1
109+ done
110+ if [ " $i " = 0 ]; then
111+ mysql_error " Unable to start server."
112+ fi
113+ fi
100114}
101115
102116# Wait for the temporary server to be ready for connections.
103117# It is only used for versions older than 5.7
104118docker_wait_for_server () {
105- local mysql=( " $@ " )
106- for i in {30..0}; do
107- if echo ' SELECT 1' | " ${mysql[@]} " & > /dev/null; then
108- break
109- fi
110- sleep 1
111- done
112- if [ " $i " = 0 ]; then
113- mysql_error " Unable to start server."
114- fi
115119}
116120
117121# Stop the server. When using a local socket file mysqladmin will block until
@@ -278,11 +282,6 @@ _main() {
278282
279283 mysql_note " Starting temporary server"
280284 docker_temp_server_start " $@ "
281- # For 5.7+ the server is ready for use as soon as startup command unblocks
282- if [ " ${MYSQL_MAJOR} " = " 5.5" ] || [ " ${MYSQL_MAJOR} " = " 5.6" ]; then
283- mysql_note " Waiting for server startup"
284- docker_wait_for_server " ${mysql[@]} "
285- fi
286285 mysql_note " Temporary server started."
287286
288287
You can’t perform that action at this time.
0 commit comments