Project

General

Profile

Bug #2077

fix converted table and field name collisions

Added by Constantin Asofiei about 11 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Start date:
03/05/2013
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:

ca_upd20130305e.zip (14.3 KB) Constantin Asofiei, 03/05/2013 02:39 PM

ca_upd20130306e.zip (14.4 KB) Constantin Asofiei, 03/06/2013 10:46 AM

History

#1 Updated by Constantin Asofiei about 11 years ago

In 4GL, it is possible to have two tables names named p2j_test and p2j-test. Also, these field names can be in the same table: f_1 and f-1. Currently, P2J doesn't solve such collisions, as both tables will be named P2jTest (from which only one will survive), and both fields will be named f1, thus having compile-time errors as accessors with the same name will be generated for each one.

def temp-table tt1 field f_1 as int field f-1 as int.

#2 Updated by Constantin Asofiei about 11 years ago

This update solves collisions for dmo, table, property and column names. It adds a numeric suffix, similar to how temp tables get it.

#3 Updated by Constantin Asofiei about 11 years ago

I'm putting this through conversion regression testing.

#4 Updated by Constantin Asofiei about 11 years ago

Passed conversion regression testing.

#5 Updated by Greg Shah about 11 years ago

It looks fine. Check it in and distribute it.

#6 Updated by Constantin Asofiei about 11 years ago

  • % Done changed from 0 to 100

Committed to bzr revision 10246.

#7 Updated by Ovidiu Maxiniuc about 11 years ago

By chance I prepared a sample test-case for this issue which at this moment is not converted correctly by p2j:

def temp-table tt1 field f11 as date field f1 as logical field f-1 as int field f_1 as char.
find first tt1.
display f11 + 2 f1 f-1 + 2 f_1 + "2".

#8 Updated by Constantin Asofiei about 11 years ago

Ovidiu, sorry I hijacked this from you last night. Anyway, this case I don't think is encountered in the server project, and if this is confirmed, we can leave it as a fix for later (p2o.xml just needs to use a loop in each place where the suffix is computed).

#9 Updated by Greg Shah about 11 years ago

If this is easy enough to fix, please go ahead and put the fix in. That way we don't have to remember there is a problem here.

#10 Updated by Constantin Asofiei about 11 years ago

Yes, the fix is pretty simple. I'll provide an update today.

#11 Updated by Constantin Asofiei about 11 years ago

This solves the collision cases for good. Also, I've added support for buffer names collision check. I'm putting this through conversion regression testing.

#12 Updated by Constantin Asofiei about 11 years ago

Update has passed conversion regression testing - no changes in generated code.

#13 Updated by Greg Shah about 11 years ago

Check it in and distribute it.

#14 Updated by Constantin Asofiei about 11 years ago

Committed to bzr revision 10257.

#15 Updated by Eric Faulhaber about 11 years ago

  • Status changed from WIP to Closed

#16 Updated by Greg Shah over 7 years ago

  • Target version changed from Milestone 4 to Conversion Support for Server Features

Also available in: Atom PDF