File tree 1 file changed +14
-15
lines changed
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() {
97
97
if [ " $result " != " 0" ]; then
98
98
mysql_error " Unable to start server. Status code $result ."
99
99
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
100
114
}
101
115
102
116
# Wait for the temporary server to be ready for connections.
103
117
# It is only used for versions older than 5.7
104
118
docker_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
115
119
}
116
120
117
121
# Stop the server. When using a local socket file mysqladmin will block until
@@ -278,11 +282,6 @@ _main() {
278
282
279
283
mysql_note " Starting temporary server"
280
284
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
286
285
mysql_note " Temporary server started."
287
286
288
287
You can’t perform that action at this time.
0 commit comments