Project

General

Profile

Bug #10470

Wrong order of records fetching when index modification

Added by Eduard Soltan 11 months ago. Updated 9 months ago.

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

0%

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

History

#1 Updated by Eduard Soltan 11 months ago

  • Status changed from New to WIP
def temp-table tt1 no-undo field f1 as character
                           field f2 as character
                           field f3 as character
                           field f4 as character
                           index idx is primary f1 f4.

def temp-table tt2 field f1 as character
                   field f2 as character
                   field f3 as character
                   field f4 as character.

def temp-table tt3 field f1 as character
                   field f2 as character
                   field f3 as character
                   field f4 as character.

FUNCTION MergeBuffers RETURNS LOGICAL 
            (phSrcBuffer AS HANDLE,
             phTgtBuffer AS HANDLE):

    DEFINE VARIABLE hSrcField  AS HANDLE  NO-UNDO.
    DEFINE VARIABLE hTgtField  AS HANDLE  NO-UNDO.
    DEFINE VARIABLE iField     AS INTEGER NO-UNDO.
    DEFINE VARIABLE cModFields AS CHARACTER NO-UNDO.

    IF NOT VALID-HANDLE(phSrcBuffer) OR NOT VALID-HANDLE(phTgtBuffer) THEN
        RETURN FALSE.

    DO iField = 1 TO phSrcBuffer:NUM-FIELDS:
        ASSIGN hSrcField = phSrcBuffer:BUFFER-FIELD(iField)
               hTgtField = phTgtBuffer:BUFFER-FIELD(hSrcField:NAME) NO-ERROR.
        IF VALID-HANDLE(hSrcField) AND VALID-HANDLE(hTgtField) THEN
        DO:
            IF hTgtField:BUFFER-VALUE EQ ? THEN hTgtField:BUFFER-VALUE = hTgtField:DEFAULT-VALUE.                    
        END.        
    END.

END FUNCTION.

create tt1.
tt1.f1 = 'asd'.
tt1.f2 = 'qwer'.
tt1.f3 = ?.
tt1.f4 = 'zasds'.
release tt1.

create tt1.
tt1.f1 = 'asd1'.
tt1.f2 = 'qwer1'.
tt1.f3 = ?.
tt1.f4 = 'fdsfsda'.
release tt1.

create tt1.
tt1.f1 = 'asd2'.
tt1.f2 = 'qwer2'.
tt1.f3 = ?.
tt1.f4 = '1231232'.
release tt1.

create tt2.
tt2.f1 = 'wasd'.
tt2.f2 = 'werew'.
tt2.f3 = 'zxc'.
tt2.f4 = 'asfefw'.

create tt3.
tt3.f1 = 'tre'.
tt3.f2 = 'zxc'.
tt3.f3 = 'cvb'.
tt3.f4 = 'asdasd123'.

def var hQuery as handle.

CREATE QUERY hQuery.
hQuery:SET-BUFFERS(BUFFER tt1:HANDLE).
hQuery:QUERY-PREPARE("FOR EACH tt1":U).

do transaction:
    hQuery:QUERY-OPEN().
    hQuery:GET-FIRST().
    DO WHILE NOT hQuery:QUERY-OFF-END: 
        buffer-copy tt3 except f3 f4 to tt1.    

        MergeBuffers(BUFFER tt2:HANDLE, BUFFER tt1:HANDLE).
        message recid(tt1) tt1.f1 tt1.f2.
        hQuery:GET-NEXT().
    end.
end.

In OE the output is:

2304 tre xcv
2305 tre xcv
2306 tre xcv
2306 tre xcv
2305 tre xcv
2304 tre xcv

In fwd the output is:

2304 tre xcv
2305 tre xcv
2306 tre xcv
2304 tre xcv
2305 tre xcv
2306 tre xcv

I don't know for sure yet if that is the cause for failure of the customer application unit tests, but it is very likely to be it.

#3 Updated by Teodor Gorghe 9 months ago

This issue was solved by #10480?

#4 Updated by Constantin Asofiei 9 months ago

Teodor Gorghe wrote:

This issue was solved by #10480?

Eduard?

#5 Updated by Eduard Soltan 9 months ago

Teodor Gorghe wrote:

This issue was solved by #10480?

This issue can be rejected or closed. The test I was investigating was removed from the customer test suite.

#6 Updated by Constantin Asofiei 9 months ago

  • Status changed from WIP to Rejected

Also available in: Atom PDF