Skip to content

Regression in MySQL auto_increment #1767

Description

@jelder

This configuration file fails:

LOAD DATABASE FROM {{MYSQL_URL}} INTO {{PSQL_URL}}
CAST type bigint with extra auto_increment to bigserial
❯ curl -L -o pgloader.jar \
    https://github.com/dimitri/pgloader/releases/download/v4-dev/pgloader.jar
❯ java -jar pgloader.jar test.load --dry-run
09:32:21.040 INFO  [main] pgloader.cli - DRY RUN — no data will be copied
09:32:21.044 INFO  [main] pgloader.cli - Parsing commands from file test.load
Error: Parse error at line 6, column 32:
    type bigint with extra auto_increment to bigserial
                               ^
Expected one of:
#"\s+" (followed by end-of-string)
:end-of-string
;
#"\s+"
DECODING
DISTRIBUTE
AFTER
BEFORE
EXCLUDING
INCLUDING
MATERIALIZE
ALTER
CAST
SET
WITH
,
#"\s+"

However, this succeeds. Note the removal of the underscore on line 2.

LOAD DATABASE FROM {{MYSQL_URL}} INTO {{PSQL_URL}}
CAST type bigint with extra auto increment to bigserial

The documentation uses the underscored auto_increment form exclusively and in many places.

I discovered this behavior while trying to figure out why my schema was losing all auto-incrementing primary keys. Removing the underscore allows the rest of the load to succeed, but the resulting database has no auto-incrementing primary keys, or sequences, identity, or serial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions