Repository navigation
Conversation
…, WITH) SETOPS checks UNION, INTERSECT and EXCEPT, with and without ALL, against the operation done in Java on the operands' rows. DERIVED checks a query against itself in a derived table, with its WHERE clause outside a derived table or common table, and a recursive WITH against its closure computed in Java. Queries that do not start with SELECT go through @adhoc (ENG-30603). Avoids ENG-30604 and ENG-30605.
…ration with string outputs)
This was referenced Nov 8, 2026
Author
|
Superseded by #51, which combines every ENG-30396 PR of this repo into one. This PR's branch is kept, and its description still has this milestone's details and lab results. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Milestone 16 of ENG-30396 (tracked in ENG-30581, epic ENG-30580 "SQL Housekeeping"): set operations, derived tables and WITH. Stacked on #15 (milestone 15), which is stacked on #14 to #1; review those first.
The nightly job runs the new oracles once VoltDB/internal#6356 is merged; VoltDB/pro#7102 adds them to
run-jenkins-sqlancer-test.sh's default.Why
No oracle exercised UNION, INTERSECT or EXCEPT, a derived table, or a common table expression; the planner rewrites all three (pushing a WHERE clause into a derived table, distributing a set operation across partitions), and a wrong rewrite gives a wrong result without an error.
What it changes
oracle/VoltDBSetOperationOracle): UNION, INTERSECT and EXCEPT, each with and without ALL, asA op Bor(A op B) op C, sometimes insideSELECT * FROM (...) AS u(not when an output is a string, ENG-30607, or an operand is partitioned, ENG-30604), checked against the same operation done in Java on each operand's rows. Rows are compared as multisets with NULLs equal and exact numbers by value (VoltDBRows.key), since a set operation's type may widen. The oracle follows VoltDB's rules: one type per position (an operand without a column of it outputs a constant such asCAST(2 AS TINYINT)), and at most one partitioned operand.oracle/VoltDBDerivedTableOracle), three modes:WRAP: a query againstSELECT * FROM (query) AS d.PUSH: a query against the same query with every FROM column selected under an alias in a derived table and its fetch list and WHERE clause outside it, so that VoltDB pushes the WHERE clause back down; over replicated tables, sometimes asWITH D AS (...).RECURSIVE:WITH RECURSIVEover an integer column of a replicated table against the closure computed in Java (closures over 5,000 rows are skipped).WITH ...,(SELECT ...) EXCEPT ...) go through{call @AdHoc(?)}, since the JDBC driver rejects them inexecuteQuery(ENG-30603).run-sqlancer.shpasses--num-statement-kind-retries 20. SQLancer retries a failed INSERT with new values up to 1,000 times; once a table's key had run out of values (a BOOLEAN or TINYINT primary key), every insert of that database spent 1,000 constraint violations, and the runs' "successful statements" fell to 70 to 81%. With 20, a local seed that had 54% has 90%.Bugs found
--avoid-known-bugsis trueWHERE k = 1on the partitioning column), returns the replicated operands' rows once per site: 17 rows instead of 3 on 8 sites. Found by SETOPS. Wrong result.'a' UNION ALL 'abc'gives'a '. A VARCHAR column on either side is right. Found by SETOPS. Wrong result.SELECT * FROM (A UNION B) AS u, fails with "The size 17 of the value '...' exceeds the size of the VARCHAR(16) column" when A's column is VARCHAR(16) or wider and a value from B is longer; the bare set operation is right. Found by SETOPS in lab build #28. Wrong error.executeQueryrejectsWITH ... SELECTand(SELECT ...) EXCEPT ..., andexecutereturns their first value as an update count.{call @AdHoc(?)}.Testing
mvn verify(checkstyle, PMD, formatter) passes.Local trials against 16.1.0-SNAPSHOT at internal 17c453541b, built privately,
--use-reducer:Lab:
matrix-systemtest-apprunner-sqlancerbuild ENG-30396: run-coverage.sh: Java and C++ coverage of SQLancer's runs, against sqlcoverage (milestone 30) #29 on jenkins-st, a replay of build ENG-30396: STREAMS oracle, export, and the fixes lab builds #41-#45 needed (milestone 29) #28 (with ENG-30396: subqueries, and the SUBQUERY and WINDOW oracles (milestone 14) #14's kit and agent parameters):Setup: the fork at a0f7d1a, the milestone 16
run-jenkins-sqlancer-test.sh(sha1 29e4de69),CLUSTERS3:1:300 1:0 3:2:0:2, all thirteen oracles. The job checks out pro at the commit its kit was built from, so the replay writes the new script over the kit's copy.Kit: releases/one-offs/16.1.0-SNAPSHOT-ENG-30396-sqlancer-nightly/2.
Agent: an
apprunner-lxd6agent (Ubuntu 22.04), JDK 25.Runs: 45 minutes each,
--use-reducer, 2 hours 18 minutes in all.sqlancer-3n-k1-kill300sqlancer-1n-k0sqlancer-3n-k2-s2The replay before it, ENG-30396: STREAMS oracle, export, and the fixes lab builds #41-#45 needed (milestone 29) #28 (c12ccb7), passed the run with node failures (102,429 checks, 8 kills, 8 rejoins) and the k=2 run (114,332). The 1-node run failed twice on ENG-30607, which a0f7d1a works around.
No run found a wrong result that is not filed.