Skip to content

Query hash partition caused panic #58374

Closed

Description

@Defined2014

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE IF NOT EXISTS `testPartition` (
    `OrderDate` DATETIME
) PARTITION BY HASH(
    YEAR(`OrderDate`) * 10000 + MONTH(`OrderDate`) * 100 + DAYOFMONTH(`OrderDate`)
) PARTITIONS 50;
insert into `testPartition` value (NULL);
select * from  `testPartition` where `OrderDate` is null;

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

mysql> select * from  `testPartition` where `OrderDate` is null;
+-----------+
| OrderDate |
+-----------+
| NULL      |
+-----------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

select * from  `smartbimpp`.`testPartition` where `OrderDate` is null;
ERROR 1105 (HY000): runtime error: index out of range [2] with length 2

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                           |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.5.0-alpha-375-g1405c5e1a5
Edition: Community
Git Commit Hash: 1405c5e1a5ec86941f5c06d82a8502267c4740a6
Git Branch: master
UTC Build Time: 2024-12-18 07:44:22
GoVersion: go1.23.4
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

Activity

  1. added a commit that references this issue on Dec 19, 2024
    15d25e0
  2. added a commit that references this issue on Feb 11, 2025
    fbe4137
  3. added a commit that references this issue on Apr 15, 2025
    1aead1c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-7.1This bug affects the 7.1.x(LTS) versions.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.impact/panicseverity/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