[ 
https://issues.apache.org/jira/browse/DERBY-268?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-268:
-------------------------------------

    Attachment: tests.diff

I was going to ask whether delete triggers were supposed to be fired on 
truncate, but ij gave me a reasonable answer:

ij> truncate table t1;
ERROR XCL49: TRUNCATE TABLE is not permitted on 'T1' because it has an enabled 
DELETE trigger (T1_DEL).

Similarly, it refuses to truncate a table referenced in a foreign key 
relationship (unless the table is only referenced by itself):

ij> truncate table t1;
ERROR XCL48: TRUNCATE TABLE is not permitted on 'T1' because unique/primary key 
constraints on this table are referenced by enabled foreign key constraints 
from other tables. 

I've added test cases to verify this behaviour (see attached patch tests.diff). 
I'll commit the patch when write access to the subversion repository has been 
restored (it's currently read-only because of maintenance).

> Add Support for truncate table
> ------------------------------
>
>                 Key: DERBY-268
>                 URL: https://issues.apache.org/jira/browse/DERBY-268
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Lance Andersen
>            Assignee: Eranda Sooriyabandara
>            Priority: Minor
>         Attachments: derby-268-01-ab-enableForInsaneBuilds.diff, 
> Derby-268.diff, tests.diff
>
>
> Adding support for truncate table command will aid to portability

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to