Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-32866 Debug assertion failure in Item_subselect::val_bool() #3708

Open
wants to merge 2 commits into
base: 10.5
Choose a base branch
from

Conversation

Olernov
Copy link
Contributor

@Olernov Olernov commented Dec 16, 2024

  • The Jira issue number for this PR is: MDEV-32866

Description

Constant conditions, evaluated during optimization, should not be re-evaluated during execution. However, a bug led to some inexpensive conditions being incorrectly marked for evaluation at execution by JOIN::exec_const_cond. This resulted in redundant subselect executions and triggered the assertion. The fix ensures that only conditions requiring deferred evaluation are saved to JOIN::exec_const_cond, maintaining the correct execution flow

If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

Constant conditions, evaluated during optimization, should not be re-evaluated
during execution. However, a bug led to some inexpensive conditions being
incorrectly marked for evaluation at execution by `JOIN::exec_const_cond`.
This resulted in redundant subselect executions and triggered the assertion.
The fix ensures that only conditions requiring deferred evaluation are saved
to JOIN::exec_const_cond, maintaining the correct execution flow
Constant subqueries, once evaluated during optimization, should not
be re-evaluated neither during optimization, nor during execution.
Nevertheless, at some scenarios re-evaluation was
possible, since previously evaluated constant IN-predicates were
not properly marked. This commit implements proper marking of subqueries
within constant conditions, preventing their re-evaluation
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