Skip to content

Commit a3c2dfa

Browse files
committed
HHH-19540 fix coalesce(:ids, 1) automatic add parentheses
1 parent 231163f commit a3c2dfa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hibernate-core/src/main/java/org/hibernate/query/sql/internal/NativeQueryImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,15 +969,15 @@ private boolean isEnclosedInParens(int sourcePosition) {
969969
for ( int i = sourcePosition - 1; i >= 0; i-- ) {
970970
final char ch = sqlString.charAt( i );
971971
if ( !isWhitespace( ch ) ) {
972-
isEnclosedInParens = ch == '(';
972+
isEnclosedInParens = ch == '(' || ch == ',';
973973
break;
974974
}
975975
}
976976
if ( isEnclosedInParens ) {
977977
for ( int i = sourcePosition + 1; i < sqlString.length(); i++ ) {
978978
final char ch = sqlString.charAt( i );
979979
if ( !isWhitespace( ch ) ) {
980-
isEnclosedInParens = ch == ')';
980+
isEnclosedInParens = ch == ')' || ch == ',';
981981
break;
982982
}
983983
}

0 commit comments

Comments
 (0)