You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "schizophrenicmaniac (via GitHub)" <gi...@apache.org> on 2026/10/25 08:42:13 UTC

[PR] Fix incorrect Firebird AST for several SQL constructs [shardingsphere]

schizophrenicmaniac opened a new pull request, #40365:
URL: https://github.com/apache/shardingsphere/pull/40365

   Fixes #40355.
   
   Changes proposed in this pull request:
     - Give `NOT` higher precedence than `AND`/`OR` in the Firebird `expr` rule, so `NOT a = 1 OR b = 2` is grouped as `(NOT a = 1) OR b = 2`
     - Concatenate adjacent string literals (`'a' 'b'` -> `ab`) instead of treating the second one as an alias
     - Recognize charset introducers such as `_utf8'abc'` as string literals through a new `UNDERSCORE_CHARSET` token, so they are no longer parsed as a column with an alias
     - Return `FULL` for `FULL [OUTER] JOIN` and keep the `NATURAL` flag on joined tables
     - Visit the `FIRST`/`SKIP` clause before the projections so parameter indexes follow SQL order
     - Route `ADD CONSTRAINT` and `DROP CONSTRAINT` in `ALTER TABLE` to the statement (both were parsed but dropped), restrict the drop rule to `DROP CONSTRAINT <name>`, and record the columns of `UNIQUE` constraints
     - Register `EXECUTE BLOCK` input parameter markers so the statement reports the correct parameter count
     - Add Parser IT cases for each construct and enable Firebird on the existing `NATURAL` and `FULL` join cases. Parser IT had no check for dropped constraints, so I added an optional `drop-constraint-count` attribute that works like `add-constraint-count`
     - Add a release note entry
   
   I didn't add E2E cases. These are parser-only changes, and I couldn't run a Firebird backend locally. Happy to add them if that's wanted.
   
   ---
   
   Before submitting this PR, I confirm that:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have reviewed my changes.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [x] I have passed the required local checks: `./mvnw clean install -B -T1C -Pcheck`.
   - [ ] I have updated the relevant documentation, if applicable.
   - [x] I have added or updated unit tests for my changes, if applicable.
   - [x] I have updated the Release Notes of the current development version, if applicable. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/).
   
   AI disclosure: drafted with Claude Code (Claude Opus 5.5); files: RELEASE-NOTES.md, BaseRule.g4, DDLStatement.g4, Literals.g4, FirebirdStatementVisitor.java and 15 more.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix incorrect Firebird AST for several SQL constructs [shardingsphere]

Posted by "schizophrenicmaniac (via GitHub)" <gi...@apache.org>.
schizophrenicmaniac commented on PR #40365:
URL: https://github.com/apache/shardingsphere/pull/40365#issuecomment-6450451676

   Thanks, good catch. hexadecimalLiterals now takes UNDERSCORE_CHARSET like stringLiterals does, so `SELECT _utf8 X'616263' FROM t_order` parses again, and I added a Parser IT case for it. bitValueLiterals had the same characterSetName prefix, so I changed it the same way.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix incorrect Firebird AST for several SQL constructs [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu merged PR #40365:
URL: https://github.com/apache/shardingsphere/pull/40365


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org