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 a2d3315067
commit 6057d99b79
No known key found for this signature in database
GPG Key ID: D1D0C3030AE3AA35
3 changed files with 27 additions and 0 deletions

View File

@ -940,4 +940,19 @@ public class H2LegacyDialect extends Dialect {
public int rowIdSqlType() {
return BIGINT;
}
@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

@ -935,4 +935,15 @@ public class H2Dialect extends Dialect {
return "?" + position;
}
}
@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) {
this( info, PostgreSQLDriverKind.determineKind( info ) );
registerKeywords( info );
}
public PostgreSQLDialect(DatabaseVersion version) {