Open heni02 opened 5 days ago
float type同步数据也是不一致 上游mo数据:(col9是float类型) mysql> select id,col9 from table_with_pk_for_load_100M where id in (30498822,30498823,30498824,30498825,30498826,30498828,30498830,30498831); +----------+------------+ | id | col9 | +----------+------------+ | 30498822 | -46958492 | | 30498823 | -11977473 | | 30498824 | -95005180 | | 30498825 | -79523920 | | 30498826 | -5466775.5 | | 30498828 | -8070154.5 | | 30498830 | -94828510 | | 30498831 | -58721676 | +----------+------------+ 8 rows in set (0.01 sec)
下游mysql数据: mysql> select id,col9 from table_with_pk_for_load_100M where id in (30498822,30498823,30498824,30498825,30498826,30498828,30498830,30498831); +----------+-----------+ | id | col9 | +----------+-----------+ | 30498822 | -46958500 | | 30498823 | -11977500 | | 30498824 | -95005200 | | 30498825 | -79523900 | | 30498826 | -5466780 | | 30498828 | -8070150 | | 30498830 | -94828500 | | 30498831 | -58721700 | +----------+-----------+ 8 rows in set (0.01 sec)
mysql table_with_pk_for_load_100M ddl:
CREATE TABLE table_with_pk_for_load_100M
(
id
bigint NOT NULL,
col1
tinyint DEFAULT NULL,
col2
smallint DEFAULT NULL,
col3
int DEFAULT NULL,
col4
bigint DEFAULT NULL,
col5
tinyint unsigned DEFAULT NULL,
col6
smallint unsigned DEFAULT NULL,
col7
int unsigned DEFAULT NULL,
col8
bigint unsigned DEFAULT NULL,
col9
float DEFAULT NULL,
col10
double DEFAULT NULL,
col11
varchar(255) DEFAULT NULL,
col12
date DEFAULT NULL,
col13
datetime DEFAULT NULL,
col14
timestamp NULL DEFAULT NULL,
col15
tinyint(1) DEFAULT NULL,
col16
decimal(16,6) DEFAULT NULL,
col17
text,
col18
json DEFAULT NULL,
col19
blob,
col20
binary(255) DEFAULT NULL,
col21
varbinary(255) DEFAULT NULL,
col22
text,
col23
text,
col24
text,
col25
text,
PRIMARY KEY (id
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
直接往mysql插入数据,发现也会丢失后面几位精度
mysql> create table t3 (id bigint NOT NULL, col9 float DEFAULT NULL, PRIMARY KEY (id));
Query OK, 0 rows affected (0.02 sec)
mysql> insert into t3 values
-> (30498822, -46958492),
-> (30498823, -11977473),
-> (30498824, -95005180),
-> (30498825, -79523920),
-> (30498826, -5466775.5),
-> (30498828, -8070154.5),
-> (30498830, -94828510),
-> (30498831, -58721676);
Query OK, 8 rows affected (0.02 sec)
Records: 8 Duplicates: 0 Warnings: 0
mysql> select * from t3;
+----------+-----------+
| id | col9 |
+----------+-----------+
| 30498822 | -46958500 |
| 30498823 | -11977500 |
| 30498824 | -95005200 |
| 30498825 | -79523900 |
| 30498826 | -5466780 |
| 30498828 | -8070150 |
| 30498830 | -94828500 |
| 30498831 | -58721700 |
+----------+-----------+
8 rows in set (0.00 sec)
issue中提到的double类型的case不能复现
经沟通验证,issue截图中数据不一致的列是float类型不是double类型,原因是精度不够;double类型是没问题的
Is there an existing issue for the same bug?
Branch Name
main
Commit ID
326c9fb
Other Environment Information
Actual Behavior
同步到下游mysql double类型的数据和上游mo select出来的不一致,单独mysql试了下double类型插入数据结果是一致的
Expected Behavior
No response
Steps to Reproduce
Additional information
No response