Bug #2199
ambiguity warnings too aggressively disabled
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
version:
Related issues
History
#1 Updated by Ovidiu Maxiniuc over 10 years ago
Because the ambiguity warning level is to low, P2J will force conversion of some pieces of code that that are not P4GL valid.
Having two tables with the same name, defined in two different databases with different schema with a common field. The conversion of following code
FIND FIRST db1.customer. MESSAGE name. FIND FIRST db2.customer. MESSAGE name.
is successful, but the generated code is forces the disambiguation using the 1st record buffer:
new FindQuery(customerBuf2, (String) null, null, "customerBuf2.id asc").first(); message((character) new FieldReference(customerBuf2, "name").getValue()); new FindQuery(customer, (String) null, null, "customer.name asc, customer.address desc").first(); message((character) new FieldReference(customerBuf2, "name").getValue());
Even if the generated code looks logic, one would expect to print the name field from the table of the second database. This is probably why P4GL has chosen to issue a compile-time error (
Error 1762: name is ambiguous with db1.customer.name and db2.customer.name
) when detecting such cases.#2 Updated by Ovidiu Maxiniuc over 10 years ago
I believe the following test-case is related:
This is a P4GL valid code (temp-table book
'hides' the book
table form p2j_test
) but fails to convert correctly on P2J:
define temp-table book field name as char field address as int field book-title as decimal. create book. assign book.name = "k" book.address = -10 book.book-title = 10.8. display book with side-labels. find first p2j_test.book. display p2j_test.book.
#3 Updated by Eric Faulhaber over 10 years ago
- Parent task deleted (
#2116)