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

LEFT OUTER JOIN using (+) Bug #1761

Closed carenswijaya01 closed 3 months ago

carenswijaya01 commented 3 months ago

Hi Darold, i found new bug

When i tried to convert

-- q1
select * from tblA, tblB, tblC
where tblA.id = tblB.id (+) and tblA.ids = tblC.id (+);

The result is

-- q1
select 
  * 
FROM 
  tbla 
  LEFT OUTER JOIN tblb ON (tblA.id = tblB.id) 
  LEFT OUTER JOIN tblc ON (tblA.ids = tblC.id);

which seem perfectly fine

but when i tried to convert

-- q2
select * from tblA, tblB, tblC
where (tblA.id = tblB.id (+)) and (tblA.ids = tblC.id (+));

The result is

-- q2
select 
  * 
FROM 
  tbla, 
  (
    tbla 
    LEFT OUTER JOIN tblb ON (tblA.id = tblB.id) 
    LEFT OUTER JOIN tblc ON (tblA.ids = tblC.id);

It failed to convert

Even if i tried to put whitespace like this

-- q3
select * from tblA, tblB, tblC
where ( tblA.id = tblB.id (+) ) and ( tblA.ids = tblC.id (+) );

The result became

-- q3
select 
  * 
FROM 
  tblc, 
  tblb, 
  tbla;

Which it didn't successfully convert to postgres, just because i add white space ( tblA.id = tblB.id (+) )

There are so much pattern to try, but the problem i think because the (, ), and (space)

darold commented 3 months ago

Commit e148208 fixes this problem.

carenswijaya01 commented 2 months ago

Commit e148208 fixes this problem.

thanks darold