Issue Details (XML | Word | Printable)

Key: DERBY-1621
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Yip Ng
Reporter: Daniel John Debrunner
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Derby

Trigger action statement is not recompile when there is a change that would affect it.

Created: 01/Aug/06 04:21 PM   Updated: 30/Jun/09 04:12 PM
Component/s: SQL
Affects Version/s: 10.2.1.6
Fix Version/s: 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works derby1621trunkdiff01.txt 2006-08-14 05:57 AM Yip Ng 30 kB
Text File Licensed for inclusion in ASF works derby1621trunkdiff02.txt 2006-08-14 10:03 PM Yip Ng 29 kB
Text File Licensed for inclusion in ASF works derby1621trunkdiff03.txt 2006-08-15 10:21 PM Yip Ng 31 kB
Text File Licensed for inclusion in ASF works derby1621trunkdiff04.txt 2006-08-16 12:56 AM Yip Ng 32 kB
Text File Licensed for inclusion in ASF works derby1621trunkstat01.txt 2006-08-14 05:57 AM Yip Ng 0.9 kB
Text File Licensed for inclusion in ASF works derby1621trunkstat02.txt 2006-08-14 10:03 PM Yip Ng 1.0 kB
Text File Licensed for inclusion in ASF works derby1621trunkstat03.txt 2006-08-15 10:21 PM Yip Ng 1.0 kB
Text File Licensed for inclusion in ASF works derby1621trunkstat04.txt 2006-08-16 12:56 AM Yip Ng 1.0 kB
Issue Links:
Blocker
 
Reference
 

Urgency: Urgent
Issue & fix info: Release Note Needed
Resolution Date: 26/Aug/06 07:29 AM


 Description  « Hide
A trigger action statement, such as an INSERT statement is not recompiled when there is some DDL change on the underlying table, such as a CREATE INDEX.

In the example below a unique index is added to the table (t2) inserted into by the trigger's action statement. When the tirgger fires it does not raise any error (should raise a unique constraint violated error) and does not insert the value into the index. A select from t2 does not show the additional rows in t2 as it is performing an index scan, once the index is dropped the rows appear to the select.

ij version 10.2
ij> connect 'jdbc:derby:cs;create=true';
ij> create table t (i int);
0 rows inserted/updated/deleted
ij> create table t2 (i int);
0 rows inserted/updated/deleted
ij> create trigger tt after insert on t for each statement mode db2sql
insert into t2 values 1;
0 rows inserted/updated/deleted
ij> insert into t values 1;
1 row inserted/updated/deleted
ij> select * from t2;
I
-----------
1

1 row selected
ij> create unique index tu on t2(i);
0 rows inserted/updated/deleted
ij> insert into t values 1;
1 row inserted/updated/deleted
ij> select * from t2;
I
-----------
1

1 row selected
ij> insert into t values 1;
1 row inserted/updated/deleted
ij> select * from t2;
I
-----------
1

1 row selected
ij> drop index tu;
0 rows inserted/updated/deleted
ij> select * from t2;
I
-----------
1
1
1

3 rows selected

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Daniel John Debrunner made changes - 01/Aug/06 04:25 PM
Field Original Value New Value
Link This issue blocks DERBY-1613 [ DERBY-1613 ]
Daniel John Debrunner made changes - 01/Aug/06 04:27 PM
Link This issue is related to DERBY-1435 [ DERBY-1435 ]
Yip Ng made changes - 01/Aug/06 06:12 PM
Assignee Yip Ng [ yipng ]
Yip Ng made changes - 14/Aug/06 05:57 AM
Attachment derby1621trunkdiff01.txt [ 12338772 ]
Attachment derby1621trunkstat01.txt [ 12338771 ]
Yip Ng made changes - 14/Aug/06 05:58 AM
Derby Info [Patch Available]
Yip Ng made changes - 14/Aug/06 10:03 PM
Attachment derby1621trunkdiff02.txt [ 12338840 ]
Attachment derby1621trunkstat02.txt [ 12338839 ]
Yip Ng made changes - 15/Aug/06 03:12 AM
Derby Info [Patch Available]
Yip Ng made changes - 15/Aug/06 10:21 PM
Attachment derby1621trunkstat03.txt [ 12338918 ]
Attachment derby1621trunkdiff03.txt [ 12338919 ]
Yip Ng made changes - 16/Aug/06 12:56 AM
Attachment derby1621trunkstat04.txt [ 12338929 ]
Attachment derby1621trunkdiff04.txt [ 12338930 ]
Yip Ng made changes - 16/Aug/06 12:56 AM
Derby Info [Patch Available]
Rick Hillegas made changes - 24/Aug/06 03:28 PM
Derby Info [Patch Available]
Yip Ng made changes - 26/Aug/06 07:29 AM
Derby Info [Release Note Needed]
Yip Ng made changes - 26/Aug/06 07:29 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Yip Ng made changes - 28/Aug/06 05:55 AM
Derby Info [Release Note Needed] [Existing Application Impact, Release Note Needed]
Andrew McIntyre made changes - 13/Dec/07 09:05 AM
Status Resolved [ 5 ] Closed [ 6 ]
Dag H. Wanvik made changes - 30/Jun/09 04:12 PM
Issue & fix info [Release Note Needed, Existing Application Impact] [Release Note Needed]