## Summary
<!--Explain briefly what goes wrong and explain why you believe this is a bug and not the intended behavior of SQLite (if it is not a crash).-->**No review yet**

## Minimized query

```sql
PRAGMA foreign_keys = 1;
PRAGMA empty_result_callbacks;
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(iif(-(-(0)), 1, 0, 1, 1),11);
INSERT INTO t1 VALUES(2,22);
INSERT INTO t1 WITH _m AS MATERIALIZED (SELECT * FROM t1) SELECT a+2, b+22 FROM _m;
INSERT INTO t1 SELECT a+4, b+44 FROM t1;
CREATE TABLE t2(c,d);
INSERT INTO t2 SELECT a, 900+b FROM t1;
PRAGMA automatic_index=ON;
SELECT b, d FROM t1 JOIN t2 ON a=c ORDER BY b;

PRAGMA temp_store_directory;
INSERT INTO t1 VALUES (NULL, NULL);
SELECT LAG(d, 2, 'default') OVER (PARTITION BY d	ORDER BY d) FROM t2;
PRAGMA parser_trace = 0;
UPDATE t1 SET b = json_object('k', b) RETURNING *;
INSERT INTO t1 DEFAULT VALUES;
DELETE FROM t1 WHERE a > (SELECT AVG(a) FROM t1) RETURNING *;
```

## Actual output

```sql
0
22|922
44|944
66|966
88|988
default
default
default
default
2|{"k":22}
4|{"k":44}
6|{"k":66}
8|{"k":88}
|{"k":null}
6|{"k":66}
8|{"k":88}
```

## Expectation

```sql

```

## Flag

```

```

