## 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
BEGIN EXCLUSIVE TRANSACTION;
.log stdout
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (soundex('123'),'a',40.5,-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE ABS(c) > 5 AND ABS(d) > 5;
SELECT * FROM T;

SELECT COUNT(*) FROM T;
SELECT * FROM T AS a LEFT OUTER JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T VALUES (NULL, NULL, NULL, NULL);
END TRANSACTION;
SELECT d FROM T INTERSECT SELECT d FROM (SELECT * FROM T) AS sub;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T) RETURNING *;
BEGIN EXCLUSIVE TRANSACTION;
.log stdout
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (soundex('123'),'a',40.5,-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE ABS(c) > 5 AND ABS(d) > 5;
SELECT * FROM T;

SELECT COUNT(*) FROM T;
SELECT * FROM T AS a LEFT OUTER JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T VALUES (NULL, NULL, NULL, NULL);
END TRANSACTION;
SELECT d FROM T INTERSECT SELECT d FROM (SELECT * FROM T) AS sub;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T) RETURNING *;
BEGIN EXCLUSIVE TRANSACTION;
.log stdout
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (soundex('123'),'a',40.5,-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE ABS(c) > 5 AND ABS(d) > 5;
SELECT * FROM T;

SELECT COUNT(*) FROM T;
SELECT * FROM T AS a LEFT OUTER JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T VALUES (NULL, NULL, NULL, NULL);
END TRANSACTION;
SELECT d FROM T INTERSECT SELECT d FROM (SELECT * FROM T) AS sub;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T) RETURNING *;
BEGIN EXCLUSIVE TRANSACTION;
.log stdout
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (soundex('123'),'a',40.5,-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE ABS(c) > 5 AND ABS(d) > 5;
SELECT * FROM T;

SELECT COUNT(*) FROM T;
SELECT * FROM T AS a LEFT OUTER JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T VALUES (NULL, NULL, NULL, NULL);
END TRANSACTION;
SELECT d FROM T INTERSECT SELECT d FROM (SELECT * FROM T) AS sub;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T) RETURNING *;
BEGIN EXCLUSIVE TRANSACTION;
.log stdout
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (soundex('123'),'a',40.5,-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE ABS(c) > 5 AND ABS(d) > 5;
SELECT * FROM T;

SELECT COUNT(*) FROM T;
SELECT * FROM T AS a LEFT OUTER JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T VALUES (NULL, NULL, NULL, NULL);
END TRANSACTION;
SELECT d FROM T INTERSECT SELECT d FROM (SELECT * FROM T) AS sub;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T) RETURNING *;

ALTER TABLE T ADD COLUMN extra_2438 BOOLEAN DEFAULT (random());
```

## Actual output

```sql
3.39.0 2022-05-10 23:28:12 764b71267e0b31ff7eaf2a0def7526a1a02dce4d5b456dea060d97ed342ealt1
```

## Expectation

```sql
3.51.1 2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88 (64-bit)
```

## Flag

```
-version
```

