Description:
Where are well known triggers?
I've read about mysql triggers, but what I want to say is this:
When I post query like
insert into songs (title,code) values ('song name',123)
automatically in table codes to be inserted the code 123
And because I'm not good in explainations here is an example from little database engine called SQLite:
let's create 3 tables:
create table keys (id integer primary key, code integer,type varchar(10));
create table songs (id integer primary key,title varchar(40),code integer);
create table pics (id integer primary key,pic varchar(40),code integer);
now the triggers:
create trigger t1 after insert on songs for each row begin
insert into keys values(null,new.code,'song');
end;
create trigger td1 before delete on songs for each row begin
delete from keys where k=old.id;
end;
create trigger t2 after insert on pics for each row begin
insert into keys values (id,new.code,'picture');
end;
create trigger td2 before delete on pics for each row begin
delete from keys where k=old.id;
end;
So when a query is executed for songs or pics tables keys table will automatically update.
Tell me if this feature is already made in new releases of mysql
How to repeat:
Well in feature request I don't need to supply instructions for bug repeating
Suggested fix:
this is very use full feature, but I didn't find it in mysql