On 2015-10-11 05:23 PM, E.Pasma wrote:
> 11 okt 2015, om 15:27, R.Smith:
>>
>> On 2015-10-11 03:14 PM, E.Pasma wrote:
>>> Hello,
>>>
>>> One of the expected changes in 3..9.0 is:
>>> A view may now reference undefined tables and functions when 
>>> initially created. Missing tables and functions are reported when 
>>> the VIEW is used in a query.
>>> I could not resist trying a recursive view like in a CTE:
>>>
>>> SQLite version 3.8.12 2015-10-07 13:24:27
>>> create view v as select 1 as c union all select c+1 from v where c<10;
>>> select c from v;
>>> Error: view v is circularly defined
>>>
>>> So this is clearly not intended.
>>
>> You cannot reference a View within itself - this is what circularly 
>> means. This is very different to being able to reference a table that 
>> doesn't exist yet.
>
>
> That was only meant as an introduction. My only real point is that the 
> particular error is not always raised.
> Here is a more to the point example:
>
> SQLite version 3.8.12 2015-10-07 13:24:27
> Enter ".help" for usage hints.
> Connected to a transient in-memory database.
> Use ".open FILENAME" to reopen on a persistent database.
> sqlite> create view v as select c+1 from v;
> sqlite> select *from v;
> Error: view v is circularly defined
> sqlite> create view v2(c) as select c+1 from v2;
> sqlite> select *from v2;
> Segmentation fault
> $
>
> Sorry for being too verbose in the original mail.

Apologies, please ignore previous - I realised afterward it is the 
segfault that is the problem, not the reason for the error.

Reply via email to