Icon View Incident Report

Serious Serious
Reported By: Terry Swiers
Reported On: 8/1/2012
For: Version 2.09 Build 1
# 3609 Altering a Table Created with CREATE TABLE..AS SELECT Can Cause Corruption Error

I'm getting a error restructuring a table indicating a corrupt table error with a duplicate key violation, but it's reporting it on a non-unique index.

The full error message is "The alteration could not complete due to an error with the row ACC.CABLETIES (ElevateDB Error #601 The table code is corrupt (The index PostToWeb contains duplicate keys))

This occurs in both 2.08b3 and 2.09b1.

ALTER TABLE "code"
ALTER COLUMN "Location" AS VARCHAR(35) COLLATE "UNI"
   DESCRIPTION 'Inventory location',
ALTER COLUMN "Reminder" AS VARCHAR(128) COLLATE "UNI"
   DESCRIPTION 'Text displayed when an item is sold on a transaction',
ADD COLUMN "EHFInd" BOOLEAN DEFAULT False,
ADD COLUMN "EHFCode" VARCHAR(20) COLLATE "UNI"



Comments Comments
This issue was that this Code table was built via a query (CREATE TABLE AS), so internally there was still a result set "order by" index in place in the table. The table alteration code is set up to delete these indexes the first chance it gets, for obvious reasons. However, there was a bug in this deletion code that wasn't resetting some index positions properly, and the result was that the index rebuild for the Location index was using the wrong index information (off by one).


Resolution Resolution
Fixed Problem on 8/2/2012 in version 2.10 build 1


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 PHP Standard
ElevateDB PHP Standard with Source
ElevateDB PHP Trial
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image