## 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
SAVEPOINT sp5512;
PRAGMA defer_foreign_keys = NO;
.exit
BEGIN IMMEDIATE;
SAVEPOINT sp9113;
.clone
CREATE TABLE T1 (
  A VARCHAR((replace(json_array_insert(upper(('HeLLo' || '')), '$.arr[0]', time(json_quote(123))), 'a', 'b') + 0)) PRIMARY KEY,
  B VARCHAR(15) UNIQUE,
  C BIGINT
);
CREATE TABLE T2 (
  X VARCHAR(20) PRIMARY KEY,
  A VARCHAR(10),
  FOREIGN KEY (A) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('a', 'p', 9999999999999);
INSERT INTO T1 VALUES ('b', 'q', -9999999999999);
INSERT INTO T2 VALUES ('m', 'a');
INSERT INTO T2 VALUES ('n', 'b');
SELECT T2.X, T1.C FROM T2 INNER JOIN T1 ON T2.A IS T1.A WHERE T1.C > -1000000000000;
WITH cte AS (SELECT A FROM T1 UNION ALL SELECT A FROM T1) SELECT * FROM cte;
ANALYZE;
DELETE FROM T2 WHERE 1 RETURNING *;
ROLLBACK TO sp9113;
RELEASE sp9113;
DELETE FROM T2 WHERE 1 RETURNING *;
END TRANSACTION;
SELECT * FROM T2 WHERE A < (SELECT AVG(A) FROM T2);
SELECT * FROM T1 WHERE B IN (SELECT B FROM T1 WHERE B GLOB "*");
SELECT COUNT(*) FILTER (WHERE X IS NOT NULL), SUM(rowid) FILTER (WHERE X > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(X) FILTER (WHERE X > 0 AND X < 100), COUNT(*) FILTER (WHERE typeof(X) = "text") FROM T2;
SELECT * FROM T1 WHERE EXISTS (SELECT 1 FROM T1 WHERE 1 = 1);
WITH cte AS (SELECT * FROM T2) SELECT * FROM cte;
ANALYZE T1;
RELEASE sp5512;
```

## 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
```

