Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: select 单表报错 SQL 错误 [1105] [HY000]: runtime error: index out of range [0] with length 0
Bug Report
Clearly and accurately describe the issue you found. Providing any possible steps to reproduce the issue will help the development team address it promptly.
【TiDB Version】7.1.1
【Impact of the Bug】Query not returning results
【Possible Steps to Reproduce the Issue】
select * from AuthorReputation
【Observed Unexpected Behavior】

【Expected Behavior】
Query should succeed
【Related Components and Specific Versions】
【Other Background Information or Screenshots】
Execution Plan:
Partition:
Is it only this table that is reporting an error? Can you share the table structure for us to take a look?
You can add an order by before limit to work around this issue.
It doesn’t work, and even without adding a limit, directly selecting * from the table also doesn’t work.
Moreover, why do my other partitioned tables work? They are also hash partitioned. Why is it just this table that doesn’t work?
Take a look at the query plans for other partitioned tables to see if they are using static mode, while the table with the error is using dynamic mode.
Isn’t this a classic case of index out of range?
Try changing “select *” to “select [column names]”.
Set tidb_partition_prune_mode=‘static’;
Try setting the partition table to not use dynamic pruning.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.