During testing on a local Informix database, a syntax error occurred in the test org.hibernate.orm.test.hql.BulkManipulationTest#testInsertAcrossMappedJoin when trying to create a temporary table.
create temp table HTE_Joiner(
HTE_IDENTITY int8 serial8 not null,
id int8,
joinedName varchar(255),
name varchar(255),
primary key (HTE_IDENTITY))
with no log
In my opinion, the error lies within the org.hibernate.dialect.temptable.TemporaryTable class, specifically at line 323 during the creation of the TemporaryTableColumn identity. The method hasDataTypeInIdentityColumn() from the dialect is not being considered here, unlike in org.hibernate.tool.schema.internal.ColumnDefinitions#appendColumnDefinition. When I took this into account, the resulting CREATE TEMP TABLE command was correct, and the unit test passed without errors.
Here’s my modification:
String sqlTypeName = "";
if (dialect.getIdentityColumnSupport().hasDataTypeInIdentityColumn()) {
sqlTypeName = column.getSqlType(runtimeModelCreationContext.getMetadata()) + " ";
}
sqlTypeName = sqlTypeName + dialect.getIdentityColumnSupport().getIdentityColumnString(column.getSqlTypeCode(runtimeModelCreationContext.getMetadata()));
columns.add(
new TemporaryTableColumn(
temporaryTable,
ENTITY_TABLE_IDENTITY_COLUMN,
jdbcMapping,
sqlTypeName,
column.getColumnSize(
dialect,
runtimeModelCreationContext.getMetadata()
),
// Always report as nullable as the identity column string usually includes the not null constraint
true,//column.isNullable()
true
)
);
I’m not sure if this solution is correct for all other dialects. By the way, where can I find the results of matrix tests for other dialects (at least those supported by you)?