Project

General

Profile

Bug #10925

Ignore dataset name if present, for a dataset declared with serialize-hidden

Added by Paul Bodale 8 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Paul Bodale
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

simple_10925.patch Magnifier (866 Bytes) Paul Bodale, 11/24/2025 08:46 AM

10925.zip (3.23 KB) Teodor Gorghe, 11/24/2025 10:29 AM

simple_10925.patch Magnifier (1.29 KB) Paul Bodale, 11/25/2025 02:49 AM

History

#1 Updated by Paul Bodale 8 months ago

  • Assignee set to Paul Bodale
  • Status changed from New to WIP

There is this testcase:

def temp-table tt1 field f1 as int.
def dataset ds1 SERIALIZE-HIDDEN for tt1.

dataset ds1:read-json("file", "task/input/payload.json", "empty").
// content of the file: {"ds1":{"tt1":[{"f1":1}]}}

find first tt1.
message tt1.f1.

Which fails to load the record for the tt1 temp-table.

I just checked again with the latest trunk (rev. 16292) and the test passes this time (I don't know why it didn't before) but it still persists on the branch 9457c rev. 16356 where it was initially discovered.

#2 Updated by Paul Bodale 8 months ago

  • File simple_10925.patchMagnifier added
  • Status changed from WIP to Review
  • % Done changed from 0 to 100

I attached a simple patch to be applied over the 9457c rev. 16356 that solves the issue.

#3 Updated by Constantin Asofiei 8 months ago

  • reviewer Teodor Gorghe added

I think you may need to use the SERIALIZE-NAME of the DATASET and not its NAME. Teodor, please review.

Also, Paul: what changes are missing from or added to 9457c that this does not work with this branch?

#5 Updated by Teodor Gorghe 8 months ago

  • Status changed from Review to WIP
  • File 10925.zip added
  • % Done changed from 100 to 60

Paul Bodale wrote:

I attached a simple patch to be applied over the 9457c rev. 16356 that solves the issue.

Code review of #10925-2:
- this is a regression caused by the changes from 9457c rev 16275, for fixing the case from p2.p.
- the issue is that when dsHidden is set to true and tok not null, the (tok = parser.nextToken()) != null does not get executed. The parser is in the dataset node, which tries to read this as a table.
- the patch included in #10925-2 fixes this hidden feature, but as Constantin told in #10925-3, you also need to check the NAME value, because 4GL also checks for this. You have as reference the code from JsonImport.readDataset.
- I don't have any objections other than that.

Constantin, what are the plans for this issue? The change from 9457c rev 16275 is included as a fix for a task issue? If it isn't included anywhere, we shall also include that fix here?

#6 Updated by Paul Bodale 8 months ago

  • % Done changed from 60 to 100
  • File simple_10925.patchMagnifier added
  • Status changed from WIP to Review

Teodor Gorghe wrote:

Code review of #10925-2:
- this is a regression caused by the changes from 9457c rev 16275, for fixing the case from p2.p.
- the issue is that when dsHidden is set to true and tok not null, the (tok = parser.nextToken()) != null does not get executed. The parser is in the dataset node, which tries to read this as a table.
- the patch included in #10925-2 fixes this hidden feature, but as Constantin told in #10925-3, you also need to check the NAME value, because 4GL also checks for this. You have as reference the code from JsonImport.readDataset.
- I don't have any objections other than that.

Thanks for the review! Attached to this note is the updated patch. History entries are also included.

The patch is to be applied over the 9457c branch.

#7 Updated by Constantin Asofiei 8 months ago

Paul: please create 10925a and add there the 9457c/16275 change and your change.

I'll also look into 9457c which other changes related to JSON/XML import/export are not in any branch and I'll commit in this same branch.

#8 Updated by Paul Bodale 8 months ago

Constantin Asofiei wrote:

Paul: please create 10925a and add there the 9457c/16275 change and your change.

Created branch 10925a and committed rev 16293.

This commit contains only the changes from the method that needs to be modified in order to keep the possible conflicts at a minimum and the branch compiling.

I'll also look into 9457c which other changes related to JSON/XML import/export are not in any branch and I'll commit in this same branch.

If you find that there are a lot more of those changes that are not committed anywhere you can send them over and I'll merge them in this branch with all their dependencies or commit everything here if you prefer.

#9 Updated by Teodor Gorghe 8 months ago

  • Status changed from Review to Internal Test
Code review of 10925a rev. 16293:
  • This includes the changes from 9457c/16275 and the fix from #10925-2.
  • The changes from JsonImport are right and I don't have any objection.

Please proceed forward with testing the archive which I have provided to you on #10925-5 and also think about for other cases which can occur.
After this process, please test with all customer applications, which contains any usage of DATASET:READ-JSON.

#10 Updated by Teodor Gorghe 8 months ago

  • Status changed from Internal Test to WIP

I will mark this task in WIP, since there are some more changes from 9457c that needs to be added there.

#12 Updated by Teodor Gorghe 7 months ago

Committed revision 16294 on task branch 10925a:
- Fixed non-deterministic behavior when using temp-tables with the same SERIALIZE-NAME.

#13 Updated by Teodor Gorghe 7 months ago

It fixes the non-deterministic behavior, but I think the fix isn't right. I will analyze it and come with a correct solution.

#14 Updated by Teodor Gorghe 7 months ago

Committed revision 16295 on task branch 10925a:
- Added the correct fix for this issue: Keep returning the proxy.

#15 Updated by Teodor Gorghe 7 months ago

Committed revision 16295 on task branch 10925a:
- Fixed regression from last 2 revisions.

#16 Updated by Constantin Asofiei 7 months ago

Teodor, please use a counter loop instead of a for iterator loop - this avoids creating a new iterator instance.

#17 Updated by Teodor Gorghe 7 months ago

Committed revision 16296 on task branch 10925a:
- Use count iteration instead of iterator.

#18 Updated by Constantin Asofiei 6 months ago

  • Status changed from WIP to Internal Test

#19 Updated by Teodor Gorghe 6 months ago

Rebased to trunk rev 16358

#20 Updated by Constantin Asofiei 6 months ago

  • Status changed from Internal Test to Merge Pending

Merge to trunk after 10898a

#21 Updated by Teodor Gorghe 6 months ago

  • Status changed from Merge Pending to Test

Branch 10925a was merged to trunk rev. 16388 and archived.

#22 Updated by Constantin Asofiei 6 months ago

  • Status changed from Test to Closed

Also available in: Atom PDF