Subject | Re: [Firebird-Architect] rfc: TRUNCATE TABLE |
---|---|
Author | Adriano dos Santos Fernandes |
Post date | 2008-10-22T12:27:27Z |
Roman Rokytskyy escreveu:
to read/write data to it seems dangerous to me. And that data will be
lost later.
This is not just a problem of DDL triggers, but any statement running
after a TRUNCATE on the same transaction.
Perhaps, we should block access to them before the commit? In this case,
AFTER have no more/different value than BEFORE.
possible verifications should be done early.
Adriano
>> Why? Other DDL statements also perform the most important work in DFW,Having a AFTER TRUNCATE trigger accessing a truncated table and be able
>> but you proposed to have the appropriate AFTER triggers for them. As far
>> as I see, the only thing that differs for TRUNCATE is that both BEFORE
>> and AFTER triggers will be semantically equivalent, as there are no
>> metadata modifications during the statement execution that could be seen
>> in the AFTER trigger.
>>
to read/write data to it seems dangerous to me. And that data will be
lost later.
This is not just a problem of DDL triggers, but any statement running
after a TRUNCATE on the same transaction.
Perhaps, we should block access to them before the commit? In this case,
AFTER have no more/different value than BEFORE.
>But with proposed DDL triggers AFTER triggers will be fired. So all
> Not 100% correct. If the TRUNCATE fails during the execution, the AFTER
> trigger won't be fired, so any action there won't be executed.
possible verifications should be done early.
Adriano