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
1.03k stars 343 forks source link

X-Post: Extra DDL formations in PARTITION_INDEXES_partition.sql in MYSQL #1551

Closed shubham-yb closed 1 year ago

shubham-yb commented 1 year ago

Hi Team, Thank You for the quick fix on https://github.com/darold/ora2pg/issues/1537

I had also noticed this for another partition, i.e. PARTITION BY RANGE COLUMNS. An extra DDL gets formed even though there are no indexes on the source.

Source schema:

drop table if exists range_columns_partition_test;

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)
);

INSERT INTO range_columns_partition_test VALUES (5,5),(3,4), (5,11), (5,12),(4,3),(3,1);

The partition is exported fine but an extra DDL gets formed in PARTITION_INDEXES_partition.sql

-- Create indexes on each partition of table range_columns_partition_test
CREATE INDEX p1_b ON p1 (b);

This is syntactically correct but it is there any specific reason why it gets created or is it a bug?

Thank You

darold commented 1 year ago

Right, I had miss this report. Commit 7b8f018 fixes this issue.