fix(mysql): consistent SET column replication between snapshot and cdc#4551
Conversation
…is not row metadata
| return "BIGINT" | ||
| case types.QValueKindUint16Enum: | ||
| return "INTEGER" | ||
| case types.QValueKindUint64Set: |
There was a problem hiding this comment.
this and cdc store changes were added just for consistency with uint16enum
❌ Test FailureAnalysis: Deterministic failure: the PR added a new QValueKindUint64Set kind but didn't add a size test/alias, so TestAllQValueKindsSizeCovered fails identically across all three matrix jobs. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new QValue kind (uint64set) to represent MySQL SET columns as integer bitmasks on older MySQL setups (without binlog row metadata), aligning snapshot and CDC representations similarly to the existing enum-ordinal handling.
Changes:
- Added
QValueKindUint64Set/QValueUint64Setand wired it through equality, gob registration, record value extraction, and Lua interop. - Added MySQL type gating via a new internal version (
InternalVersion_MySQL5ConvertSetsToInts) and updated MySQL snapshot selection to castSETtoUNSIGNED. - Extended schema/type mappings and Avro conversion coverage; updated e2e + unit tests for enum/set consistency and type conversion gating.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| flow/shared/types/qvalue.go | Adds QValueUint64Set value type. |
| flow/shared/types/kind.go | Adds new kind constant + Snowflake/ClickHouse type mappings. |
| flow/shared/constants.go | Introduces internal version gate for SET-to-int behavior. |
| flow/pua/peerdb.go | Enables Lua assignment for uint64set. |
| flow/model/qvalue/equals.go | Adds equality support for QValueUint64Set. |
| flow/model/qvalue/avro_converter.go | Adds Avro schema/value conversion path for uint64set. |
| flow/model/qrecord_copy_from_source.go | Ensures uint64set is emitted as a raw value for COPY/insert paths. |
| flow/model/qrecord_avro_size_test.go | Adds Avro size test coverage for uint64set. |
| flow/e2e/clickhouse_mysql_test.go | Expands MySQL consistency e2e tests to include SET alongside ENUM. |
| flow/connectors/utils/cdc_store.go | Registers QValueUint64Set for gob serialization. |
| flow/connectors/postgres/qvalue_convert.go | Adds Postgres DDL type mapping for uint64set. |
| flow/connectors/mysql/type_conversion.go | Maps MySQL SET to uint64set behind version + capability gate. |
| flow/connectors/mysql/qvalue_convert.go | Adds MySQL row/query value conversion for uint64set. |
| flow/connectors/mysql/qvalue_convert_test.go | Adds unit tests for MySQL SET kind gating behavior. |
| flow/connectors/mysql/qrep.go | Casts uint64set columns to UNSIGNED in snapshot SELECTs. |
| flow/connectors/bigquery/qvalue_convert.go | Adds BigQuery schema mapping for uint64set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ysql-set-as-uint64
consistent mysql SET column replication when row metadata is not enabled
follows existing pattern introduced for mysql enums (uint16enum q type)