Skip to content

No MDEV: include/opt_context_save_in_var.inc can't handle quotes - #5830

Open
spetrunia wants to merge 1 commit into
mainfrom
13.2-MDEV-40553-review-input
Open

spetrunia wants to merge 1 commit into
mainfrom
13.2-MDEV-40553-review-input

Conversation

@spetrunia

Copy link
Copy Markdown
Member

I_S.OPTIMIZER_CONTEXT has this statement:

set @opt_context='CONTEXT'; -- denote CONTEXT-STMT

And opt_context_save_in_var.inc just took the CONTEXT and put it in a variable:

SET @opt_context= (select REGEXP_SUBSTR(...) from i_s.optimizer_context);

This ignored the fact that the "CONTEXT" is escaped for the SQL parser.

Fix this by extracting the entire CONTEXT-STMT and running it.

I_S.OPTIMIZER_CONTEXT has this statement:

set @opt_context='CONTEXT';     -- denote CONTEXT-STMT

And opt_context_save_in_var.inc just took the CONTEXT and put it
in a variable:

SET @opt_context= (select REGEXP_SUBSTR(...) from i_s.optimizer_context);

This ignored the fact that the "CONTEXT" is escaped for the SQL parser.

Fix this by extracting the entire CONTEXT-STMT and running it.
@spetrunia
spetrunia force-pushed the 13.2-MDEV-40553-review-input branch from 8687b0e to 67a5f30 Compare October 8, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants