Skip to content

planner/executor: internal missing-column error with JOIN ... USING + qualified column predicate #66272

Description

@hawkingrei

Bug Report

1. Minimal reproduce step (Required)

Artifact: https://storage.googleapis.com/pingcap_bazel_cache/shiro/019c5558-d0de-704e-839c-7bcc503cfebf/case.tar.zst
Plan replayer: https://storage.googleapis.com/pingcap_bazel_cache/shiro/019c5558-d0de-704e-839c-7bcc503cfebf/plan_replayer.zip

Apply schema
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t3;

CREATE TABLE t1 (
  id BIGINT NOT NULL,
  k0 BIGINT NOT NULL,
  d0 DATE NOT NULL,
  d1 FLOAT NOT NULL,
  PRIMARY KEY (id)
);

CREATE TABLE t3 (
  id BIGINT NOT NULL,
  k2 VARCHAR(64) NOT NULL,
  k0 BIGINT NOT NULL,
  d0 DOUBLE NOT NULL,
  d1 DATE NOT NULL,
  PRIMARY KEY (id)
);
Load data
INSERT INTO t1 (id, k0, d0, d1) VALUES
  (10, 93, '2024-04-14', 14.19);

INSERT INTO t3 (id, k2, k0, d0, d1) VALUES
  (10, 's356', 749, 89.26, '2024-04-29');

Run the query:

SELECT
  id AS t0_id
FROM t1
JOIN t3 USING (id)
WHERE (
  (
    (t3.d1 = '2024-04-29')
    AND (t3.id = 10)
  )
  AND (t1.k0 = 93)
)
AND (
  t3.k0 = ALL (
    SELECT t3.k0 AS c0
    FROM t3
    WHERE t3.k0 = 749
  )
);

2. What did you expect to see? (Required)

The query should not fail with internal schema binding failure during execution/planning.

3. What did you see instead (Required)

Error 1105 (HY000): Can't find column shiro_fuzz_r12.t3.id in schema Column: [shiro_fuzz_r12.t3.k0] PKOrUK: [] NullableUK: []

4. What is your TiDB version? (Required)

Release Version: v9.0.0-beta.2.pre-1235-g365184d563
Edition: Community
Git Commit Hash: 365184d56314e6844ae5240287ab3a69cb627fa3
Git Branch: HEAD
UTC Build Time: 2026-02-12 09:27:22
GoVersion: go1.25.6
Race Enabled: false
Check Table Before Drop: false
Store: tikv
Kernel Type: Classic

Additional context

  • Oracle: PQS
  • Error classification from fuzz runner: pqs:missing_column / tidb:schema_column_missing
  • Case ID: 019c5558-d0de-704e-839c-7bcc503cfebf

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions