Repository navigation
Conversation
Runs each query with its constants as literals and again with some of them as PreparedStatement parameters, and requires the same rows. Its trials found ENG-30571 (the JDBC driver counts a ? in a string literal) and ENG-30572 (HAVING aggregates that differ only in their parameters are merged), widened ENG-30560 and ENG-30534, and hit ENG-30551; each is avoided while --avoid-known-bugs is on.
This was referenced Nov 6, 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 8 of ENG-30396: the PARAMS oracle, literals against JDBC parameters. Stacked on #7 (milestone 7), which is stacked on #6 to #1; review those first.
The nightly job runs PARAMS once VoltDB/internal#6347 and VoltDB/pro#7093 merge. They add it to the default oracles and pin this branch's head.
Why this oracle
VoltDB turns an ad hoc statement's literals into parameters itself ("auto-parameterization"), or plans the statement with its literals inline when it cannot. Statements with JDBC parameters, and every stored procedure statement, take the second path. Most of the bugs found in milestones 6 and 7 were in that literal handling: ENG-30551, ENG-30552, ENG-30560 and ENG-30562. PARAMS runs each query both ways and requires the same rows.
What it adds
PARAMS(oracle/VoltDBParameterOracle):The query. It generates one of two kinds:
Joins are TLP WHERE's. GROUP BY queries make no FULL JOINs (ENG-30531), since a parameter can change the plan.
The parameters. Each constant becomes a parameter with probability 3/4, written as:
?when the other operand of its comparison, arithmetic, LIKE, BETWEEN or IN is a column whose type holds the value. VoltDB gives such a parameter the column's type, and rejects a value that doesn't fit.CAST(? AS T)otherwise, where T is the literal's own type. VoltDB can't type a bare parameter with no column beside it, and types one inside ABS as FLOAT.Values are bound with typed setters. A TIMESTAMP is bound as its UTC instant, which is how VoltDB reads a TIMESTAMP literal.
What stays a literal:
--avoid-known-bugsis on, the operands of an expression of constants alone, which the planner folds (ENG-30547, ENG-30548).The check. Both queries must return the same rows, as a multiset, compared as TLP compares them. An expected error in either query skips the check; an unexpected one fails it. A failure reports both queries and the parameters' values and types, and
--use-reducerworks.Other changes:
VoltDBExpressionEvaluator.isConstantis package-private, andBinarygainsgetBytes.run-sqlancer.sh's help lists PARAMS.TestVoltDBParameterOracle: 2 unit tests of how parameters are typed, with no server needed.Bugs found
Each has a minimal reproduction and is linked to ENG-30396. Each is avoided while
--avoid-known-bugsis on.?in a prepared statement as a parameter, including one inside a string literal:(query + ";").split("\\?")inJDBC4Statement. SoINSERT ... VALUES (?, 'what?')fails: "Incorrect number of parameters passed". All 4 failed databases of the first trial.?is always a parameter.HAVING MAX(k + ?) < MAX(k + ?)with 1 and 2 returns no groups. They stay apart in the SELECT list and with literals. All 4 failed databases of the second trial.CAST(1.5 AS DECIMAL)or0.1 + 0.2. That covers every prepared statement with parameters and every stored procedure:CREATE PROCEDURE p AS SELECT CAST(1.5 AS DECIMAL) ...fails. All 7 failed databases of the first 10-minute trials.MAX('00')besideMAX(x'00')returns the byte 0x00; in the other order the query fails with a cast error.A query that would have to keep a DECIMAL, VARBINARY or
?-holding constant as a literal is skipped.Testing
mvn verify -DskipTestspasses: formatter, checkstyle, PMD and SpotBugs.Unit tests:
TestVoltDBExpressionEvaluator(13),TestVoltDBConstantGenerator(2) andTestVoltDBParameterOracle(2) pass.Local trials, PARAMS alone:
--avoid-known-bugs false: fails within a minute, as expected.--use-reducer, at 929fbd8: 1 node, 34,417 checks, PASS; 3 nodes with k=1, 21,643 checks, PASS.Lab:
matrix-systemtest-apprunner-sqlancerbuild ENG-30396: SQLancer VoltDB provider, milestone 8: the PARAMS oracle #8 on jenkins-st:Setup: milestone 7's pipeline, with this change's settings given as parameters:
SQLANCER_REF929fbd8 andORACLESwith PARAMS. That is the same as these defaults.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, all seven oracles,
--use-reducer.sqlancer-3n-k1sqlancer-1n-k0