Skip to content

select failed for partition table with generated column with error needPartitionHandle != ret, tp(1) #58475

@joechenrh

Description

@joechenrh

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table tp;

CREATE TABLE tp (
  id int, c1 json, c2 json GENERATED ALWAYS AS (c1) VIRTUAL, KEY `idx_31` (id)
) PARTITION BY RANGE (id)
(PARTITION `p0` VALUES LESS THAN (2),
 PARTITION `p1` VALUES LESS THAN (4532022));

INSERT INTO tp (id, c1) VALUES (0, "[1]");

select id from tp where json_contains(c2, "1") group by id having id in (0);

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

+------+                                                                                                                                                                                                         
| id   |                                                                                                                                                                                                         
+------+                                                                                                                                                                                                         
|    0 |                                                                                                                                                                                                         
+------+ 

3. What did you see instead (Required)

ERROR 1105 (HY000): Internal error, needPartitionHandle != ret, tp(1)

4. What is your TiDB version? (Required)

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.component/tablepartitionThis issue is related to Table Partition of TiDB.fuzz/randomtestseverity/majorsig/sql-infraSIG: SQL Infratype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions