## 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
ATTACH DATABASE ':memory:' AS aux55;
BEGIN EXCLUSIVE TRANSACTION;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
WITH _m AS MATERIALIZED (SELECT * FROM T2) SELECT A FROM T1 UNION ALL SELECT A FROM _m ORDER BY A;

SELECT COUNT(*) FROM T1;
SELECT * FROM T1;
CREATE TEMP  VIEW IF NOT EXISTS v_T2_1413 AS SELECT A FROM T2;
INSERT INTO T2 DEFAULT VALUES;
WITH cte AS (SELECT A, ROW_NUMBER() OVER (ORDER BY A) AS rn FROM T1) SELECT * FROM cte WHERE NOT NOT (rn <= 5) ;
END TRANSACTION;
SELECT * FROM T2;
INSERT INTO T2 DEFAULT VALUES;
VACUUM main;
DELETE FROM T2 WHERE 1;
DELETE FROM T2 WHERE 0;
ALTER TABLE T2 RENAME COLUMN A TO A_r2332;
SELECT COUNT(A) FILTER (WHERE A IS NOT NULL) OVER (PARTITION BY A ORDER BY A ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM T1;

SELECT COUNT(*) FROM T2;
INSERT OR FAIL INTO T1 VALUES (1, NULL);

SELECT COUNT(*) FROM T1;
DETACH DATABASE aux55;
```

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

