Bug report: strange error message in trigger
(1) By Zu-Ming Jiang (jiang446079653) on 2021-05-17 03:32:29 [source]
Hello,
I used my fuzzing tool to test sqlite of latest version, and found that it returned stange error message when processing a sql.
Test command:
rm test.db; ./sqlite3 test.db
It normally run when processing the first three SQL statements, and create the trigger successfully.
sqlite> create table t_sa (
...> c_muyat INTEGER NOT NULL,
...> c_d4u TEXT ,
...> c_lngdt TEXT NOT NULL,
...> c_c3v INTEGER ,
...> primary key(c_c3v),
...> unique(c_muyat),
...> check(1=1)
...> );
sqlite> create table t_k (
...> c_ak8 INTEGER ,
...> c_scig TEXT NOT NULL,
...> c_rcbc INTEGER ,
...> c_n07c5 INTEGER NOT NULL,
...> primary key(c_rcbc),
...> unique(c_rcbc)
...> );
sqlite> create trigger t_i4bwy after delete on t_sa
...> for each row
...> begin
...> delete from t_sa
...> where
...> (case when t_sa.c_d4u <> (
...> select
...> t_sa.c_lngdt as c0
...> from
...> t_k as ref_8
...> where t_sa.c_c3v IS NOT t_sa.c_muyat
...> window oamat7fzf as ( partition by t_sa.c_d4u order by t_sa.c_d4u,t_sa.c_d4u asc)) then t_sa.c_d4u else t_sa.c_d4u end
...> not like 'so8%pjs');
...> end;
When it process the fourth statement:
sqlite> alter table t_sa rename column c_muyat to c_dg;
It returns a error message:
Error: error in trigger t_i4bwy: no such column: t_sa.c_d4u
However, I do change the name of c_muyat instead of c_d4u. Maybe its error message is wrong.
If there is truly some problems in the trigger, I think it should returns error message when I creates the trigger, not when I alter the column name.