Skip to content

fix(mysql): consistent SET column replication between snapshot and cdc#4551

Merged
dtunikov merged 7 commits into
mainfrom
fix/dbi-817/mysql-set-as-uint64
Jul 9, 2026
Merged

fix(mysql): consistent SET column replication between snapshot and cdc#4551
dtunikov merged 7 commits into
mainfrom
fix/dbi-817/mysql-set-as-uint64

Conversation

@dtunikov

@dtunikov dtunikov commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

consistent mysql SET column replication when row metadata is not enabled
follows existing pattern introduced for mysql enums (uint16enum q type)

@dtunikov dtunikov requested review from a team as code owners July 8, 2026 16:01
return "BIGINT"
case types.QValueKindUint16Enum:
return "INTEGER"
case types.QValueKindUint64Set:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this and cdc store changes were added just for consistency with uint16enum

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

❌ Test Failure

Analysis: 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.
Confidence: 0.98

⚠️ This appears to be a real bug - manual intervention needed

View workflow run

@claude

claude Bot commented Jul 8, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / QValueUint64Set and 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 cast SET to UNSIGNED.
  • 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.

Comment thread flow/shared/types/qvalue.go
Comment thread flow/pua/peerdb.go Outdated
Comment thread flow/model/qvalue/avro_converter.go
Comment thread flow/model/qrecord_avro_size_test.go
Comment thread flow/e2e/clickhouse_mysql_test.go Outdated
Comment thread flow/connectors/mysql/type_conversion.go Outdated
Comment thread flow/connectors/postgres/qvalue_convert.go
Comment thread flow/connectors/bigquery/qvalue_convert.go
Comment thread flow/connectors/mysql/qrep.go
Comment thread flow/shared/types/qvalue.go
Comment thread flow/pua/peerdb.go Outdated
Comment thread flow/model/qvalue/avro_converter.go
Comment thread flow/model/qrecord_avro_size_test.go
Comment thread flow/e2e/clickhouse_mysql_test.go Outdated
Comment thread flow/connectors/postgres/qvalue_convert.go
Comment thread flow/connectors/mysql/qrep.go
Comment thread flow/connectors/bigquery/qvalue_convert.go
dtunikov and others added 4 commits July 9, 2026 10:45
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>
@dtunikov dtunikov enabled auto-merge (squash) July 9, 2026 09:35
@dtunikov dtunikov merged commit fd0b39c into main Jul 9, 2026
18 checks passed
@dtunikov dtunikov deleted the fix/dbi-817/mysql-set-as-uint64 branch July 9, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants