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

bugfix: convert to utf8mb4 if mysql column is json type #6232

Merged
merged 8 commits into from
Jan 16, 2024

Conversation

Bughue
Copy link
Contributor

@Bughue Bughue commented Jan 3, 2024

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

MySQL handles strings used in JSON context using the utf8mb4 character set and utf8mb4_bin collation. Strings in other character sets are converted to utf8mb4 as necessary. (For strings in the ascii or utf8mb3 character sets, no conversion is needed because ascii and utf8mb3 are subsets of utf8mb4.)

from https://dev.mysql.com/doc/refman/8.0/en/json.html

Ⅱ. Does this pull request fix one issue?

fixes #5107

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@funky-eyes funky-eyes added type: bug Category issues or prs related to bug. mode: AT AT transaction mode module/rm-datasource rm-datasource module labels Jan 4, 2024
@funky-eyes funky-eyes added this to the 2.1.0 milestone Jan 4, 2024
/**
* the type MySQLJsonHelper
**/
public class MySQLJsonHelper {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是不叫mysqljsonhelper比较好,应该取一个中型点的名字,专门用来识别datatype拼接sql用,把nonPkFields.stream().map内的逻辑全部挪到此处
Is it better not to call mysqljsonhelper, should take a medium point name, specially used to identify datatype splicing sql, move all the logic in nonPkFields.stream ().map here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK,I'll optimize it later.

slievrly
slievrly previously approved these changes Jan 6, 2024
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error: /home/runner/work/incubator-seata/incubator-seata/rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java:62: 'lambda arguments' has incorrect indentation level 16, expected level should be 12. [Indentation]
Error: /home/runner/work/incubator-seata/incubator-seata/rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java:63: 'block' child has incorrect indentation level 20, expected level should be 16. [Indentation]
Error: /home/runner/work/incubator-seata/incubator-seata/rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java:64: 'block' child has incorrect indentation level 20, expected level should be 16. [Indentation]
Error: /home/runner/work/incubator-seata/incubator-seata/rm-datasource/src/main/java/io/seata/rm/datasource/undo/mysql/MySQLUndoUpdateExecutor.java:65: 'block rcurly' has incorrect indentation level 16, expected level should be 12. [Indentation]

funky-eyes
funky-eyes previously approved these changes Jan 13, 2024
Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@funky-eyes
Copy link
Contributor

Please add changelog

@Bughue Bughue changed the title bugfix: convert to utf8mb4 if column is json type bugfix: convert to utf8mb4 if mysql column is json type Jan 16, 2024
Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mode: AT AT transaction mode module/rm-datasource rm-datasource module type: bug Category issues or prs related to bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MySQL存在json类型字段,回滚的时候失败
3 participants