Skip to content

MDEV-39360: set statement optimizer_record_context for query fails#5259

Open
bsrikanth-mariadb wants to merge 1 commit into
bb-12.3-MDEV-39368-test-replay-preview-treefrom
13.1-MDEV-39360-set-optimizer_record_context-for-query-fails
Open

MDEV-39360: set statement optimizer_record_context for query fails#5259
bsrikanth-mariadb wants to merge 1 commit into
bb-12.3-MDEV-39368-test-replay-preview-treefrom
13.1-MDEV-39360-set-optimizer_record_context-for-query-fails

Conversation

@bsrikanth-mariadb

Copy link
Copy Markdown
Contributor

Move the initialization of context recorder, and replay after run_set_statement_if_requested() is invoked in the mysql_execute_command() in sql_parse.cc

Move the initialization of context recorder, and replay after
run_set_statement_if_requested() is invoked in the
mysql_execute_command() in sql_parse.cc

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses MDEV-39360, where using SET STATEMENT optimizer_record_context=1 FOR <query> failed to record the optimizer context. The fix moves the initialization of the optimizer context replay and recorder (init_optimizer_context_replay_if_needed and init_optimizer_context_recorder_if_needed) to occur after ots.init(...) in mysql_execute_command, ensuring that statement-specific variable overrides are properly applied before initialization. Additionally, corresponding regression tests have been added to verify this behavior. There are no review comments, and I have no further feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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.

1 participant