Skip to content

ALTER from ENUM to VARCHAR ends with numeric values in VARCHAR #642

@fuyar

Description

@fuyar

Hey Schlomi,

After having issues with the SET field, I tried the same thing with a ENUM.

I'm using latest gh-ost (1.0.46) release on linux Ubuntu trusty.

There is no problem with the copy part but the binlog streamer will insert the decimal value instead of the literal value.

Example :

CREATE TABLE enum_binlog (
  id int(11) NOT NULL AUTO_INCREMENT,
  color enum('blue','red','green','yellow','black','white','brown','purple','pink','orange') NOT NULL,
  PRIMARY KEY (`id`)
);
insert into enum_binlog (color) values ('blue');
insert into enum_binlog (color) values ('orange');

In the binlog :

### INSERT INTO `test`.`enum_binlog`
### SET
###   @1=1 /* INT meta=0 nullable=0 is_null=0 */
###   @2=1 /* ENUM(1 byte) meta=63233 nullable=0 is_null=0 */

### INSERT INTO `test`.`enum_binlog`
### SET
###   @1=2 /* INT meta=0 nullable=0 is_null=0 */
###   @2=10 /* ENUM(1 byte) meta=63233 nullable=0 is_null=0 */

Thanks again for your work !

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