Skip to content

Fix tokenizing of geometric operators starting with ? - #418

Open
youdie006 wants to merge 1 commit into
darold:masterfrom
youdie006:geometric-question-operators
Open

youdie006 wants to merge 1 commit into
darold:masterfrom
youdie006:geometric-question-operators

Conversation

@youdie006

Copy link
Copy Markdown

The JSON/vector operator group in Beautify.pm matches a bare ? and ?| before the geometric group, so the geometric operators ?#, ?-, ?-| and ?|| are split:

SELECT * FROM lseg_tbl l1, lseg_tbl l2 WHERE l1.s ?# l2.s;
-- formatted: l1.s ? # l2.s

and ?|| comes out as ?| |, which PostgreSQL parses as a different operator. This removes those two alternatives from the JSON group so the existing geometric entries match; a bare ? still reaches the generic operator group. Added t/test-files/ex88.sql and updated the geometry.sql regression golden, which had recorded the split operators. Checked with PostgreSQL's parser (pglast) over its own regression SQL files: 11 statements that changed meaning are fixed and none are broken. One visible change: a placeholder written ?-1 is now kept as ?- 1, which is how PostgreSQL reads it. prove -l t/ and t/regress_test.pl pass.

Written with AI assistance (Claude); I have reviewed the change.

The JSON operator group matched a bare ? and ?| before the geometric
group, so ?#, ?-, ?-| and ?|| were split into separate tokens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant