TiCDC Reading Float Data Type Issue

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

Original topic: ticdc读取float数据类型真

| username: TiDBer_mGBoAnW9

[TiDB Usage Environment] Production Environment
[TiDB Version]
[Reproduction Path] Using ticdc to monitor data changes and push them to the Kafka queue in canal-json format
[Encountered Problem: Phenomenon and Impact] There is a field in the database with the type float(20.4). When reading, the value after the decimal point differs significantly. For example, the stored value in the database is 99.99, but the cdc data read from Kafka is 99.98999786376953.
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]




| username: weixiaobing | Original post link

It is possible that the database truncated the data when the frontend wrote to the database. Your float(20,4) means a total of 20 digits with 4 decimal places, so the database truncated it when storing.

| username: sdojjy | Original post link

This PR will address this issue.