Fixes for nightly failures of PG and EDB v12, DB2 10.5 and MariaDB. Exclude Oracle 21 from nightly runs in favor of Atlas build

This commit is contained in:
Christian Beikov 2024-07-16 17:25:57 +02:00
parent b51acb752d
commit 415bfcf8fa
7 changed files with 42 additions and 41 deletions

View File

@ -61,13 +61,18 @@ public class PostgresPlusLegacyDialect extends PostgreSQLLegacyDialect {
functionFactory.sysdate();
functionFactory.systimestamp();
functionFactory.bitand();
functionFactory.bitor();
functionContributions.getFunctionRegistry().patternDescriptorBuilder( "bitxor", "(bitor(?1,?2)-bitand(?1,?2))" )
.setExactArgumentCount( 2 )
.setArgumentTypeResolver( StandardFunctionArgumentTypeResolvers.ARGUMENT_OR_IMPLIED_RESULT_TYPE )
.register();
if ( getVersion().isSameOrAfter( 14 ) ) {
// Support for these functions were apparently only added in version 14
functionFactory.bitand();
functionFactory.bitor();
functionContributions.getFunctionRegistry().patternDescriptorBuilder(
"bitxor",
"(bitor(?1,?2)-bitand(?1,?2))"
)
.setExactArgumentCount( 2 )
.setArgumentTypeResolver( StandardFunctionArgumentTypeResolvers.ARGUMENT_OR_IMPLIED_RESULT_TYPE )
.register();
}
}
@Override

View File

@ -61,13 +61,19 @@ public class PostgresPlusDialect extends PostgreSQLDialect {
functionFactory.rownumRowid();
functionFactory.sysdate();
functionFactory.systimestamp();
functionFactory.bitand();
functionFactory.bitor();
functionContributions.getFunctionRegistry().patternDescriptorBuilder( "bitxor", "(bitor(?1,?2)-bitand(?1,?2))" )
.setExactArgumentCount( 2 )
.setArgumentTypeResolver( StandardFunctionArgumentTypeResolvers.ARGUMENT_OR_IMPLIED_RESULT_TYPE )
.register();
if ( getVersion().isSameOrAfter( 14 ) ) {
// Support for these functions were apparently only added in version 14
functionFactory.bitand();
functionFactory.bitor();
functionContributions.getFunctionRegistry().patternDescriptorBuilder(
"bitxor",
"(bitor(?1,?2)-bitand(?1,?2))"
)
.setExactArgumentCount( 2 )
.setArgumentTypeResolver( StandardFunctionArgumentTypeResolvers.ARGUMENT_OR_IMPLIED_RESULT_TYPE )
.register();
}
}
@Override

View File

@ -87,7 +87,7 @@ public class ArrayTrimTest {
}
@Test
@SkipForDialect(dialectClass = PostgreSQLDialect.class, majorVersion = 12, reason = "The PostgreSQL emulation for version < 14 doesn't throw an error")
@SkipForDialect(dialectClass = PostgreSQLDialect.class, majorVersion = 12, matchSubTypes = true, reason = "The PostgreSQL emulation for version < 14 doesn't throw an error")
@SkipForDialect(dialectClass = CockroachDialect.class, reason = "The Cockroach emulation doesn't throw an error")
public void testTrimOutOfRange(SessionFactoryScope scope) {
scope.inSession( em -> {

View File

@ -206,7 +206,7 @@ public class ManipulationCriteriaTest extends AbstractMetamodelSpecificTest {
@Test
// MySQL does not allow "delete/update from" and subqueries to use the same table
@SkipForDialect(dialectClass = MySQLDialect.class)
@SkipForDialect(dialectClass = MySQLDialect.class, matchSubTypes = true)
public void testDeleteWithUnCorrelatedSubquery() {
CriteriaBuilder builder = entityManagerFactory().getCriteriaBuilder();
EntityManager em = getOrCreateEntityManager();

View File

@ -145,11 +145,13 @@ public class GeneratedWritableDelegateTest {
scope.inTransaction( s -> {
s.createNativeMutationQuery( "create or replace function fun_upper_name() returns trigger as " + TRIGGER )
.executeUpdate();
s.createNativeMutationQuery( "drop trigger if exists upper_name_1 on values_only" ).executeUpdate();
s.createNativeMutationQuery( "drop trigger if exists upper_name_2 on values_and_identity" ).executeUpdate();
s.createNativeMutationQuery(
"create or replace trigger upper_name_1 before insert or update on values_only for each row execute procedure fun_upper_name()"
"create trigger upper_name_1 before insert or update on values_only for each row execute procedure fun_upper_name()"
).executeUpdate();
s.createNativeMutationQuery(
"create or replace trigger upper_name_2 before insert or update on values_and_identity for each row execute procedure fun_upper_name()"
"create trigger upper_name_2 before insert or update on values_and_identity for each row execute procedure fun_upper_name()"
).executeUpdate();
} );
}

View File

@ -254,7 +254,7 @@ public class DB2StoredProcedureTest {
" SELECT COUNT(*) INTO phoneCount " +
" FROM phone " +
" WHERE person_id = personId; " +
"END;"
"END"
);
statement.executeUpdate(
"CREATE OR REPLACE PROCEDURE sp_person_phones( " +
@ -266,7 +266,7 @@ public class DB2StoredProcedureTest {
" FROM phone " +
" WHERE person_id = personId; " +
" OPEN personPhones; " +
"END;"
"END"
);
statement.executeUpdate(
"CREATE OR REPLACE FUNCTION fn_count_phones( " +
@ -278,7 +278,7 @@ public class DB2StoredProcedureTest {
" FROM phone " +
" WHERE person_id = personId; " +
" RETURN phoneCount; " +
"END;"
"END"
);
statement.executeUpdate(
"CREATE OR REPLACE FUNCTION fn_person_and_phones(personId INTEGER) " +
@ -293,7 +293,7 @@ public class DB2StoredProcedureTest {
" \"ph.id\" BIGINT, " +
" \"ph.person_id\" BIGINT, " +
" \"ph.phone_number\" VARCHAR(255), " +
" \"ph.valid\" BOOLEAN " +
" \"ph.valid\" SMALLINT " +
" ) " +
" BEGIN ATOMIC " +
" RETURN SELECT pr.id AS \"pr.id\", " +
@ -309,7 +309,7 @@ public class DB2StoredProcedureTest {
" FROM person pr " +
" JOIN phone ph ON pr.id = ph.person_id " +
" WHERE pr.id = personId; " +
" END; " );
" END " );
statement.executeUpdate(
"CREATE OR REPLACE " +
"PROCEDURE singleRefCursor(OUT p_recordset CURSOR) " +
@ -318,7 +318,7 @@ public class DB2StoredProcedureTest {
" SELECT 1 as id " +
" FROM sysibm.dual; " +
" OPEN p_recordset; " +
" END; "
" END "
);
statement.executeUpdate(
"CREATE OR REPLACE " +
@ -329,11 +329,11 @@ public class DB2StoredProcedureTest {
" FROM sysibm.dual; " +
" SELECT 1 INTO p_value FROM sysibm.dual; " +
" OPEN p_recordset; " +
" END; "
" END"
);
statement.executeUpdate(
"CREATE OR REPLACE PROCEDURE sp_phone_validity ( " +
" IN validity BOOLEAN, " +
" IN validity SMALLINT, " +
" OUT personPhones CURSOR ) " +
"BEGIN " +
" SET personPhones = CURSOR FOR " +
@ -341,11 +341,11 @@ public class DB2StoredProcedureTest {
" FROM phone " +
" WHERE valid = validity; " +
" OPEN personPhones; " +
"END;"
"END"
);
statement.executeUpdate(
"CREATE OR REPLACE PROCEDURE sp_votes ( " +
" IN validity BOOLEAN, " +
" IN validity CHAR(1), " +
" OUT votes CURSOR ) " +
"BEGIN " +
" SET votes = CURSOR FOR " +
@ -353,13 +353,9 @@ public class DB2StoredProcedureTest {
" FROM vote " +
" WHERE vote_choice = validity; " +
" OPEN votes; " +
"END;"
"END"
);
}
catch (final SQLException e) {
System.err.println( "Error exporting procedure and function definitions to DB2 database : " + e.getMessage() );
e.printStackTrace( System.err );
}
} ) );
scope.inTransaction( (entityManager) -> {

View File

@ -32,7 +32,6 @@ stage('Configure') {
new BuildEnvironment( dbName: 'mariadb_10_4' ),
new BuildEnvironment( dbName: 'postgresql_12' ),
new BuildEnvironment( dbName: 'edb_12' ),
new BuildEnvironment( dbName: 'oracle_21' ), // Did not find an image for Oracle-XE 19c
new BuildEnvironment( dbName: 'db2_10_5', longRunning: true ),
new BuildEnvironment( dbName: 'mssql_2017' ), // Unfortunately there is no SQL Server 2008 image, so we have to test with 2017
// new BuildEnvironment( dbName: 'sybase_16' ), // There only is a Sybase ASE 16 image, so no pint in testing that nightly
@ -137,13 +136,6 @@ stage('Build') {
sh "./docker_db.sh edb_12"
state[buildEnv.tag]['containerName'] = "edb"
break;
case "oracle_21":
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('gvenzl/oracle-xe:21.3.0').pull()
}
sh "./docker_db.sh oracle_21"
state[buildEnv.tag]['containerName'] = "oracle"
break;
case "db2_10_5":
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('ibmoms/db2express-c@sha256:a499afd9709a1f69fb41703e88def9869955234c3525547e2efc3418d1f4ca2b').pull()