HI,

Something seems to go wrong in this example where an operation unexpectedly gets applied both main and temp.

The order of table creation seems to be one crucial factor. I ran into this while trying to get my head around the use of temporary triggers, which seems to be the other necessary factor.

create temp table t (db, val);
insert into t select 'temp', 'original';

create table t (db, val);
insert into t select 'main', 'original';

create view v as select NULL val WHERE 1;

create temp trigger trg instead of update on v /* main.v make no difference */
begin
    update t set val = new.val;
end;

update v set val = 'touched';

select * from temp.t;
select * from main.t;

select sqlite_version();

OUTPUT:

temp|touched
main|touched
3.17.0

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to