Skip to content

tiflash: MySQL compatibility about decimal insert through jdbc #20786

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

Open
wants to merge 1 commit into
base: release-8.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions develop/dev-guide-sample-application-java-jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ Java 驱动程序提供对数据库的底层访问,但要求开发者:
- 减少管理连接和事务的[模板代码](https://en.wikipedia.org/wiki/Boilerplate_code)
- 使用数据对象代替大量 SQL 语句来操作数据

### MySQL 兼容性

当写入decimal类型的数据时,如果小数位数超过字段定义的小数位数,无论超过多少,MySQL都会truncate并插入成功。在TiDB的v8.1.2及之前版本中,如果小数位数超过字段定义的小数位数但未超过72位,同样会truncate并插入成功;而如果小数位数超过72位,写入会失败并报错。在TiDB的v8.1.3及之后版本中,则和MySQL一样,无论小数位数超过多少,都会truncate并插入成功。

## 下一步

- 关于 MySQL Connector/J 的更多使用方法,可以参考 [MySQL Connector/J 官方文档](https://dev.mysql.com/doc/connector-j/en/)。
Expand Down