View Issue Details

IDProjectCategoryView StatusLast Update
0004488SymmetricDSBugpublic2022-08-04 20:28
Reportertomas.marik Assigned Toelong  
Priorityhigh 
Status closedResolutionfixed 
Product Version3.12.2 
Target Version3.12.10Fixed in Version3.12.10 
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

Relationships

related to 0004973 closedelong Unicode synchronization of utf8 strings with 4 byte characters in MySql and MariaDB does not work 

Activities

elong

2022-08-04 20:26

developer   ~0002144

We'll use utf8mb4 for MySQL 5.5.3 and newer, but continue to use utf8 for older versions, if the user doesn't specify one. The user can specify character set by setting db.master.collation parameter.

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
2022-08-04 20:24 elong Relationship added related to 0004973
2022-08-04 20:26 elong Note Added: 0002144
2022-08-04 20:26 elong Assigned To => elong
2022-08-04 20:26 elong Status new => resolved
2022-08-04 20:26 elong Resolution open => fixed
2022-08-04 20:26 elong Fixed in Version => 3.12.18
2022-08-04 20:26 elong Target Version => 3.12.18
2022-08-04 20:28 elong Status resolved => closed