Icon View Incident Report

Serious Serious
Reported By: Wolfgang Klein [AESA GmbH]
Reported On: 1/25/2016
For: Version 2.21 Build 1
# 4347 Dropping Database Objects While Querying System Information Tables Can Cause Incorrect Error

I want to drop all views. The code below causes an error at the 2nd drop command:

ElevateDB Error #601 The temporary table Views is corrupt (Invalid BLOB block type found

  EDBQuery:=TEDBQuery.Create(nil);
  try
    EDBDatabase.Execute('SELECT * FROM Information.Views', nil, EDBQuery);
    EDBQuery.First;
    while not EDBQuery.Eof do begin
      EDBDatabase.Execute(EDBQuery.FieldByName('DropSQL').AsString);
      EDBQuery.Next;
      end; {von while}
  finally
    EDBQuery.Free;
    end; {von finally}



Comments Comments
The problem is caused by how the TDataSet architecture works with respect to BLOB references in rows, combined with the fact that the system information table is being completely emptied/re-populated when the corresponding system information (in this case, the views in the database) changes.

ElevateDB now issues a "row has been deleted" error message in this situation. In order to avoid any error at all, please use this code:

while (EDBQuery.RecordCount > 0) do
begin
EDBDatabase.Execute(EDBQuery.FieldByName('DropSQL').AsString);
EDBQuery.Refresh;
end;


Resolution Resolution
Fixed Problem on 1/25/2016 in version 2.22 build 1


Products Affected Products Affected
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image