Pt-table-sync - Json Fields Virtual Field - Errors

I have started to leverage json more and had a use case for a Citrual field from the Json data…

In the show create table the value it does not like is…

Virtual_field_name varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci GENERATED ALWAYS AS (cast(json_unquote(json_extract(<json_field_name>,_utf8mb3’$.jsonvalue’)) as char(30) charset utf8mb3)) VIRTUAL,

The error is

The value specified for generated column ‘Virtual_field_name’ in table ‘x’ is not allowed.

I see in the Docs you can exclude a field from being compared but can not exclude it from being updated. The Error is because it is trying to update that VIRTUAL field Are any plans being made to help account for Virtual fields which are derived from other fields? OR am I overlooking a potential flag to exclude that field?

2 Likes

Hello @meyerder,
This sounds like a bug in pt-table-sync. It should not be trying to write data to a VIRTUAL column. I suggest opening a bug report on https://jira.percona.com/ and provide an example schema which the engineering team can use to reproduce your situation.

2 Likes