Repository navigation
dialect(h2): version checks and fixes, tested on H2 1.4.200 to 2.3.232 - #105
Merged
Merged
Conversation
H2 is embedded and serves no connection: the tests load the jar of each
version (1.4.200, 2.0.206, 2.1.214, 2.2.224, 2.3.232) in a class loader
of its own and connect with that version's driver, the dialect built
from the connection. No container is needed.
H2Dialect:
- paginationGenerator: an offset alone as OFFSET n ROWS; LIMIT -1,
written before, every 2.x refuses ("Invalid value -1 for parameter
result FETCH"), 2.2.224 too
- generateBitAggregation, supportsBitAggregation: BIT_*_AGG from 2.0;
1.4 has BIT_AND and BIT_OR only, the other four are refused there
- generateListAgg: separator and the NULL's stand-in as string
literals, a quote in them ended the literal; ON OVERFLOW TRUNCATE
from 2.0; 1.4 orders WITHIN GROUP by one expression without NULLS
FIRST/LAST, a list in the order of more is refused there
- cteGenerator: no recursive expression; H2 runs WITH RECURSIVE only
with the list of its columns, which a Cte has not
- generatePercentileDisc: the standard's first value whose cumulative
share reaches p, on the sorted ARRAY_AGG; H2's own PERCENTILE_DISC
is the nearest of the positions p (n - 1) in every version, 20 for
10 at 0.25 of 10, 20, 30, 40; PERCENTILE_CONT stays H2's own
- generateRegularExpression: the expression as it is in
'(?-u)\A(?:...)\z'; taking its flags out lost s and u, \Q...\E was
unquoted, and H2 folds the case beyond ASCII where Java's (?i) does
not
Version tests (versions package, -Dintegration.docker=true):
- H2Versions: a database in memory of an H2 version, a login to it
- profile h2-versions: maven-dependency-plugin copies the jars into
target/h2-versions, only with -Dintegration.docker=true
- H2PaginationTest, H2BitAggregationTest, H2ListAggTest,
H2RecursiveCteTest, H2PercentileTest, H2RegularExpressionTest (rows
as Java's Pattern.matches), H2UsersAndRolesTest (no WITH ADMIN
OPTION in any version), H2DdlTest (schema, named primary key,
constraints added later, descending index, renames, sequence, IF
[NOT] EXISTS and CASCADE, read back through the driver's metadata)
- H2DialectTest: the new percentile and regular expression forms
- pom: jdbc.record for the test, to create tables with createTable
Signed-off-by: <bulahovdenis@gmail.com>
stbischof
approved these changes
Nov 26, 2026
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.
What does this PR do?
H2 is embedded and serves no connection: the tests load the jar of each
version (1.4.200, 2.0.206, 2.1.214, 2.2.224, 2.3.232) in a class loader
of its own and connect with that version's driver, the dialect built
from the connection. No container is needed.
H2Dialect:
Version tests (versions package, -Dintegration.docker=true):