Project

General

Profile

Bug #6388

save-where-string works without the buffer attached to a dataset

Added by Constantin Asofiei almost 2 years ago. Updated almost 2 years ago.

Status:
Test
Priority:
High
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:

my-tests-save-fill-where-strings1.p Magnifier - error 11892 (8.92 KB) Ovidiu Maxiniuc, 05/23/2022 01:14 PM

History

#1 Updated by Constantin Asofiei almost 2 years ago

This test shows that save-where-string works without the buffer attached to a dataset:

def temp-table tt1 field f1 as int.
def dataset ds1 for tt1.
def var dsrc1 as handle.

create data-source dsrc1.
dsrc1:add-source-buffer(buffer tt1:handle, "f1").
dsrc1:save-where-string("tt1") = "where tt1.book-id = 10".
message dsrc1:save-where-string("tt1").

dataset ds1:get-buffer-handle("tt1"):attach-data-source(dsrc1).

Currently I've disabled this test:

      if (datasetBuffer == null)
      {
         ErrorManager.recordOrShowError(11892, buffers.get(0).doGetName());
         // Attempt to reference dataset buffer of a data-source before ATTACH-DATA-SOURCE for data-source buffer <name>.
         return new character();
      }

in DataSource setSaveWhereString and getSaveWhereString methods.

Ovidiu, is there a reason why this check was added? I can't duplicate it.

#3 Updated by Ovidiu Maxiniuc almost 2 years ago

Probably the condition must be refined. See the attached procedure which shows the error. I am investigating additional elements which dictates whether the error is pertinent or not.

#4 Updated by Ovidiu Maxiniuc almost 2 years ago

  • % Done changed from 0 to 100
  • Status changed from New to WIP

It seems that if the attribute is set manually, the error in getter is not thrown any more (removing the line no. 7 (the assignment) in your example will cause the error to be shown). I could not identify a testcase where the error is thrown in the case of the setter. It could be a deduction of mine (based on the text of the error), so I commented out the error in that case.

Committed as r13867 in 6129a.

#5 Updated by Constantin Asofiei almost 2 years ago

  • Status changed from WIP to Test

Also available in: Atom PDF