Icon View Incident Report

Serious Serious
Reported By: Michael Fullerton
Reported On: 8/19/2010
For: Version 2.03 Build 20
# 3282 ALTER INDEX Allowed on System-Generated Constraint Indexes

Yesterday I sent an email about getting an AV trying to open the Contacts table. I understand what is causing the problem but not why. After the following code is run on the attached database the contacts table AVs on open. The first ALTER line should not be there. But I don't see why it corrupts the table.

CyberEDB.DB.Execute('ALTER INDEX "PrimaryKey" ON "Contacts" (Name COLLATE "ANSI_CI" ASC)');
CyberEDB.DB.Execute('ALTER TABLE "Contacts" ALTER CONSTRAINT "PrimaryKey" AS PRIMARY KEY ("Name")'+'VERSION 1.04');

Comments Comments and Workarounds
ALTERing an index changes its type to a normal index, as opposed to a primary key, unique, or foreign key, index. This causes table opens to fail if you ALTER the index used by a primary key, because ElevateDB assumes that a primary key index always exists, and after the ALTER a primary key index doesn't exist anymore.

The workaround for this is to not, ever, alter system-generated indexes that are used for constraints.

Also, the DROP INDEX and RENAME INDEX statements also had a similar issue.

Resolution Resolution
Fixed Problem on 8/21/2010 in version 2.03 build 21

Products Affected Products Affected
ElevateDB Additional Software and Utilities
ElevateDB DAC Client-Server
ElevateDB DAC Client-Server with Source
ElevateDB DAC Standard
ElevateDB DAC Standard with Source
ElevateDB DAC Trial
ElevateDB LCL Standard with Source
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial