Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion docker_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ else
fi

mysql() {
mysql_8_2
mysql_9_2
}

mysql_8_0() {
Expand Down Expand Up @@ -91,6 +91,30 @@ mysql_8_2() {
fi
}

mysql_9_2() {
$CONTAINER_CLI rm -f mysql || true
$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
# Give the container some time to start
OUTPUT=
n=0
until [ "$n" -ge 5 ]
do
# Need to access STDERR. Thanks for the snippet https://stackoverflow.com/a/56577569/412446
{ OUTPUT="$( { $CONTAINER_CLI logs mysql; } 2>&1 1>&3 3>&- )"; } 3>&1;
if [[ $OUTPUT == *"ready for connections"* ]]; then
break;
fi
n=$((n+1))
echo "Waiting for MySQL to start..."
sleep 3
done
if [ "$n" -ge 5 ]; then
echo "MySQL failed to start and configure after 15 seconds"
else
echo "MySQL successfully started"
fi
}

mariadb() {
mariadb_11_7
}
Expand Down Expand Up @@ -1049,6 +1073,7 @@ if [ -z ${1} ]; then
echo -e "\tmssql_2022"
echo -e "\tmssql_2017"
echo -e "\tmysql"
echo -e "\tmysql_9_2"
echo -e "\tmysql_8_2"
echo -e "\tmysql_8_1"
echo -e "\tmysql_8_0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void testPersistForceFlush() {
}

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

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void testPersist() {
}

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

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void testTransientSetIdentityScope() {
}

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

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.PostgresPlusDialect;
import org.hibernate.query.criteria.HibernateCriteriaBuilder;
Expand Down Expand Up @@ -198,8 +199,14 @@ public void testListaggWithFilterAndWindow(SessionFactoryScope scope) {
} );
}

/*
* 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.
* See https://bugs.mysql.com/bug.php?id=117765 for more details.
* This is a MySQL issue, not a problem in the dialect implementation.
*/
@Test
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsStringAggregation.class)
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 9, minorVersion = 2, reason = "https://bugs.mysql.com/bug.php?id=117765")
public void testListaggWithNullsClause(SessionFactoryScope scope) {
scope.inTransaction( session -> {
HibernateCriteriaBuilder cb = session.getCriteriaBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Date;
import java.util.List;

import org.hibernate.dialect.MySQLDialect;
import org.hibernate.testing.orm.junit.JiraKey;
import org.hibernate.testing.orm.domain.StandardDomainModel;
import org.hibernate.testing.orm.domain.gambit.EntityOfBasics;
Expand All @@ -17,6 +18,7 @@
import org.hibernate.testing.orm.junit.ServiceRegistry;
import org.hibernate.testing.orm.junit.SessionFactory;
import org.hibernate.testing.orm.junit.SessionFactoryScope;
import org.hibernate.testing.orm.junit.SkipForDialect;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -135,9 +137,15 @@ public void testListaggWithFilter(SessionFactoryScope scope) {
);
}

/*
* 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.
* See https://bugs.mysql.com/bug.php?id=117765 for more details.
* This is a MySQL issue, not a problem in the dialect implementation.
*/
@Test
@JiraKey( value = "HHH-15360")
@RequiresDialectFeature(feature = DialectFeatureChecks.SupportsStringAggregation.class)
@SkipForDialect(dialectClass = MySQLDialect.class, majorVersion = 9, minorVersion = 2, reason = "https://bugs.mysql.com/bug.php?id=117765")
public void testListaggWithNullsClause(SessionFactoryScope scope) {
scope.inTransaction(
session -> {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ dependencyResolutionManagement {
def informixVersion = version "informix", "4.50.11"
def mariadbVersion = version "mariadb", "3.5.1"
def mssqlVersion = version "mssql", "12.8.1.jre11"
def mysqlVersion = version "mysql", "9.1.0"
def mysqlVersion = version "mysql", "9.2.0"
def oracleVersion = version "oracle", "23.7.0.25.01"
def pgsqlVersion = version "pgsql", "42.7.4"
def sybaseVersion = version "sybase", "1.3.1"
Expand Down