Skip to content

[Bug]: NULL IN/NOT IN list errors instead of returning NULL #25221

Closed

Description

@Ariznawlll

Bug Report

MatrixOne version

Verified on latest origin/main at 24d9d1ede (fix(function,plan): GREATEST/LEAST numeric promotion (#25145) and ambiguous-column typo (#25146) (#25168)).

Reproduce

select null in (1, null) as r;
select null not in (1, null) as r;

Expected behavior

MySQL 8.0.45 returns NULL for both expressions:

r
NULL

r
NULL

Actual behavior

MatrixOne main returns an internal cast error for both expressions:

ERROR 20203 (HY000): invalid argument operator cast, bad value [ANY ANY]

Notes

This affects direct scalar IN / NOT IN predicates when the left operand is NULL. MySQL comparison semantics propagate NULL here rather than throwing an error.

References:

Activity

  1. added
    kind/bug
    severity/s1
    on Jun 29, 2026
  2. added theissue type on Jun 30, 2026
  3. added this to the MO-202607 milestone on Jun 30, 2026
  4. jiangxinmeng1 commented on Jul 3, 2026

    @jiangxinmeng1
    Contributor

    fixed by #25236

  5. Ariznawlll commented on Jul 3, 2026

    @Ariznawlll
    CollaboratorAuthor

    Verified on latest main 7e70bee98.

    Result: fixed by #25236.

    Validation SQL:

    select null in (1, null) as r;
    select null not in (1, null) as r;
    select null in (1, 2) as r;
    select null not in (1, 2) as r;
    select null in (null) as r;
    select null not in (null) as r;

    All statements now return NULL, matching MySQL 8.0.45. No cast error is returned.

    Regression case added in matrixorigin/motr#39.

    Case: 14_issue_regression.issue_25221_null_in_list
    Commit: 87660dc
    Target branch marker: @target-branch: main

    Validation on latest main passed with the issue regression group:

    SUMMARY | total=16 success=16 failed=0 skipped=0 | stmts=185 ok=185 fail=0
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s1

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions