Page 1 of 1

mabe a bug in ZDbcInterbase6Statement in line 373

Posted: 26.02.2021, 13:34
by xwg
when ArrayCount mod FMaxRowsPerBatch = 0, av occure.

Code: Select all

if ArrayCount > 0 then begin
    if FMaxRowsPerBatch = 0 then begin
      eBlock := GetExecuteBlockString(FParamSQLData,
        IsParamIndex, InParamCount, ArrayCount, CachedQueryRaw,
        FIBConnection.GetPlainDriver, FMemPerRow, PreparedRowsOfArray, FMaxRowsPerBatch,
          FTypeTokens, FStatementType, FIBConnection.GetXSQLDAMaxSize);
    end else
       eBlock := '';
    if (FMaxRowsPerBatch <= ArrayCount) and (eBlock <> '') then begin
      PrepareArrayStmt(FBatchStmts[True]); //max block size per batch
      if ArrayCount > FMaxRowsPerBatch then //final block count
      PrepareFinalChunk(ArrayCount mod PreparedRowsOfArray);
    end else if (eBlock = '') then begin
      if (FMaxRowsPerBatch > ArrayCount) then begin
        if (FBatchStmts[False].PreparedRowsOfArray <> ArrayCount) then
          PrepareFinalChunk(ArrayCount) //full block of batch
      end else
        if (ArrayCount <> FMaxRowsPerBatch) and (FBatchStmts[False].PreparedRowsOfArray <> (ArrayCount mod FMaxRowsPerBatch)) then
          PrepareFinalChunk(ArrayCount mod FMaxRowsPerBatch); //final block of batch  <==== this line av when  ArrayCount mod FMaxRowsPerBatch = 0
    end else if (FBatchStmts[False].PreparedRowsOfArray <> ArrayCount) then
      PrepareArrayStmt(FBatchStmts[False]); //full block of batch
    end;

Re: mabe a bug in ZDbcInterbase6Statement in line 373

Posted: 27.02.2021, 12:24
by marsupilami
Hello,

thank you for the patch. We applied it to trunk. It will take some time before it gets merged into the stable branches.

Best regards,

Jan