Bug report: strange error message in cte and window function
(1) By Zu-Ming Jiang (jiang446079653) on 2021-05-17 07:30:44 [source]
I used my fuzzing tool to test sqlite of latest version, and found that it returned stange error message when processing a sql.
rm test.db; ./sqlite3 test.db < fuzz.sql
The content of fuzz.sql:
create table t_sa (
c_muyat INTEGER NOT NULL,
c_d4u TEXT ,
c_lngdt TEXT NOT NULL,
c_c3v INTEGER ,
cte_0 AS (select
ref_0.c_muyat as c1
t_sa as ref_0
LAG(cast(cast(null as INTEGER) as INTEGER)) over gen8fjew as c0
t_sa as ref_5
window gen8fjew as ( partition by (select c1 from cte_0 order by c1 limit 1 offset 4));
The returned error message is:
Error: near line 11: no such table: cte_0
It seems to be a bug since cte_0 has been created.
I think you're right - this is a bug. Now fixed, along with the triggers one that you posted, here:
Thanks for finding and reporting all these!
Hi Dan. Just curious regarding this commit:
The .test and .tcl files seem to overlap a lot, with one being a superset
of the other, with expected rows added to it. Can you please explain why that is?
(there's also a
breakpoint added somewhere, as another difference).