Add dollar-quoting support to MySQL multi-query parser#49
Merged
Conversation
7e5bf2a to
16c93f1
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the MySQL multi-query parser to recognize PostgreSQL-style dollar-quoted bodies (e.g. $$...$$, $mle$...$mle$) so JavaScript stored program definitions in MySQL 9.0+ can contain semicolons without prematurely terminating statements.
Changes:
- Add a dollar-quote branch to the MySQL query-splitting regex pattern.
- Add MySQL edge-case tests for
$mle$/$$bodies, nested tags, and chunk-boundary splitting.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/MySqlMultiQueryParser.php |
Adds dollar-quote matching to the MySQL statement regex. |
tests/cases/MySqlMultiQueryParserTest.phpt |
Adds test coverage for dollar-quoted JS stored program bodies (including chunk boundaries). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
16c93f1 to
e928bdc
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
$$,$mle$,$tag$, etc.) support to the MySQL parser, reusing the same regex pattern as the PostgreSQL parserCREATE FUNCTION ... LANGUAGE JAVASCRIPT AS $mle$...$mle$)Closes #34
Test plan
$mle$and$$delimiters with semicolons inside JS function bodies