pt-archiver a table with json type column to a file, encoding error

Description

hello
 
i used  pt-archiver to archive some data to a file, 
but  table have  a json type column,  table charset is utf8, 
and  data  in  archived  file  are  mojibake, as following:

1. table contents 


------------------+

id

tt               


------------------+

14

{"ss": "哈哈"}   

 
2. result of  pt-archiver   and  --file option:   
14      {"ss": "哈哈"}
 
3. table structure:
CREATE TABLE `tt1` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `tt` json DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8
 
4.  pt-archiver  dsn   charset:utf8
 
5. MySQL characterset

character_set_client     

utf8                       

character_set_connection

utf8                       

character_set_results   

utf8                       

character_set_server     

utf8mb4                   

when  no json type column, everything works well, contents in archived file are correct.

 
so ,I thought that  errors occurred when writing  from resultset to dest file.
 
 
 
 
 

Environment

None

Smart Checklist

Activity

Show:

Elizabeth Rodriguez Fallas March 3, 2022 at 2:17 AM

I have the same issue with columns with json format. 

Is there any suggestion on how to handle those cases? 

Jericho Rivera August 16, 2020 at 5:23 AM

Can confirm, encoding inside a json data type is not converted correctly:

Details

Assignee

Reporter

Priority

Fix versions

Smart Checklist

Created August 6, 2020 at 11:01 AM
Updated December 30, 2024 at 9:31 AM