Skip to content
This repository was archived by the owner on Oct 19, 2023. It is now read-only.
This repository was archived by the owner on Oct 19, 2023. It is now read-only.

Unable to process a line with a primary key set to zero #103

@ragusa87

Description

@ragusa87

First at all, thanks for this wonderful project.

I am having an issue with a primary key having the zero value
(It's an existing database, don't ask me how it happens)

How to reproduce

Given the following schema:

CREATE TABLE `my_table` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `label` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
) ENGINE=InnoDB AUTO_INCREMENT=3745 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci

I insert a record with a primary key set to zero:

TRUNCATE my_table;
ALTER TABLE my_table CHANGE id id INT(10) UNSIGNED NOT NULL;
INSERT INTO my_table (id, label) VALUES (0, 'test 0');
INSERT INTO my_table (id, label) VALUES (1, 'test 1');
select * from my_table

If I run the tool with the config below, the entry 0 is not altered:

entry:
  my_table:
    columns:
      label:
        formatter: firstName

Other entry are changed

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