-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.affects-8.2component/ddlThis issue is related to DDL of TiDB.This issue is related to DDL of TiDB.severity/criticaltype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
daily run in TiFlash
DDLs:
[sql="\nCREATE TABLE IF NOT EXISTS stock (\n\ts_i_id INT NOT NULL,\n\ts_w_id INT NOT NULL,\n\ts_quantity INT,\n\ts_dist_01 CHAR(24), \n\ts_dist_02 CHAR(24),\n\ts_dist_03 CHAR(24),\n\ts_dist_04 CHAR(24), \n\ts_dist_05 CHAR(24), \n\ts_dist_06 CHAR(24), \n\ts_dist_07 CHAR(24), \n\ts_dist_08 CHAR(24), \n\ts_dist_09 CHAR(24), \n\ts_dist_10 CHAR(24), \n\ts_ytd INT, \n\ts_order_cnt INT, \n\ts_remote_cnt INT,\n\ts_data VARCHAR(50),\n\tPRIMARY KEY(s_w_id, s_i_id)\n)"]
[sql="alter table `tpcc`.`stock` set tiflash replica 2"]
[sql="alter table `tpcc`.`stock` set tiflash replica 2"]
[sql="alter table stock drop column cct_1"]
[sql="alter table stock add column cct_1 int default 10"]
[sql="alter table stock modify cct_1 json"]
[sql="alter table stock drop column adc_1"]
[sql="alter table stock add column adc_1 smallint"]
[sql="alter table stock drop column cct_1"]
DMLs:
Execute the following DMLs when finished alter table stock add column adc_1 smallint
.
["wait latest schema version changed(get the metadata lock if tidb_enable_metadata_lock is true)"] [category=ddl] **[ver=237]** ["take time"=127.144578ms] [job="ID:203, Type:add column, State:done, SchemaState:public, SchemaID:104, TableID:120, RowCount:0, ArgLen:4, start time: 2024-05-22 11:35:43.835 +0800 CST, ts:449930577532682272, Err:<nil>, ErrCount:0, SnapshotVersion:0, LocalMode: false"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="SELECT c_discount, c_last, c_credit, w_tax FROM customer, warehouse WHERE w_id = ? AND c_w_id = w_id AND c_d_id = ? AND c_id = ? [arguments: (3, 2, 2679)] [arguments: (3, 2, 2679)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="SELECT d_next_o_id, d_tax FROM district WHERE d_id = ? AND d_w_id = ? FOR UPDATE [arguments: (2, 3)] [arguments: (2, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE district SET d_next_o_id = ? + 1 WHERE d_id = ? AND d_w_id = ? [arguments: (3077, 2, 3)] [arguments: (3077, 2, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="INSERT INTO orders (o_id, o_d_id, o_w_id, o_c_id, o_entry_d, o_ol_cnt, o_all_local) VALUES (?, ?, ?, ?, ?, ?, ?) [arguments: (3077, 2, 3, 2679, \"2024-05-22 03:55:50\", 15, 1)] [arguments: (3077, 2, 3, 2679, \"2024-05-22 03:55:50\", 15, 1)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="INSERT INTO new_order (no_o_id, no_d_id, no_w_id) VALUES (?, ?, ?) [arguments: (3077, 2, 3)] [arguments: (3077, 2, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="SELECT i_price, i_name, i_data, i_id FROM item WHERE i_id IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [arguments: (82805, 8283, 40613, 56731, 8565, 98165, 49253, 86893, 13931, 25427, 48693, 40805, 31473, 96885, 97965)] [arguments: (82805, 8283, 40613, 56731, 8565, 98165, 49253, 86893, 13931, 25427, 48693, 40805, 31473, 96885, 97965)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="SELECT s_i_id, s_quantity, s_data, s_dist_01, s_dist_02, s_dist_03, s_dist_04, s_dist_05, s_dist_06, s_dist_07, s_dist_08, s_dist_09, s_dist_10 FROM stock WHERE (s_w_id, s_i_id) IN ((?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?),(?,?)) FOR UPDATE [arguments: (3, 82805, 3, 8283, 3, 40613, 3, 56731, 3, 8565, 3, 98165, 3, 49253, 3, 86893, 3, 13931, 3, 25427, 3, 48693, 3, 40805, 3, 31473, 3, 96885, 3, 97965)] [arguments: (3, 82805, 3, 8283, 3, 40613, 3, 56731, 3, 8565, 3, 98165, 3, 49253, 3, 86893, 3, 13931, 3, 25427, 3, 48693, 3, 40805, 3, 31473, 3, 96885, 3, 97965)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (36, 1, 0, 82805, 3)] [arguments: (36, 1, 0, 82805, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (22, 6, 0, 8283, 3)] [arguments: (22, 6, 0, 8283, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (30, 2, 0, 40613, 3)] [arguments: (30, 2, 0, 40613, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (34, 10, 0, 56731, 3)] [arguments: (34, 10, 0, 56731, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (15, 7, 0, 8565, 3)] [arguments: (15, 7, 0, 8565, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (55, 6, 0, 98165, 3)] [arguments: (55, 6, 0, 98165, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (38, 5, 0, 49253, 3)] [arguments: (38, 5, 0, 49253, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (29, 4, 0, 86893, 3)] [arguments: (29, 4, 0, 86893, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (21, 4, 0, 13931, 3)] [arguments: (21, 4, 0, 13931, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (62, 7, 0, 25427, 3)] [arguments: (62, 7, 0, 25427, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (90, 2, 0, 48693, 3)] [arguments: (90, 2, 0, 48693, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (80, 2, 0, 40805, 3)] [arguments: (80, 2, 0, 40805, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (16, 5, 0, 31473, 3)] [arguments: (16, 5, 0, 31473, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (94, 5, 0, 96885, 3)] [arguments: (94, 5, 0, 96885, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="UPDATE stock SET s_quantity = ?, s_ytd = s_ytd + ?, s_order_cnt = s_order_cnt + 1, s_remote_cnt = s_remote_cnt + ? WHERE s_i_id = ? AND s_w_id = ? [arguments: (73, 3, 0, 97965, 3)] [arguments: (73, 3, 0, 97965, 3)]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql="INSERT into order_line (ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) VALUES (?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?),(?,?,?,?,?,?,?,?,?) [arguments: (3077, 2, 3, 1, 82805, 3, 1, 48.156283725, \"WWDOEWEMUWYODYNIFUAZFZGY\", 3077, 2, 3, 2, 8283, 3, 6, 341.1507168, \"KFBARKPJEWQTGXRCAJCWUBEN\", 3077, 2, 3, 3, 40613, 3, 2, 94.62137100000001, \"LHKAMJQULIYMROAKAOBRZYXE\", 3077, 2, 3, 4, 56731, 3, 10, 253.6794675, \"OEDMKGTJIXBWRPNCTNAGYXDT\", 3077, 2, 3, 5, 8565, 3, 7, 404.9024007, \"BCYOPJDCULXQMFLDAUEETFNM\", 3077, 2, 3, 6, 98165, 3, 6, 513.5243094, \"CHBQNIDGKGYOSSCMQSVYSIIN\", 3077, 2, 3, 7, 49253, 3, 5, 201.0168945, \"QCRRKIMKLVELQJVEYNRDOGSP\", 3077, 2, 3, 8, 86893, 3, 4, 136.5373539, \"WFOJUQYLLZMANUXIAPFZLDXJ\", 3077, 2, 3, 9, 13931, 3, 4, 257.74690200000003, \"FKEJMYTOAUXJQJTANAPLAIMY\", 3077, 2, 3, 10, 25427, 3, 7, 395.986156125, \"CFHIEZIBJTQAJRAHQFVJXOBL\", 3077, 2, 3, 11, 48693, 3, 2, 206.04766875, \"DMZNOATPSWLGFNYPEMJNHDIW\", 3077, 2, 3, 12, 40805, 3, 2, 28.0438905, \"YGLGTZAZXHFPUFAZAVYPRUPH\", 3077, 2, 3, 13, 31473, 3, 5, 130.960687125, \"RVDWAUINQEFDADGXXEOKJRZM\", 3077, 2, 3, 14, 96885, 3, 5, 266.684554125, \"DCHMFLLWNTPXHROTSSJBZSEW\", 3077, 2, 3, 15, 97965, 3, 3, 117.46322684999998, \"WULYCIAJYPJJHRHGHKLMYTVX\")] [arguments: (3077, 2, 3, 1, 82805, 3, 1, 48.156283725, \"WWDOEWEMUWYODYNIFUAZFZGY\", 3077, 2, 3, 2, 8283, 3, 6, 341.1507168, \"KFBARKPJEWQTGXRCAJCWUBEN\", 3077, 2, 3, 3, 40613, 3, 2, 94.62137100000001, \"LHKAMJQULIYMROAKAOBRZYXE\", 3077, 2, 3, 4, 56731, 3, 10, 253.6794675, \"OEDMKGTJIXBWRPNCTNAGYXDT\", 3077, 2, 3, 5, 8565, 3, 7, 404.9024007, \"BCYOPJDCULXQMFLDAUEETFNM\", 3077, 2, 3, 6, 98165, 3, 6, 513.5243094, \"CHBQNIDGKGYOSSCMQSVYSIIN\", 3077, 2, 3, 7, 49253, 3, 5, 201.0168945, \"QCRRKIMKLVELQJVEYNRDOGSP\", 3077, 2, 3, 8, 86893, 3, 4, 136.5373539, \"WFOJUQYLLZMANUXIAPFZLDXJ\", 3077, 2, 3, 9, 13931, 3, 4, 257.74690200000003, \"FKEJMYTOAUXJQJTANAPLAIMY\", 3077, 2, 3, 10, 25427, 3, 7, 395.986156125, \"CFHIEZIBJTQAJRAHQFVJXOBL\", 3077, 2, 3, 11, 48693, 3, 2, 206.04766875, \"DMZNOATPSWLGFNYPEMJNHDIW\", 3077, 2, 3, 12, 40805, 3, 2, 28.0438905, \"YGLGTZAZXHFPUFAZAVYPRUPH\", 3077, 2, 3, 13, 31473, 3, 5, 130.960687125, \"RVDWAUINQEFDADGXXEOKJRZM\", 3077, 2, 3, 14, 96885, 3, 5, 266.684554125, \"DCHMFLLWNTPXHROTSSJBZSEW\", 3077, 2, 3, 15, 97965, 3, 3, 117.46322684999998, \"WULYCIAJYPJJHRHGHKLMYTVX\")]"]
[schemaVersion=237] [txnStartTS=449930893901168668]...[sql=COMMIT]
select adc_1 from stock where adc_1!=0 limit 1;
Related issue: pingcap/tiflash#7024
2. What did you expect to see? (Required)
Execute successfully.
3. What did you see instead (Required)
tidb> select adc_1 from stock where adc_1!=0 limit 1;
ERROR 1105 (HY000): invalid data type: Failed to decode row v2 data as i64
4. What is your TiDB version? (Required)
master
Metadata
Metadata
Assignees
Labels
affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.affects-8.2component/ddlThis issue is related to DDL of TiDB.This issue is related to DDL of TiDB.severity/criticaltype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.