⚡ Sangsakala Proxy 🏠 Home
Skip to content

fix: end Oracle q-quoted literals at the first closing delimiter - #2893

Open
tanjiroK-coder wants to merge 1 commit into
JSQLParser:masterfrom
tanjiroK-coder:oracle-q-literal-first-delimiter
Open

tanjiroK-coder wants to merge 1 commit into
JSQLParser:masterfrom
tanjiroK-coder:oracle-q-literal-first-delimiter

Conversation

@tanjiroK-coder

Copy link
Copy Markdown
Contributor

q-quoted literals run on to the last closing delimiter
The S_CHAR_LITERAL alternatives for q'[...]', q'{...}', q'(...)' and q''...'' have a greedy body, so the longest match merges two such literals and everything between them into one StringValue. With or without Dialect.ORACLE, SELECT q'[a]' FROM t WHERE id IN (SELECT id FROM secrets) AND x = q'[b]' comes back as one literal and TablesNamesFinder.getTables returns no tables, so a table allowlist built on it can be bypassed, and the ordinary q'[a]' || q'[b]' loses its Concat. Oracle ends the literal at the first closing delimiter followed by a quote, so the token bodies now exclude that pair and the match stops there; a delimiter inside a body, as in q'[a]b]', parses as before. Checked against Oracle's documented rule, not a live server.

This branch has not been deployed

No deployments
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