darold / ora2pg

Ora2Pg is a free tool used to migrate an Oracle database to a PostgreSQL compatible schema. It connects your Oracle database, scan it automatically and extracts its structure or data, it then generates SQL scripts that you can load into PostgreSQL.
http://www.ora2pg.com/
GNU General Public License v3.0
978 stars 341 forks source link

Schema for Default partition is not dumped while using the RENAME_PARTITION #1715

Closed priyanshi-yb closed 4 months ago

priyanshi-yb commented 6 months ago

Hi Team,

The schema of the default partition in MySQL is not getting generated with the latest and when I used this commit f08d47a4e5c20ff7d348e535ed05ab571b4bb350, it is getting dumped.

Example schema of MySQL -

CREATE TABLE range_columns_partition_test (
    a INT,
    b INT
)
PARTITION BY RANGE COLUMNS(a, b) (
    PARTITION p0 VALUES LESS THAN (5, 5),
    PARTITION p1 VALUES LESS THAN (MAXVALUE, MAXVALUE)
);

Schema dumped with this commit f08d47a4e5c20ff7d348e535ed05ab571b4bb350 -

CREATE TABLE range_columns_partition_test (
    a integer,
    b integer
) PARTITION BY RANGE (a, b) ;

CREATE TABLE range_columns_partition_test_p0 PARTITION OF range_columns_partition_test
FOR VALUES FROM (MINVALUE,MINVALUE) TO (5,5);
CREATE TABLE range_columns_partition_test_p1 PARTITION OF range_columns_partition_test DEFAULT;

However, the schema dumped with the latest is -

CREATE TABLE range_columns_partition_test (
    a integer,
    b integer
) PARTITION BY RANGE (a, b) ;

CREATE TABLE range_columns_partition_test_part1 PARTITION OF range_columns_partition_test
FOR VALUES FROM (MINVALUE,MINVALUE) TO (5,5);

Config parameters set are -

PREFIX_PARTITION 1
PREFIX_SUBPARTITION 1

(Assuming, that I have PREFIX_PARTITION set in the config, the RENAME_PARTITION will be set to 1 with the latest)

Please let me know if I am missing anything.

Thank you for the help!

CC: @darold

darold commented 4 months ago

Commit 6782078 fixes this issue.