Repository navigation
Fix keyword token numbers for PostgreSQL 18, and the regression tests on PostgreSQL 15-17 - #61
Open
devrimgunduz wants to merge 1 commit into
Open
devrimgunduz wants to merge 1 commit into
devrimgunduz wants to merge 1 commit into
Conversation
… on older versions pgsp_token_types.h reused the PostgreSQL 17 token numbers for PostgreSQL 18, but five of them changed in PostgreSQL 18's gram.h (FALSE_P, LOCALTIME, LOCALTIMESTAMP, NULL_P, TRUE_P). normalize_expr() therefore no longer replaced NULL, TRUE, FALSE, LOCALTIME and LOCALTIMESTAMP with '?' on PostgreSQL 18. Add a separate block with the PostgreSQL 18 values. expected/convert.out was changed to the unmasked output when PostgreSQL 18 support was added, which made the convert test fail on older versions. Restore the masked output; it is now the same on all versions. Add expected/store_1.out for PostgreSQL 17 and older, where EXPLAIN does not print the "Disabled" property. Per ossc-db#60
This branch has not been deployed
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.
Fixes #60.
Problem
With 1.10,
make installcheckonly passes on PostgreSQL 18. On PostgreSQL 15, 16 and 17 both tests fail:convert:expected/convert.outexpectsNULL,TRUE,FALSEandLOCALTIMESTAMPto be kept in the normalized output, butnormalize_expr()replaces them with?, as it always did.store:expected/store.outhas theDisabled: falselines that only PostgreSQL 18's EXPLAIN prints.The
convertdifference comes from PostgreSQL 18 support (c03e976):pgsp_token_types.hreuses the PostgreSQL 17 token numbers for PostgreSQL 18, but five of them changed in PostgreSQL 18'sgram.h. So on PostgreSQL 18 theIS_CONSTcheck no longer matches these keywords, they are not masked, and the expected file was updated to that output.gram.hgram.hFALSE_PLOCALTIMELOCALTIMESTAMPNULL_PTRUE_PThe
gram.hvalues are from running bison ongram.yof the 17.11 and 18.6 tarballs. The other tokens in the enum are unchanged.Changes
pgsp_token_types.h: keep the existing block for PostgreSQL 17 and add one with the PostgreSQL 18 values.expected/convert.out: restore the two masked lines, as they were before c03e976. One file now matches all versions.expected/store_1.out: new alternative output for PostgreSQL 17 and older, without theDisabledlines.Compatibility
On PostgreSQL 18, these keywords are masked again in the normalized plan, as on older versions. Plans that differ only in such constants are treated as the same plan again, so plan ids of affected plans change compared to 1.10 on PostgreSQL 18.
Tests
1.10 plus this change,
make installcheckwithshared_preload_libraries = 'pg_store_plans,pg_stat_statements': both tests pass on PostgreSQL 15.19, 16.15, 17.11 and 18.6, on Rocky Linux 8 and Fedora 44.Note: #58 (PostgreSQL 19 support) adds another block to the same place in
pgsp_token_types.h; I will rebase whichever is merged second.