HHH-16454 PostgreSQL ILIKE Keyword is considered a column name when deducing alias injection points

This commit is contained in:
Andrea Boriero 2024-02-07 12:51:51 +01:00 committed by Marco Belladelli
parent 13c714c4c4
commit 29f51ef9ca
3 changed files with 27 additions and 0 deletions

View File

@ -972,4 +972,19 @@ public class H2LegacyDialect extends Dialect {
public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport() { public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport() {
return DmlTargetColumnQualifierSupport.TABLE_ALIAS; return DmlTargetColumnQualifierSupport.TABLE_ALIAS;
} }
@Override
public String getCaseInsensitiveLike() {
if ( getVersion().isSameOrAfter( 1, 4, 194 ) ) {
return "ilike";
}
else {
return super.getCaseInsensitiveLike();
}
}
@Override
public boolean supportsCaseInsensitiveLike() {
return getVersion().isSameOrAfter( 1, 4, 194 );
}
} }

View File

@ -982,4 +982,15 @@ public class H2Dialect extends Dialect {
public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport() { public DmlTargetColumnQualifierSupport getDmlTargetColumnQualifierSupport() {
return DmlTargetColumnQualifierSupport.TABLE_ALIAS; return DmlTargetColumnQualifierSupport.TABLE_ALIAS;
} }
@Override
public String getCaseInsensitiveLike() {
return "ilike";
}
@Override
public boolean supportsCaseInsensitiveLike(){
return true;
}
} }

View File

@ -153,6 +153,7 @@ public class PostgreSQLDialect extends Dialect {
public PostgreSQLDialect(DialectResolutionInfo info) { public PostgreSQLDialect(DialectResolutionInfo info) {
this( info, PostgreSQLDriverKind.determineKind( info ) ); this( info, PostgreSQLDriverKind.determineKind( info ) );
registerKeywords( info );
} }
public PostgreSQLDialect(DatabaseVersion version) { public PostgreSQLDialect(DatabaseVersion version) {