对表执行了修改datetime精度(之前默认datetime),如:alter table my_table order_date datetime(6);然后查tifalsh就报错了,重新把表剔除tiflash后重建也不行。。,请教下怎么破这类问题?
MySQL [test_db]> select * from information_schema.tiflash_replica;
±----------------------±----------------±---------±--------------±----------------±----------±---------+
| TABLE_SCHEMA | TABLE_NAME | TABLE_ID | REPLICA_COUNT | LOCATION_LABELS | AVAILABLE | PROGRESS |
±----------------------±----------------±---------±--------------±----------------±----------±---------+
| test_db | my_table | 18560 | 1 | | 1 | 1 |
±----------------------±----------------±---------±--------------±----------------±----------±---------+
1 row in set (0.015 sec)
MySQL [test_db]> desc my_table;
±--------------±------------±-----±-----±--------±------+
| Field | Type | Null | Key | Default | Extra |
±--------------±------------±-----±-----±--------±------+
| order_date | datetime(6) | YES | | NULL | |
| out_seri | int(11) | NO | | NULL | |
| dept_code | varchar(7) | YES | | NULL | |
| ward_code | varchar(7) | YES | | NULL | |
| section_code | varchar(7) | YES | | NULL | |
| inpatient_no | varchar(12) | NO | MUL | NULL | |
| name | varchar(32) | NO | | NULL | |
| bed_no | varchar(4) | YES | | NULL | |
| charge_code | varchar(6) | NO | MUL | NULL | |
| retprice | double | NO | | NULL | |
| amount | double | NO | | NULL | |
| infant_flag | varchar(1) | YES | | NULL | |
| drawer | varchar(5) | YES | | NULL | |
| keeper | varchar(5) | YES | | NULL | |
| date1 | datetime(6) | YES | | NULL | |
| date2 | datetime(6) | YES | | NULL | |
| always_flag | varchar(1) | NO | | NULL | |
| drug_class | varchar(1) | YES | | NULL | |
| acct_sign | varchar(1) | YES | | NULL | |
| total_flag | varchar(1) | YES | | NULL | |
| admiss_times | smallint(6) | YES | | NULL | |
| supply_code | varchar(1) | YES | | NULL | |
| act_order_no | double | YES | MUL | NULL | |
| page_no | double | YES | | NULL | |
| self_flag | varchar(1) | YES | | NULL | |
| separate_flag | varchar(1) | YES | | NULL | |
| suprice_flag | varchar(1) | YES | | NULL | |
| drug_flag | varchar(1) | YES | | NULL | |
| pay_self | varchar(1) | YES | | NULL | |
| group_no | varchar(2) | YES | | NULL | |
| confirm_time | datetime(6) | YES | MUL | NULL | |
| serial | varchar(2) | YES | | NULL | |
| doctor_name | varchar(5) | YES | | NULL | |
±--------------±------------±-----±-----±--------±------+
33 rows in set (0.001 sec)
MySQL [test_db]> explain select count(0) from my_table where confirm_time >‘2021-01-01’;
±-----------------------------±------------±------------------±----------------------±-----------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
±-----------------------------±------------±------------------±----------------------±-----------------------------------------------------------------------------------+
| StreamAgg_27 | 1.00 | root | | funcs:count(Column#38)->Column#35 |
| └─TableReader_28 | 1.00 | root | | data:StreamAgg_11 |
| └─StreamAgg_11 | 1.00 | batchCop[tiflash] | | funcs:count(0)->Column#38 |
| └─Selection_26 | 20418375.92 | batchCop[tiflash] | | gt(test_db.my_table.confirm_time, 2021-01-01 00:00:00.000000) |
| └─TableFullScan_25 | 26628350.00 | batchCop[tiflash] | table:my_table | keep order:false |
±-----------------------------±------------±------------------±----------------------±-----------------------------------------------------------------------------------+
5 rows in set (0.028 sec)
MySQL [test_db]> select count(0) from my_table where confirm_time >‘2021-01-01’;
ERROR 1105 (HY000): Check schema[i].type->equals(*storage_schema[i].type) failed, schema[i].name = table_scan_0, schema[i].type->getName() = Nullable(MyDateTime(6)), storage_schema[i].name = confirm_time, storage_schema[i].type->getName() = Nullable(MyDateTime(0))
MySQL [test_db]>