Skip to content

MDEV-40748 x NOT IN (<set-operation subquery>) drops rows - #5777

Open
DerZc wants to merge 1 commit into
MariaDB:11.4from
DerZc:fix-mdev-40748
Open

DerZc wants to merge 1 commit into
MariaDB:11.4from
DerZc:fix-mdev-40748

Conversation

@DerZc

@DerZc DerZc commented Sep 28, 2026

Copy link
Copy Markdown

MDEV-40748 x NOT IN () drops rows

An EXCEPT operand can contain a NULL that is removed from the final
result. Track surviving NULLs at the final subquery result and allow the
operands to finish before deciding whether a matching row exists.

Add native regressions for the reported query, equivalent controls, and
repeated prepared-statement execution. Preserve observable results
across the affected execution paths. Update expected output for the
wrapper tests that source the expanded regression.

Bug report: https://jira.mariadb.org/browse/MDEV-40748

Regression coverage

The regression is integrated into the existing main.subselect test. It covers the reported query, equivalent query forms and repeated prepared-statement execution.

Validation

On 11.4 at 322658cd442333a13b46521d1acca67d1e8366cb:

  • The unmodified server fails the new regression with a result mismatch.
  • The patched server builds successfully.
  • 24 query-result checks pass against separately established expected results, including repeated prepared statements.
  • Native MTR passes: main.subselect, main.select, main.subselect_no_exists_to_in, main.subselect_no_scache, main.subselect_no_opts, main.subselect_no_semijoin, main.subselect_no_mat.
  • The regression passes with the prepared-statement protocol.
  • The full database regression suite was not run.
An EXCEPT operand can contain a NULL that is removed from the final
result. Track surviving NULLs at the final subquery result and allow the
operands to finish before deciding whether a matching row exists.

Add native regressions for the reported query, equivalent controls, and
repeated prepared-statement execution. Preserve observable results
across the affected execution paths. Update expected output for the
wrapper tests that source the expanded regression.

Bug report: https://jira.mariadb.org/browse/MDEV-40748
@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Sep 28, 2026
@gkodinov gkodinov self-assigned this Sep 28, 2026

@gkodinov gkodinov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for your contribution! This is a preliminary review.

LGTM. Please stand by for the final review.

@gkodinov gkodinov assigned spetrunia and unassigned gkodinov Sep 28, 2026
@gkodinov
gkodinov requested a review from spetrunia September 28, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

3 participants