Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decimal 数据类型精度丢失 #313

Open
x-ainger opened this issue Apr 20, 2021 · 1 comment
Open

decimal 数据类型精度丢失 #313

x-ainger opened this issue Apr 20, 2021 · 1 comment

Comments

@x-ainger
Copy link

mysqlbatch:
image
将 decimal 格式的数据,转换为 golang float64 类型,会导致精度丢失
此处可采用 "github.com/shopspring/decimal" decimal.Decimal{}

mysqlstream:
设置 go-mysql sync 参数:UseDecimal: true

x-ainger pushed a commit to x-ainger/gravity that referenced this issue Apr 20, 2021
x-ainger pushed a commit to x-ainger/gravity that referenced this issue Apr 20, 2021
@Ryan-Git
Copy link
Collaborator

具体怎么丢失?直接写 mysql 应该没问题的。
序列化的话 json 本来就没有 decimal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants