VRep JSON Columns: fix bug where vreplication of update statements were failing#7640
Conversation
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
| log.Errorf("TestPlayerTypes: flavor is %s", env.Flavor) | ||
|
|
||
| enableJSONColumnTesting := false | ||
| if strings.EqualFold(env.Flavor, "mysql57") { |
There was a problem hiding this comment.
We should be testing mysql80 as well.
There was a problem hiding this comment.
If this is something that doesn't work only on percona56, we should exclude just that one flavor.
There was a problem hiding this comment.
Added mysql80 in addition to mysql57. The Percona flavor is mysql56 and other platforms start with mariadb.
… in CI unit tests Signed-off-by: Rohit Nayak <rohit@planetscale.com>
…on't have json support or have not yet been enabled Signed-off-by: Rohit Nayak <rohit@planetscale.com>
… in CI Signed-off-by: Rohit Nayak <rohit@planetscale.com>
VRep JSON Columns: fix bug where vreplication of update statements were failing Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
|
I believe I am still hitting this same issue running this version (Git revision 873d89a branch 'master') built on Thu Mar 11 09:16:17 UTC 2021 |
|
That commit seems to have been made one minute before the merge of this PR. Can you please try again with the latest code? |
|
Thanks! I am now running Version: 10.0.0-SNAPSHOT (Git revision de902e5 branch 'master') built on Mon Mar 15 19:02:59 UTC 2021 by vitess@d7b8a3c04182 using go1.15.6 linux/amd64 |
|
Fix is tested - replication of updates to JSON data types is confirmed! |
Description
During vreplication we set the MySQL connection to use binary charsets. Due to unexpected MySQL behavior, with collations and json columns, like: https://bugs.mysql.com/bug.php?id=93052, we need to cast json columns to utf8mb4.. We had done this as part of #6829. It turns out however that the casting was only done for inserts on the target and not for updates.
The copy phase results only in (bulk) inserts, so any updates done before we do the copy will not face this issue. This bug surfaces only if the updates are done while we stream binlog events: during the catchup, fastforward or replicate phases.
This PR adds the casting
convert(<value> as utf8mb4)while building update plans as well. The only non-test code change is here: https://github.com/vitessio/vitess/pull/7640/files#diff-944642971422bb00ed68466f784f8b586f5e800f57e0c46002d6194c517cb1a0Signed-off-by: Rohit Nayak rohit@planetscale.com
Related Issue(s)
https://github.com/planetscale/vitess-private/issues/101
Checklist
Impacted Areas in Vitess
Components that this PR will affect: