This is SQLite 3.6.23.1 compiled with SQLITE_ENABLE_UPDATE_DELETE_LIMIT 
(plus a few others, which should not matter to the problem).

The UPDATE ... LIMIT clause works fine when applied to tables, but 
suppresses any updates when applied to a view with an update trigger.

Here is some example SQL:

create table test (data,rownum integer);
insert into test values ('one',1);
insert into test values ('two',2);
create view vtest as select * from test;
create trigger Trig1 instead of update of data on vtest
   begin
     update test set data = new.data where rownum = new.rownum ;
   end;

-- No LIMIT - this works.
update vtest set data = 'yyy'; --works

-- LIMIT clause present - nothing is updated.
update vtest set data = 'zzz' limit 1;

It is unfortunately not possible to reproduce this with the reference 
binaries from sqlite.org since they are compiled without 
SQLITE_ENABLE_UPDATE_DELETE_LIMIT. Searching the timeline and previous 
list messages did not turn up any applicable results.

So here are my questions:

Can anybody confirm my findings?

If so, is this the expected behavior? Or should not UPDATE ... LIMIT on 
views work just like on tables?

Could this be a bug worth creating a ticket for?

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

Reply via email to