Commit 1f0027a
fix: BYT-8268 - require CALL keyword at SQL level and fix related grammar issues (#38)
This commit addresses BYT-8268 by making the CALL keyword mandatory at SQL
statement level while keeping it optional at PL/SQL block level, and fixes
grammar issues that were previously hidden by optional CALL.
Changes:
1. Split call_statement into two rules:
- sql_call_statement: CALL keyword MANDATORY (SQL level)
- plsql_call_statement: CALL keyword OPTIONAL (PL/SQL block level)
2. Support method chaining in CALL statements:
- CALL obj_constructor(...).method(...) INTO :var
3. Fix commit_statement to allow WRITE clause independently:
- Previously: COMMIT [COMMENT 'text' [WRITE ...]]
- Now: COMMIT [COMMENT 'text'] [WRITE ...]
4. Fix link_name to support qualified database links:
- Now supports: @schema.linkname or @linkname.domain
5. Fix system_action to support multi-word actions:
- Added: ADMINISTER KEY MANAGEMENT
- Added: General patterns for 2-3 word actions
Why these changes:
- The optional CALL keyword caused keywords like CASCADE to be
misidentified as procedure calls, leading to incorrect SQL splitting
- At SQL level, Oracle requires CALL keyword
- At PL/SQL block level, Oracle allows direct procedure invocation
- The fixes to COMMIT, link_name, and system_action address grammar
deficiencies that were previously hidden by the optional CALL
Tests: All 600+ parser tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <[email protected]>1 parent e7e9eb8 commit 1f0027a
File tree
7 files changed
+26444
-25733
lines changed- plsql
7 files changed
+26444
-25733
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
1335 | 1335 | | |
1336 | 1336 | | |
1337 | 1337 | | |
| 1338 | + | |
| 1339 | + | |
1338 | 1340 | | |
1339 | | - | |
| 1341 | + | |
1340 | 1342 | | |
1341 | 1343 | | |
1342 | 1344 | | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
1343 | 1348 | | |
1344 | 1349 | | |
1345 | 1350 | | |
| |||
5607 | 5612 | | |
5608 | 5613 | | |
5609 | 5614 | | |
5610 | | - | |
| 5615 | + | |
5611 | 5616 | | |
5612 | 5617 | | |
5613 | 5618 | | |
| |||
5687 | 5692 | | |
5688 | 5693 | | |
5689 | 5694 | | |
5690 | | - | |
5691 | | - | |
| 5695 | + | |
| 5696 | + | |
| 5697 | + | |
| 5698 | + | |
| 5699 | + | |
| 5700 | + | |
| 5701 | + | |
| 5702 | + | |
| 5703 | + | |
| 5704 | + | |
5692 | 5705 | | |
5693 | 5706 | | |
5694 | 5707 | | |
| |||
5790 | 5803 | | |
5791 | 5804 | | |
5792 | 5805 | | |
| 5806 | + | |
| 5807 | + | |
5793 | 5808 | | |
5794 | | - | |
5795 | | - | |
5796 | | - | |
| 5809 | + | |
| 5810 | + | |
5797 | 5811 | | |
5798 | 5812 | | |
5799 | 5813 | | |
| |||
6952 | 6966 | | |
6953 | 6967 | | |
6954 | 6968 | | |
| 6969 | + | |
6955 | 6970 | | |
6956 | | - | |
| 6971 | + | |
6957 | 6972 | | |
6958 | 6973 | | |
6959 | 6974 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments