Skip to content

Commit c6c3d3f

Browse files
MoadElfatihibeikov
authored andcommitted
HHH-19228 upgrade mysql testing version to 9.2
1 parent 14e318b commit c6c3d3f

File tree

7 files changed

+45
-5
lines changed

7 files changed

+45
-5
lines changed

docker_db.sh

+26-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ else
1616
fi
1717

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

2222
mysql_8_0() {
@@ -91,6 +91,30 @@ mysql_8_2() {
9191
fi
9292
}
9393

94+
mysql_9_2() {
95+
$CONTAINER_CLI rm -f mysql || true
96+
$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 ${DB_IMAGE_MYSQL_9_2:-docker.io/mysql:9.2.0} --character-set-server=utf8mb4 --collation-server=utf8mb4_0900_as_cs --init-connect="SET character_set_client= 'utf8mb4';SET character_set_results = 'utf8mb4'; SET character_set_connection= 'utf8mb4'; SET collation_connection = 'utf8mb4_0900_as_cs';" --log-bin-trust-function-creators=1 --lower_case_table_names=2
97+
# Give the container some time to start
98+
OUTPUT=
99+
n=0
100+
until [ "$n" -ge 5 ]
101+
do
102+
# Need to access STDERR. Thanks for the snippet https://stackoverflow.com/a/56577569/412446
103+
{ OUTPUT="$( { $CONTAINER_CLI logs mysql; } 2>&1 1>&3 3>&- )"; } 3>&1;
104+
if [[ $OUTPUT == *"ready for connections"* ]]; then
105+
break;
106+
fi
107+
n=$((n+1))
108+
echo "Waiting for MySQL to start..."
109+
sleep 3
110+
done
111+
if [ "$n" -ge 5 ]; then
112+
echo "MySQL failed to start and configure after 15 seconds"
113+
else
114+
echo "MySQL successfully started"
115+
fi
116+
}
117+
94118
mariadb() {
95119
mariadb_11_7
96120
}
@@ -1058,6 +1082,7 @@ if [ -z ${1} ]; then
10581082
echo -e "\tmssql_2022"
10591083
echo -e "\tmssql_2017"
10601084
echo -e "\tmysql"
1085+
echo -e "\tmysql_9_2"
10611086
echo -e "\tmysql_8_2"
10621087
echo -e "\tmysql_8_1"
10631088
echo -e "\tmysql_8_0"

hibernate-core/src/test/java/org/hibernate/orm/test/mapping/identifier/NaiveEqualsHashCodeEntityTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void testPersistForceFlush() {
100100
}
101101

102102
//tag::entity-pojo-naive-equals-hashcode-example[]
103-
@Entity(name = "Library")
103+
@Entity(name = "MyLibrary")
104104
public static class Library {
105105

106106
@Id

hibernate-core/src/test/java/org/hibernate/orm/test/mapping/identifier/NaturalIdEqualsHashCodeEntityTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public void testPersist() {
6868
}
6969

7070
//tag::entity-pojo-natural-id-equals-hashcode-example[]
71-
@Entity(name = "Library")
71+
@Entity(name = "MyLibrary")
7272
public static class Library {
7373

7474
@Id

hibernate-core/src/test/java/org/hibernate/orm/test/mapping/identifier/SimpleEntityTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void testTransientSetIdentityScope() {
149149
}
150150

151151
//tag::entity-pojo-set-mapping-example[]
152-
@Entity(name = "Library")
152+
@Entity(name = "MyLibrary")
153153
public static class Library {
154154

155155
@Id

hibernate-core/src/test/java/org/hibernate/orm/test/query/criteria/CriteriaOrderedSetAggregateTest.java

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import org.hibernate.dialect.CockroachDialect;
1212
import org.hibernate.dialect.H2Dialect;
13+
import org.hibernate.dialect.MySQLDialect;
1314
import org.hibernate.dialect.PostgreSQLDialect;
1415
import org.hibernate.dialect.PostgresPlusDialect;
1516
import org.hibernate.query.criteria.HibernateCriteriaBuilder;
@@ -198,8 +199,14 @@ public void testListaggWithFilterAndWindow(SessionFactoryScope scope) {
198199
} );
199200
}
200201

202+
/*
203+
* Skipped for MySQL 9.2: The test fails due to a regression in MySQL 9.2, which no longer supports NULLS FIRST/LAST in ORDER BY within LISTAGG as expected.
204+
* See https://bugs.mysql.com/bug.php?id=117765 for more details.
205+
* This is a MySQL issue, not a problem in the dialect implementation.
206+
*/
201207
@Test
202208
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsStringAggregation.class)
209+
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 9, minorVersion = 2, reason = "https://bugs.mysql.com/bug.php?id=117765")
203210
public void testListaggWithNullsClause(SessionFactoryScope scope) {
204211
scope.inTransaction( session -> {
205212
HibernateCriteriaBuilder cb = session.getCriteriaBuilder();

hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/OrderedSetAggregateTest.java

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.Date;
99
import java.util.List;
1010

11+
import org.hibernate.dialect.MySQLDialect;
1112
import org.hibernate.testing.orm.junit.JiraKey;
1213
import org.hibernate.testing.orm.domain.StandardDomainModel;
1314
import org.hibernate.testing.orm.domain.gambit.EntityOfBasics;
@@ -17,6 +18,7 @@
1718
import org.hibernate.testing.orm.junit.ServiceRegistry;
1819
import org.hibernate.testing.orm.junit.SessionFactory;
1920
import org.hibernate.testing.orm.junit.SessionFactoryScope;
21+
import org.hibernate.testing.orm.junit.SkipForDialect;
2022
import org.junit.jupiter.api.AfterEach;
2123
import org.junit.jupiter.api.BeforeEach;
2224
import org.junit.jupiter.api.Test;
@@ -135,9 +137,15 @@ public void testListaggWithFilter(SessionFactoryScope scope) {
135137
);
136138
}
137139

140+
/*
141+
* Skipped for MySQL 9.2: The test fails due to a regression in MySQL 9.2, which no longer supports NULLS FIRST/LAST in ORDER BY within LISTAGG as expected.
142+
* See https://bugs.mysql.com/bug.php?id=117765 for more details.
143+
* This is a MySQL issue, not a problem in the dialect implementation.
144+
*/
138145
@Test
139146
@JiraKey( value = "HHH-15360")
140147
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsStringAggregation.class)
148+
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 9, minorVersion = 2, reason = "https://bugs.mysql.com/bug.php?id=117765")
141149
public void testListaggWithNullsClause(SessionFactoryScope scope) {
142150
scope.inTransaction(
143151
session -> {

settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ dependencyResolutionManagement {
224224
def informixVersion = version "informix", "4.50.11"
225225
def mariadbVersion = version "mariadb", "3.5.1"
226226
def mssqlVersion = version "mssql", "12.8.1.jre11"
227-
def mysqlVersion = version "mysql", "9.1.0"
227+
def mysqlVersion = version "mysql", "9.2.0"
228228
def oracleVersion = version "oracle", "23.7.0.25.01"
229229
def pgsqlVersion = version "pgsql", "42.7.4"
230230
def sybaseVersion = version "sybase", "1.3.1"

0 commit comments

Comments
 (0)