MDEV-39520: Add MySQL 8.0 extended syntax for REGEXP_INSTR#5035
Open
MohamedM216 wants to merge 1 commit intoMariaDB:mainfrom
Open
MDEV-39520: Add MySQL 8.0 extended syntax for REGEXP_INSTR#5035MohamedM216 wants to merge 1 commit intoMariaDB:mainfrom
REGEXP_INSTR#5035MohamedM216 wants to merge 1 commit intoMariaDB:mainfrom
Conversation
d2ac796 to
ef7d499
Compare
gkodinov
requested changes
May 4, 2026
Member
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
First of all: this is implementing just one sub-task of what https://jira.mariadb.org/browse/MDEV-39106 calls for. Either do all of it, as scoped in the jira, in a single go. Or create Jira sub-task(s) into the above jira and target these instead.
There's also some suggestions below.
REGEXP_INSTRREGEXP_INSTR
d0e479a to
2634104
Compare
gkodinov
requested changes
May 5, 2026
Member
gkodinov
left a comment
There was a problem hiding this comment.
Please fix the failing buildbot tests. Some improvement suggestions below too.
Extend REGEXP_INSTR to accept the full MySQL 8.0 signature:
REGEXP_INSTR(subject, pattern
[, pos [, occurrence [, return_option
[, match_type]]]])
Previously only 2 arguments were accepted. Changes:
- Switch Create_func_regexp_instr from Create_func_arg2 to
Create_native_func to allow 2-6 arguments.
- Add parse_match_type_flags() to Regexp_processor_pcre, which parses
the match_type flags (c/i/m/n/u) and overwrites m_library_flags
with the fully-resolved PCRE2 flag word.
- Call parse_match_type_flags() in fix_length_and_dec() before fix_owner()
when match_type is constant, so the pattern is compiled with the
correct flags. For constant patterns fix_owner() sets m_is_const=true,
making recompile() a permanent no-op.
- For non-constant match_type, resolve flags per-row in val_int()
and call compile() directly to bypass the recompile() no-op guard.
- Add MTR test: regexp_instr_mysql8.test
2634104 to
1518554
Compare
Contributor
Author
|
The current failing tests aren't related to my patch and they pass locally. |
gkodinov
approved these changes
May 7, 2026
Member
gkodinov
left a comment
There was a problem hiding this comment.
LGTM. Please stand by for the final review.
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.
Reference Issue
MDEV-39520
Description
This PR is one of a series of PRs that are supposed to add MySQL 8.0-compatible extended syntax for all REGEXP functions
Test
regexp_instr_mysql8.test