Bug #21866 Trigger check sql statement at runtime not at compile time
Submitted: 28 Aug 2006 9:56 Modified: 29 Aug 2006 16:26
Reporter: Andrea Pantaleoni Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S4 (Feature request)
Version:5.0.24 OS:Linux (linux ubuntu)
Assigned to: CPU Architecture:Any

[28 Aug 2006 9:56] Andrea Pantaleoni
Description:
Triggers in MySQL check the standard insert,update,delete SQL statements at runtime not at compile time.
Im my opinion, it could be an enhancement to check these SQL statements at compile time.
Others db vendor do it.(ex. Oracle)
Thanks
Ciao

How to repeat:
create database example
use example

create table A (id int(10));

delimiter //
create trigger testTrigger after insert on A
for each row
begin
insert into B values (1);
end
//
delimiter ;

Note that no error raise and MySQL create the trigger.
Now I use the trigger

insert into A values (2);

I got:
ERROR 1146 (42SO2): Table 'example.B' doesn't exist
[29 Aug 2006 16:26] Valeriy Kravchuk
Thank you for a reasonable feature request.