View Issue Details

IDProjectCategoryView StatusLast Update
0004488SymmetricDSBugpublic2020-09-03 12:53
Reportertomas.marik Assigned To 
Priorityhigh 
Status newResolutionopen 
Product Version3.12.2 
Summary0004488: UPDATE triggers have local variables defined with hardcoded "utf8" charset
DescriptionHi,

There is hardcoded "utf8" charset in MySql Trigger Template in definition of local variables "var_row_data" and "var_old_data" here:
https://github.com/JumpMind/symmetric-ds/blob/3.12/symmetric-client/src/main/java/org/jumpmind/symmetric/db/mysql/MySqlTriggerTemplate.java#L90

Other "SYM_" triggers (AFTER INSERT, AFTER DELETE) are not affected.

This causes error when the database and its tables support "utf8mb4" charset and you try to update row with some unicode character (ie. adding an emoji to some varchar cell of a row). MySQL fails with error:

"Incorrect string value: '\xF0\x9F\x98\x81V\xC3...' for column 'var_row_data' at row 1"

preventing the row to be updated.

Please remove hardcoded charset definition or add a possibility to set desired charset in some configuration.

Thanks.
Tagscharacter encoding, dialect: mysql/mariadb, trigger

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-07-29 15:01 tomas.marik New Issue
2020-07-29 15:01 tomas.marik Tag Attached: dialect: mysql/mariadb
2020-07-29 15:01 tomas.marik Tag Attached: trigger
2020-07-29 15:01 tomas.marik Tag Attached: charset
2020-07-29 15:01 tomas.marik Tag Attached: utf8
2020-07-29 15:01 tomas.marik Tag Attached: utf8mb4
2020-09-03 12:53 admin Tag Detached: charset
2020-09-03 12:53 admin Tag Detached: utf8
2020-09-03 12:53 admin Tag Detached: utf8mb4
2020-09-03 12:53 admin Tag Attached: character encoding