Commit 93bd640
committed
handle enum during vstream copy
Enable support for enums during vstream copy phase.
There are two reasons that the connector does not handle `enum` for PSDB branches.
1. The upstream debezium-connector-vitess simply does not support
`enum` during the VStream copy phase. It tries to cast the row value
to an integer, but the value is a string. It seems support for
`enum` landed in 2021
debezium#20, and
support for snapshots (VStream Copy) landed in 2022
debezium#112,
without taking the former into account. This is easily fixed by
finding finding the index of the string
value in the list of values obtained from `column_type` during the
schema discovery phase at the beginning of the VStream.
2. However, this isn't working on some PSDB branches which don't have
the fix vitessio/vitess#13045 for this bug
vitessio/vitess#12981. Fixable by
backporting the bugfix or upgrading those branches.
Signed-off-by: Max Englander <max@planetscale.com>1 parent fd9a261 commit 93bd640
3 files changed
Lines changed: 50 additions & 0 deletions
File tree
- src
- main/java/io/debezium/connector/vitess
- connection
- test/java/io/debezium/connector/vitess
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
48 | 70 | | |
49 | 71 | | |
50 | 72 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
972 | 972 | | |
973 | 973 | | |
974 | 974 | | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
975 | 997 | | |
976 | 998 | | |
977 | 999 | | |
| |||
0 commit comments