Skip to content

Commit 9a3f9da

Browse files
committed
HHH-17537 Update MySQL CI testing to 8.2.0
1 parent b1f82ad commit 9a3f9da

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

docker_db.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ else
1616
fi
1717

1818
mysql() {
19-
mysql_8_1
19+
mysql_8_2
2020
}
2121

2222
mysql_8_0() {
@@ -67,6 +67,30 @@ mysql_8_1() {
6767
fi
6868
}
6969

70+
mysql_8_2() {
71+
$CONTAINER_CLI rm -f mysql || true
72+
$CONTAINER_CLI run --name mysql -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mysql:8.2.0 --character-set-server=utf8mb4 --collation-server=utf8mb4_0900_as_cs --skip-character-set-client-handshake --log-bin-trust-function-creators=1
73+
# Give the container some time to start
74+
OUTPUT=
75+
n=0
76+
until [ "$n" -ge 5 ]
77+
do
78+
# Need to access STDERR. Thanks for the snippet https://stackoverflow.com/a/56577569/412446
79+
{ OUTPUT="$( { $CONTAINER_CLI logs mysql; } 2>&1 1>&3 3>&- )"; } 3>&1;
80+
if [[ $OUTPUT == *"ready for connections"* ]]; then
81+
break;
82+
fi
83+
n=$((n+1))
84+
echo "Waiting for MySQL to start..."
85+
sleep 3
86+
done
87+
if [ "$n" -ge 5 ]; then
88+
echo "MySQL failed to start and configure after 15 seconds"
89+
else
90+
echo "MySQL successfully started"
91+
fi
92+
}
93+
7094
mariadb() {
7195
mariadb_11_1
7296
}
@@ -863,7 +887,7 @@ tidb_5_1() {
863887
echo "Waiting for TiDB to start..."
864888
sleep 3
865889
done
866-
$CONTAINER_CLI run --link tidb:tidb -it --rm docker.io/mysql:8.0.31 mysql -htidb -P4000 -uroot -e "create database hibernate_orm_test; create user 'hibernate_orm_test' identified by 'hibernate_orm_test'; grant all on hibernate_orm_test.* to 'hibernate_orm_test';"
890+
$CONTAINER_CLI run --link tidb:tidb -it --rm docker.io/mysql:8.2.0 mysql -htidb -P4000 -uroot -e "create database hibernate_orm_test; create user 'hibernate_orm_test' identified by 'hibernate_orm_test'; grant all on hibernate_orm_test.* to 'hibernate_orm_test';"
867891
if [ "$n" -ge 5 ]; then
868892
echo "TiDB failed to start and configure after 15 seconds"
869893
else
@@ -894,6 +918,7 @@ if [ -z ${1} ]; then
894918
echo -e "\tmssql_2022"
895919
echo -e "\tmssql_2017"
896920
echo -e "\tmysql"
921+
echo -e "\tmysql_8_2"
897922
echo -e "\tmysql_8_1"
898923
echo -e "\tmysql_8_0"
899924
echo -e "\toracle"

0 commit comments

Comments
 (0)