Skip to content

MDEV-32294 fix_fields() problem with inconsistent outer context paths #4044

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

Open
wants to merge 1 commit into
base: 10.11
Choose a base branch
from

Conversation

mariadb-RexJohnston
Copy link
Contributor

@mariadb-RexJohnston mariadb-RexJohnston commented May 14, 2025

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

Description

Exclude associated contexts when excluding SELECT_LEXs. These exclusions can happen when merging derived tables into the parent SELECT_LEX. Later, attempting to call fix_fields() on an Item that interacts with a merged SELECT_LEX should not be able to access a context associated with a merged select.

Release Notes

Usage of outer references in merged selects can cause problems, especially in prepared statements.

PR quality check

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

@CLAassistant
Copy link

CLAassistant commented May 14, 2025

CLA assistant check
All committers have signed the CLA.

@mariadb-RexJohnston mariadb-RexJohnston changed the base branch from main to 10.11 May 14, 2025 03:01
@mariadb-RexJohnston mariadb-RexJohnston changed the title MDEV-32294 2nd execution problem with inconsistent outer context paths MDEV-32294 fix_fields() problem with inconsistent outer context paths May 15, 2025
During a derived table merge, we exclude the select_lex being merged
into it's parent.  MySQL fixes context paths in SELECT_LEX::exclude_level
This patch introduces the same context exclusion.
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.

3 participants