There appears to be a problem with the use of an explicit column named
"oid" from inside an 'instead of insert' trigger on a view. This seems to
have been introduced in version 3.6.18 as the results differ from those of
version 3.6.17.

SQLite version 3.6.21 behaves the same as:
SQLite version 3.6.18
sqlite>
sqlite> create temp table foo (oid integer, nid integer);
sqlite>
sqlite> create temp view vxdata as select * from foo;
sqlite>
sqlite> create temp table log(a integer, b integer);
sqlite>
sqlite> create temp trigger tr instead of insert on vxdata
   ...>    for each row begin
   ...>       insert into log values(new.oid, new.nid);
   ...>    end;
sqlite>
sqlite> insert into vxdata(oid, nid) select 100, 200;
sqlite> insert into foo(oid, nid) select 100, 200;
sqlite> select * from log;
-1|200
sqlite> select * from foo;
100|200
sqlite> .exit


SQLite version 3.6.17
sqlite>
sqlite> create temp table foo (oid integer, nid integer);
sqlite>
sqlite> create temp view vxdata as select * from foo;
sqlite>
sqlite> create temp table log(a integer, b integer);
sqlite>
sqlite> create temp trigger tr instead of insert on vxdata
   ...>    for each row begin
   ...>       insert into log values(new.oid, new.nid);
   ...>    end;
sqlite>
sqlite> insert into vxdata(oid, nid) select 100, 200;
sqlite> insert into foo(oid, nid) select 100, 200;
sqlite> select * from log;
100|200
sqlite> select * from foo;
100|200
sqlite> .exit
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to