I've encountered the following changed behavior (which I believe is a bug).  
The 
following script works at 3.7.15.2 but fails at 3.6.16 beta:

create table qa_data_edit (str_col text,int_col integer,rowidcol integer);
insert into qa_data_edit values ('this',1000,1); 
insert into qa_data_edit values ('that',3000,2); 
create view qa_data_edit_evw as select str_col,int_col,rowidcol from 
qa_data_edit; 

create trigger qa_data_edit_view_update instead of update on qa_data_edit_evw 
BEGIN
  update or replace qa_data_edit
  set str_col = new.str_col,
      int_col = new.int_col
  where rowidcol = old.rowidcol;
END;
select * from qa_data_edit;
update main.qa_data_edit_evw
set str_col = 'fred', 
    int_col = 5000
where main.qa_data_edit_evw.rowidcol = 1; 
select * from qa_data_edit;

Output:

SQLite version 3.7.16 2013-03-06 01:55:27 
Enter ".help" for instructions 
Enter SQL statements terminated with a ";"
sqlite> .read test.sql
this|1000|1
that|3000|2
Error: near line 17: no such column: main.qa_data_edit_evw.rowidcol
this|1000|1
that|3000|2

SQLite version 3.7.15.2 2013-01-09 11:53:05 
Enter ".help" for instructions 
Enter SQL statements terminated with a ";"
sqlite> .read test.sql
this|1000|1
that|3000|2
fred|5000|1
that|3000|2

Using an unqualified ROWIDCOL in the update causes the error to go away.  
However, database.table.column is a legal expression element according the the 
syntax diagrams.

Tested on Windows XP and Solaris 9.

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

Reply via email to