为提高效率,请提供以下信息,问题描述清晰能够更快得到解决:
【TiDB 版本】
v5.0.1
【问题描述】
用tispark导入的一张表中有一些decimal类型的字段,用tikv去查值是正确的,开启tiflash后查到异常值。
用create table decimal_test like theme_loan_cust 建了相同结构的新表,发现在少量数据时tiflash查询正常。
mysql>
mysql> set @@session.tidb_isolation_read_engines = “tikv”;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>
mysql> SELECT khh,ckrj_1,ckrj_3,ckrj_6 from theme_loan_cust where khh = ‘1301748316’;
±-----------±-------±-------±-------+
| khh | ckrj_1 | ckrj_3 | ckrj_6 |
±-----------±-------±-------±-------+
| 1301748316 | 0.00 | 0.00 | 0.00 |
±-----------±-------±-------±-------+
1 row in set (0.06 sec)
mysql> set @@session.tidb_isolation_read_engines = “tiflash”;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT khh,ckrj_1,ckrj_3,ckrj_6 from theme_loan_cust where khh = ‘1301748316’;
±-----------±----------------------------------------±------------------------±----------------------------------------+
| khh | ckrj_1 | ckrj_3 | ckrj_6 |
±-----------±----------------------------------------±------------------------±----------------------------------------+
| 1301748316 | 279446738211397746516824450641260707.84 | 94078394776004612587.52 | -13292279957849135117205656168678031.36 |
±-----------±----------------------------------------±------------------------±----------------------------------------+
1 row in set (0.15 sec)
mysql>
mysql> show create table theme_loan_cust;
CREATE TABLE theme_loan_cust
(
khh
varchar(90) DEFAULT NULL COMMENT ‘客户号’,
。。。中间省略。。。
ckrj_1
decimal(22,2) DEFAULT NULL COMMENT ‘近1个月存款日均’,
ckrj_3
decimal(22,2) DEFAULT NULL COMMENT ‘近3个月存款日均’,
ckrj_6
decimal(22,2) DEFAULT NULL COMMENT ‘近6个月存款日均’
。。。中间省略。。。
dt
date DEFAULT NULL COMMENT ‘日期分区’
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
mysql> select count() from theme_loan_cust;
±---------+
| count() |
±---------+
| 12102738 |
±---------+
1 row in set (0.09 sec)
mysql> select tidb_version();
±-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
±-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.0.1
Edition: Community
Git Commit Hash: 1145e347d3469d8e89f88dce86f6926ca44b3cd8
Git Branch: heads/refs/tags/v5.0.1
UTC Build Time: 2021-04-23 05:51:17
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
±-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)