Abnormal Sorting in Partitioned Table Queries

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 分区表查询排序异常

| username: porpoiselxj

[TiDB Usage Environment] Poc/Test
[TiDB Version] V7.1.0
[Reproduction Path] Upgraded from v6.1.1 to V7.1.0 and encountered issues
[Encountered Issues: Problem Phenomenon and Impact]
When using a range partition table and sorting by a field with filter conditions, an error occurs: Error Code 1105 Internal error: UnionExec chunk column count mismatch req: 14, result: 15
Details are as follows:
select * from part_t where id between 1 and 100 - Normal
select * from part_t where id between 1 and 100 order by name - Normal
select * from part_t where id between 1 and 100 order by id - Error

select * from part_t where name between ‘aaaa’ and ‘bbb’ - Normal
select * from part_t where name between ‘aaaa’ and ‘bbb’ order by id - Normal
select * from part_t where name between ‘aaaa’ and ‘bbb’ order by name - Error

PS:

  1. part_t is a range partition table using a time field
  2. The data can be queried with the precondition filter that causes the error
  3. Tried upgrading to v7.1.1, the issue still exists

[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]

| username: WalterWj | Original post link

Try providing feedback in the feedback section. It seems like a bug.

| username: porpoiselxj | Original post link

Okay, I’ll give it a try.

| username: zhanggame1 | Original post link

I remember someone posted this question here.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.