SQLite Forum

Timeline
Login

1 forum post by user sbinder

2021-03-29
21:41 Post: Crash when a RETURNING clause refers to a table in UPDATE FROM (artifact: cdc28fec1a user: sbinder)

I'm using SQLite version 3.35.3. In an attempt to understand which columns a RETURNING clause can refer to, I tried to combine RETURNING with a FROM clause in an UPDATE statement:

CREATE TABLE a (id INTEGER NOT NULL PRIMARY KEY);
UPDATE a SET id = a.id + 1 FROM (SELECT * FROM a) AS old RETURNING old.*;

Running the update statement crashes sqlite.