Project

General

Profile

Bug #8212

FILL operations do not work correctly with active dataset relations

Added by Ovidiu Maxiniuc 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

History

#2 Updated by Ovidiu Maxiniuc 3 months ago

While working on #8178 I noticed some differences in the way FWD populates the database when there are active dataset relations between its buffers.

The testcase is the following:

output to \tmp\8212a.out.

define temp-table ttParent
    field pKey as integer
    field fData as character
    index pKey as primary unique pKey.

define temp-table ttChild
    field fKey as integer
    field fData as character.

define dataset sds for ttParent, ttChild
    data-relation fam for ttParent, ttChild relation-fields(ttParent.pKey, ttChild.fKey).

define temp-table srcParent like ttParent.
create srcParent. srcParent.pkey = 1. srcParent.fData = "one".
create srcParent. srcParent.pkey = 2. srcParent.fData = "two".
create srcParent. srcParent.pkey = 3. srcParent.fData = "three".
define data-source dsrcParent for srcParent.
buffer ttParent:attach-data-source(data-source dsrcParent:handle).
data-source dsrcParent:fill-where-string = "WHERE pkey LE 3".
message "P:" data-source dsrcParent:query:prepare-string.

define temp-table srcChild like ttChild.
create srcChild. srcChild.fkey = 1. srcChild.fdata = "uno".
create srcChild. srcChild.fkey = 1. srcChild.fdata = "un".
create srcChild. srcChild.fkey = 3. srcChild.fdata = "tre".
create srcChild. srcChild.fkey = 4. srcChild.fdata = "quattro".
define data-source dsrcChild for srcChild.
buffer ttChild:attach-data-source(data-source dsrcChild:handle).
// data-source dsrcChild:fill-where-string = "WhERE  ttChild.fkey=ttparent.pkey".
// data-source dsrcChild:fill-where-string = "WHErE srcChild.fKey=ttParent.pKey".
message "C:" data-source dsrcChild:query:prepare-string.

dataset sds:fill().

for each ttParent:
    message "p:" ttParent.pkey ttParent.fdata.
end.
for each ttChild:
    message "f:" ttChild.fkey ttChild.fdata.
end.

Notice the two fill-where-string commented assignments. Enable them individually has different results in output as well as enabling/disabling the data-relation fam.

Also available in: Atom PDF