Skip to content

fix: handle DELIMITER directives when bypassing the parser for MySQL/MariaDB - #308

Open
mvanhorn wants to merge 2 commits into
achristmascarl:mainfrom
mvanhorn:fix/282-mysql-delimiter-directive
Open

fix: handle DELIMITER directives when bypassing the parser for MySQL/MariaDB#308
mvanhorn wants to merge 2 commits into
achristmascarl:mainfrom
mvanhorn:fix/282-mysql-delimiter-directive

Conversation

@mvanhorn

Copy link
Copy Markdown

Summary

MySQL/MariaDB statements that use the DELIMITER directive (and the $$/custom terminators around stored routines) failed when the query was sent through the parser-bypass path: the client split on the literal ; inside the routine body instead of the active delimiter, so multi-statement routine definitions were truncated. This handles DELIMITER directives when bypassing the parser so those statements execute intact.

Why

DELIMITER is a client-side directive, not SQL the server sees, so the bypass path has to track the active terminator itself. The change parses DELIMITER lines (including quoted arguments), respects the current SQL mode when interpreting quoted identifiers, treats backslashes literally inside quoted identifiers, and splits the batch on the active delimiter rather than a hardcoded ;.

Testing

cargo test mysql -- 16 tests pass, including coverage for quoted DELIMITER arguments, backslash handling in quoted identifiers, and SQL-mode-dependent quote parsing.

Closes #282

mvanhorn added 2 commits July 11, 2026 04:24
Parse quoted DELIMITER arguments, treat backslashes literally in quoted
identifiers, and seed quote parsing from the connection SQL mode.
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.

bug - delimiter statements are not able to be processed by rainfrog

1 participant