Icon View Incident Report

Serious Serious
Reported By: Ole Willy Tuv
Reported On: 3/7/2007
For: Version 1.01 Build 1
# 2264 Executing a Procedure with INSERTs on Table Created in Same Procedure Causes AV

1) Create a procedure as follows.

2) Execute the procedure

Access violation at address 005298FF in module 'edbmgr.exe'. Read of address 00000004.

create procedure sp_test()
begin
 declare stmt statement;

 --delete table t2 if exists
 prepare stmt from
 '
   select 1
   from information.tables
   where upper(name) = ''T2''
 ';
 execute stmt;
 if (rowsaffected(stmt) = 1) then
   execute immediate 'alter table t2 drop constraint fk_t2'; --workaround
   execute immediate 'drop table t2';
 end if;

 --delete table t1 if exists
 prepare stmt from
 '
   select 1
   from information.tables
   where upper(name) = ''T1''
 ';
 execute stmt;
 if (rowsaffected(stmt) = 1) then
   execute immediate 'drop table t1';
 end if;

 --table t1
 execute immediate
 '
   create table t1
   (
     pkey integer not null,
     constraint pk_t1 primary key (pkey)
   )
 ';
 execute immediate 'insert into t1 (pkey) values (1)';

 --table t2
 execute immediate
 '
   create table t2
   (
     pkey integer not null,
     fkey integer,
     constraint pk_t2 primary key (pkey),
     constraint fk_t2 foreign key (fkey) references t1 (pkey)
   )
 ';
 execute immediate 'insert into t2 (pkey,fkey) values (100,1)';

 unprepare stmt;
end



Comments Comments
The issue was that the CREATE TABLE statement with constraint definitions is not resetting some flags, which is screwing up the second INSERT on T2 that has the defined constraint.


Resolution Resolution
Fixed Problem on 3/8/2007 in version 1.02 build 1


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

Image