Add SYSTEM_USER to SQL92 unparenthesized function names#39102
Add SYSTEM_USER to SQL92 unparenthesized function names#39102thswlsqls wants to merge 3 commits into
Conversation
terrymanu
left a comment
There was a problem hiding this comment.
Summary
Review Result: Not Mergeable
Feedback Mode: Needs Discussion
Reason: Adding SYSTEM_USER to the function-name set is correct, but it does not fix the linked issue. On the latest PR head, SELECT SYSTEM_USER is rejected by the SQL92 parser before the binder reads this set.
Issues
P1 — The reported SQL does not reach this change
Problem: The new test verifies only that SYSTEM_USER exists in SQL92FunctionOption. An exact-head parser/visitor check still raises SQLParsingException for SELECT SYSTEM_USER.
Impact: The behavior described in #39099 remains unfixed, and the release-note claim is not yet accurate.
Discussion Needed: Please first confirm how bare SYSTEM_USER should be represented by the SQL92 parser and where its niladic-function classification belongs, then validate the complete parser-to-binder path.
Review Details
- Review Focus: Code Correctness Review; CI not reviewed by request.
- Reviewed Scope: All three changed files at head
3c464e35c8ec49ab41fb2fee024235f80416323c, plus the relevant SQL92 parser and binder path. The local file list matched GitHub. - Not Reviewed Scope: GitHub Actions, the full Maven suite, and JDBC/Proxy E2E scenarios.
- Verification:
SQL92FunctionOptionTestpassed with 2 tests and 0 failures. A reviewer-run exact-head parser check confirmed thatSELECT SYSTEM_USERstill raisesSQLParsingException. - Release Note / User Docs: The release-note entry is present, but its claimed behavior is not yet implemented end to end.
|
Confirmed. In the SQL92 grammar the |
SYSTEM_USER was declared in SQL92Keyword.g4 but referenced by no parser rule, so SELECT SYSTEM_USER failed in the parser before the binder could read the unparenthesized function names. Add SYSTEM_USER to unreservedWord so it parses as a column reference that ColumnSegmentBinder classifies as a niladic function, and add a SQL92 parser IT case for SELECT SYSTEM_USER.
|
Implemented as promised: |
Fixes #39099.
Changes proposed in this pull request:
SYSTEM_USERtoSQL92FunctionOption.UNPARENTHESIZED_FUNCTION_NAMESso it binds as a niladic function instead of a column.SYSTEM_USERis one of the four SQL-92 §6.8 user-value niladic functions (USER/CURRENT_USER/SESSION_USER/SYSTEM_USER); the SQL92 baseline dialect previously listed only three.DialectFunctionOptionimplementations, which already includeSYSTEM_USER.ColumnSegmentBinder.isUnparenthesizedFunction()reads this set via.contains()to classify a bare identifier as function vs column.Before committing this PR, I'm sure that I have checked the following options:
./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.