Skip to content

Commit c403e77

Browse files
committed
Old Informix doesn't support table aliases in DELETE statements. Issue HHH-18473 remains open only for joins and conditions within a DELETE.
1 parent 5737da6 commit c403e77

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,6 @@ public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, @
11471147

11481148
@Override
11491149
public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport() {
1150-
return DmlTargetColumnQualifierSupport.TABLE_ALIAS;
1150+
return getVersion().isSameOrAfter( 12,10 ) ? DmlTargetColumnQualifierSupport.TABLE_ALIAS : DmlTargetColumnQualifierSupport.NONE;
11511151
}
11521152
}

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixSqlAstTranslator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,10 @@ public void visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeti
321321
@Override
322322
protected void renderDmlTargetTableExpression(NamedTableReference tableReference) {
323323
super.renderDmlTargetTableExpression( tableReference );
324-
if ( getClauseStack().getCurrent() != Clause.INSERT ) {
325-
renderTableReferenceIdentificationVariable( tableReference );
324+
if (getDialect().getVersion().isSameOrAfter( 12, 10 )) {
325+
if ( getClauseStack().getCurrent() != Clause.INSERT ) {
326+
renderTableReferenceIdentificationVariable( tableReference );
327+
}
326328
}
327329
}
328330

hibernate-core/src/test/java/org/hibernate/orm/test/query/QueryTimeOutTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.util.Map;
1111

1212
import org.hibernate.cfg.AvailableSettings;
13+
import org.hibernate.community.dialect.InformixDialect;
1314
import org.hibernate.dialect.AbstractTransactSQLDialect;
1415
import org.hibernate.dialect.OracleDialect;
1516
import org.hibernate.dialect.SybaseDialect;
@@ -78,6 +79,10 @@ else if ( DialectContext.getDialect() instanceof SybaseDialect ) {
7879
else if ( DialectContext.getDialect() instanceof AbstractTransactSQLDialect ) {
7980
baseQuery = "update ae1_0 set name=? from AnEntity ae1_0";
8081
}
82+
else if (DialectContext.getDialect() instanceof InformixDialect && DialectContext.getDialect().getVersion()
83+
.isBefore(12, 10)) {
84+
baseQuery = "update AnEntity set name=?";
85+
}
8186
else {
8287
baseQuery = "update AnEntity ae1_0 set name=?";
8388
}

0 commit comments

Comments
 (0)