[jOOQ/jOOQ#8754] Add a few missing parenthesis pairs

While removing the SQL templating the parentheses went missing in some
of the rendered SQL. Also added parenthesis pairs in a few cases where
it might also have been missing before.
This commit is contained in:
Knut Wannheden 2019-06-25 08:41:46 +02:00
parent 27973dbf1b
commit be64a88083
2 changed files with 6 additions and 4 deletions

View File

@ -104,7 +104,7 @@ final class RegexpLike extends AbstractCondition {
case POSTGRES: {
ctx.visit(search).sql(" ~ ").visit(pattern);
ctx.sql('(').visit(search).sql(" ~ ").visit(pattern).sql(')');
break;
}
@ -130,11 +130,13 @@ final class RegexpLike extends AbstractCondition {
case DERBY:
case FIREBIRD:
default: {
ctx.visit(search)
ctx.sql('(')
.visit(search)
.sql(' ')
.visit(K_LIKE_REGEX)
.sql(' ')
.visit(pattern);
.visit(pattern)
.sql(')');
break;
}

View File

@ -71,7 +71,7 @@ final class TableComparison<R extends Record> extends AbstractCondition {
case POSTGRES: {
ctx.visit(lhs).sql(' ').sql(comparator.toSQL()).sql(' ').visit(rhs);
ctx.sql('(').visit(lhs).sql(' ').sql(comparator.toSQL()).sql(' ').visit(rhs).sql(')');
break;
}