Skip to content

MySQL 5.x: enums are strings during snapshot, integers during CDC #3950

@ilidemi

Description

@ilidemi

In 8.x we enforce binlog_row_metadata=full that gives us strings on both paths. 5.x doesn't support full so snapshot gets strings and CDC gets integers that we can't easily resolve. For consistency, snapshot 5.x enums as integers.

Repro on 5.7:

CREATE TABLE with_enum (
    id INT AUTO_INCREMENT PRIMARY KEY,
    status ENUM('active', 'inactive', 'pending') NOT NULL
);

INSERT INTO with_enum (status) values ('active');

-- (do snapshot)

INSERT INTO with_enum (status) values ('active');

After the CDC batch goes through, one row will have status='active' and the other status='1'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions