Pt-archiver specifying --bulk-insert cause the 4-byte data in file incorrect

pt-archiver version: 3.0.13

mariadb table data

CREATE TABLE `report29` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(200) DEFAULT NULL,
  `product_id` int DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
insert into report29 values(286743984,'★ Stiletto Knife | Fade (Factory New)','614155','2021-12-23 10:01:24');

pt-archiver

/usr/bin/pt-archiver --source h=172.16.20.12,D=test,t=report29,u=test,p=test \
            --dest h=172.16.20.105,D=test,t=report29 \
            --file="/data/r29.txt" \
            --where "id=286743984" --nosafe-auto-increment --nocheck-charset --noversion-check \
            --limit=1000 --commit-each --statistics --sleep-coef=0.2 --no-delete --why-quit --bulk-insert

The dest data is ok, but there is a problem with the file:

By the way,
It’s ok to not use --bulk-insert and use A=utf8mb4, but importing data in this way is too slow

# no --bulk-insert ,it's ok,but slow
/usr/bin/pt-archiver --source ...,A=utf8mb4 \
            --dest ...,A=utf8mb4 \
            ...

But use --bulk-insert and A=utf8mb4 at the same time,you will get an error:
Wide character in print at /usr/bin/pt-archiver line 6768

# --bulk-insert,cause error
/usr/bin/pt-archiver --source ...,A=utf8mb4 \
            --dest ...,A=utf8mb4 \
            ... \
            --bulk-insert

How to make sure the data in the file is correct when I use --bulk-insert?

2 Likes