Icon View Incident Report

Serious Serious
Reported By: Danny Humphress
Reported On: 4/19/2004
For: Version 4.05 Build 1
# 1671 TDBISAMTable AddIndex Method Not Creating Indexes Properly When Table is Already Open

have a routine in my application that rebuilds indexes by deleting all indexes (DeleteAllIndex) then re-adding the indexes using AddIndex. It works fine until it gets to one particularly large table that has 5 secondary index keys. It seems to build the primary and first two indexes normally but then zips right through the others. There is no error but it is obvious that it's going too fast to be working even for DBISAM! Afterwards, a Verify operation will show that there are problems with the indexes (which Repair does correct).

procedure TForm1.Button2Click(Sender: TObject);
var
  ATable: TDBISAMTable;
begin
  ATable := TDBISAMTable.Create(Self);
  try
    ATable.DatabaseName := 'c:\winnt\temp';
    ATable.TableName := 'TEST';
    ATable.DeleteAllIndexes;
    ATable.Exclusive := True;
    ATable.Active := True;
    ATable.AddIndex('', 'Lookup', [ixPrimary, ixUnique]);
    ATable.AddIndex('ID', 'ID', [ixCaseInsensitive]);
    ATable.Close;
  finally
    ATable.Free;
  end;
end;



Comments Comments and Workarounds
Thanks to Sean McCall for the example code. The problem occurred when two AddIndex calls were made one after the other with the table already open. The workaround was to close the table in-between the AddIndex calls.


Resolution Resolution
Fixed Problem on 4/24/2004 in version 4.06 build 1
Image