Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,10 @@ public int rowIdSqlType() {
public String getRowIdColumnString(String rowId) {
return rowId( rowId ) + " rowid not null generated always";
}

@Override
public boolean supportsValuesList() {
// DB2 z/OS has a VALUES statement, but that doesn't support multiple values
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,10 @@ public int rowIdSqlType() {
public String getRowIdColumnString(String rowId) {
return rowId( rowId ) + " rowid not null generated always";
}

@Override
public boolean supportsValuesList() {
// DB2 z/OS has a VALUES statement, but that doesn't support multiple values
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7628,12 +7628,21 @@ public void visitInListPredicate(InListPredicate inListPredicate) {
else if ( !dialect.supportsRowValueConstructorSyntaxInInList() ) {
// Some DBs like Oracle support tuples only for the IN subquery predicate
if ( dialect.supportsRowValueConstructorSyntaxInInSubQuery() && dialect.supportsValuesList() ) {
final int tupleSize = lhsTuple.getExpressionType().getJdbcTypeCount();
inListPredicate.getTestExpression().accept( this );
if ( inListPredicate.isNegated() ) {
appendSql( " not" );
}
appendSql( " in (select * from (values" );
appendSql( " in (select" );
char separator = ' ';
for ( int i = 0; i < tupleSize; i++ ) {
appendSql( separator );
appendSql( "v_.c" );
appendSql( i );
separator = ',';
}
appendSql( " from (values" );
separator = ' ';
for ( Expression expression : listExpressions ) {
appendSql( separator );
appendSql( OPEN_PARENTHESIS );
Expand All @@ -7642,6 +7651,15 @@ else if ( !dialect.supportsRowValueConstructorSyntaxInInList() ) {
separator = ',';
}
appendSql( CLOSE_PARENTHESIS );
appendSql( " v_" );
separator = '(';
for ( int i = 0; i < tupleSize; i++ ) {
appendSql( separator );
appendSql( "c" );
appendSql( i );
separator = ',';
}
appendSql( CLOSE_PARENTHESIS );
appendSql( CLOSE_PARENTHESIS );
}
else if ( dialect.supportsRowValueConstructorSyntaxInInSubQuery() && dialect.supportsUnionAll() ) {
Expand Down
Loading