server icon indicating copy to clipboard operation
server copied to clipboard

MDEV-32395 update_depend_map_for_order: SEGV at /mariadb-11.3.0/sql/sql_select.cc:16583

Open jasoncu-MariaDB opened this issue 2 years ago • 1 comments

  • [x] The Jira issue number for this PR is: MDEV-32395

Description

When generating an Item_equal with a Item_ref that refers to a field outside of a subselect, remove_item_direct_ref() causes the dependency (depended_from) on the outer select to be lost, which causes trouble for code downstream that can no longer determine the scope of the Item. Not calling remove_item_direct_ref() retains the Item's dependency.

How can this PR be tested?

New test is added.

TODO: modify the automated test suite to verify that the PR causes MariaDB to behave as intended. Consult the documentation on "Writing good test cases".

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 and the PR is based against the latest MariaDB development branch.
  • [x] 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

  • [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.

jasoncu-MariaDB avatar Nov 27 '23 23:11 jasoncu-MariaDB

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 27 '23 23:11 CLAassistant

I will be working on getting this in ASAP.

montywi avatar Dec 04 '24 10:12 montywi

I have merged the two commits, updated the commit comment and pushed it the 10.5 tree.

montywi avatar Dec 04 '24 13:12 montywi