Fix newly added tests for derby

This commit is contained in:
Christian Beikov 2021-02-03 14:08:45 +01:00
parent 1983123d72
commit b3ab4c2299
3 changed files with 10 additions and 2 deletions

View File

@ -27,4 +27,10 @@ public class DerbyTenSixDialect extends DerbyTenFiveDialect {
public boolean supportsSequences() { public boolean supportsSequences() {
return true; return true;
} }
@Override
public String getCrossJoinSeparator() {
// 10.6 introduced support for the cross join syntax: http://db.apache.org/derby/docs/10.6/ref/rrefsqljcrossjoin.html
return " cross join ";
}
} }

View File

@ -557,6 +557,7 @@ public class ManyToManySizeTest2 extends BaseNonConfigCoreFunctionalTestCase {
} }
private static int countNumberOfJoins(String query) { private static int countNumberOfJoins(String query) {
return query.toLowerCase( Locale.ROOT ).split( " join ", -1 ).length - 1; String fromPart = query.toLowerCase( Locale.ROOT ).split( " from " )[1].split( " where " )[0];
return fromPart.split( "(\\sjoin\\s|,\\s)", -1 ).length - 1;
} }
} }

View File

@ -554,6 +554,7 @@ public class OneToManySizeTest2 extends BaseNonConfigCoreFunctionalTestCase {
} }
private static int countNumberOfJoins(String query) { private static int countNumberOfJoins(String query) {
return query.toLowerCase( Locale.ROOT ).split( " join ", -1 ).length - 1; String fromPart = query.toLowerCase( Locale.ROOT ).split( " from " )[1].split( " where " )[0];
return fromPart.split( "(\\sjoin\\s|,\\s)", -1 ).length - 1;
} }
} }