Skip to content
Open
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 @@ -41,7 +41,7 @@ public void check() throws SQLException {
}

ComparatorHelper.assumeResultSetsAreEqual(resultSet, secondResultSet, originalQueryString, combinedString,
state);
state, ComparatorHelper::canonicalizeResultValue);
}

}
16 changes: 12 additions & 4 deletions src/sqlancer/clickhouse/oracle/tlp/ClickHouseTLPSetOpOracle.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,21 @@ private void checkUnionDistinct() throws SQLException {
throw new IgnoreMeException();
}

Set<String> baselineSet = new HashSet<>(baselineRows);
Set<String> branchSet = new HashSet<>(branchRows);
Set<String> baselineSet = toSetIgnoringZeroSign(baselineRows);
Set<String> branchSet = toSetIgnoringZeroSign(branchRows);
if (!baselineSet.equals(branchSet)) {
throw new AssertionError(formatFailure("UNION_DISTINCT", baseline, branchUnion, baselineRows, branchRows));
}
}

private static Set<String> toSetIgnoringZeroSign(List<String> rows) {
Set<String> set = new HashSet<>();
for (String r : rows) {
set.add(ComparatorHelper.canonicalizeResultValue(r));
}
return set;
}

private static boolean containsNanOrInfinity(List<String> rows) {
for (String r : rows) {
if (r == null) {
Expand Down Expand Up @@ -139,8 +147,8 @@ private void checkIntersect() throws SQLException {
if (containsNanOrInfinity(branchRows) || containsNanOrInfinity(intersectRows)) {
throw new IgnoreMeException();
}
Set<String> intersectSet = new HashSet<>(intersectRows);
Set<String> branchSet = new HashSet<>(branchRows);
Set<String> intersectSet = toSetIgnoringZeroSign(intersectRows);
Set<String> branchSet = toSetIgnoringZeroSign(branchRows);
if (!intersectSet.equals(branchSet)) {
throw new AssertionError(
"INTERSECT subset violated: branch=" + branchName + " INTERSECT T produced " + intersectRows
Expand Down