Timestamp Time Bug Issue Causing Incorrect SQL Results

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

Original topic: timestamp 时间bug问题,导致SQL出结果不对

| username: wluckdog

【TiDB Usage Environment】Production Environment / Testing / PoC
【TiDB Version】v6.5
【Reproduction Path】Field type is timestamp
SQL query unexpectedly returned data from the 23rd

【Encountered Problem: Problem Phenomenon and Impact】
【Resource Configuration】
【Attachments: Screenshots/Logs/Monitoring】

| username: tidb菜鸟一只 | Original post link

What is the time zone setting?

| username: wluckdog | Original post link

The image you provided is not visible. Please provide the text you need translated.

| username: wluckdog | Original post link

Finally, the issue was found to be caused by data inconsistency between the index and the table: 8134 - data inconsistency in table: tx_t_bak, index: idx_t_04, col: car_cabinet_confirm, handle: “48046”, index-values: “KindMysqlTime 2000-01-01 00:00:00” != record-values: “KindMysqlTime 2000-01-01 08:00:00”, compare err:

Time: 2.486s

| username: Jellybean | Original post link

Did you manage to fix the data later? How was it handled on your end? I’d like to learn about it.

| username: 裤衩儿飞上天 | Original post link

Did you rebuild the index?

| username: tidb菜鸟一只 | Original post link

So why is the index inconsistent? Can we identify the problematic operation?

| username: WalterWj | Original post link

If the index data is inconsistent, try using admin check to inspect the table.