SQLite Forum

View with CTE no longer works
Login

View with CTE no longer works

(1) By José Miguel SA (sio2sio2) on 2021-08-30 18:00:18 [link] [source]

I have recently upgraded my Debian and sqlite3 was automatically upgraded to version 3.36.0. In previous versions this example works:

CREATE TABLE Foobar ( id INTEGER PRIMARY KEY );
INSERT INTO Foobar VALUES (1);

-- "Factor" is not yet defined
CREATE VIEW FoobarV AS
   SELECT id*(SELECT * FROM Factor)
   FROM Foobar;

-- But now I define it
WITH Factor AS (SELECT 8)
   SELECT * FROM FoobarV;

But now it doesn't:

Error: near line 9: no such table: main.Factor

Is it a bug?

(2) By Dan Kennedy (dan) on 2021-08-30 18:34:07 in reply to 1 [source]

The behaviour of earlier versions was deemed a bug and was fixed here:

https://sqlite.org/src/info/f7dcc4b5

Dan.