## 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 IMMEDIATE;
BEGIN IMMEDIATE;
PRAGMA journal_size_limit;
PRAGMA wal_checkpoint('' || ('PASSIVE'));
PRAGMA table_list("users");
.fullschema --indent -1
CREATE TABLE x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

ALTER TABLE tempx DROP COLUMN a;
ALTER TABLE x RENAME TO x_r8708;
END;
ALTER TABLE x RENAME  COLUMN a TO a_r1024;

SELECT COUNT(*) FROM tempx;
BEGIN IMMEDIATE;
PRAGMA journal_size_limit;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA table_list("users");
.fullschema --indent -1
CREATE TABLE x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

ALTER TABLE tempx DROP COLUMN a;
ALTER TABLE x RENAME TO x_r8708;
END;
ALTER TABLE x RENAME  COLUMN a TO a_r1024;

SELECT COUNT(*) FROM tempx;
BEGIN IMMEDIATE;
PRAGMA journal_size_limit;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA table_list("users");
.fullschema --indent -1
CREATE TABLE x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

ALTER TABLE tempx DROP COLUMN a;
ALTER TABLE x RENAME TO x_r8708;
END;
ALTER TABLE x RENAME  COLUMN a TO a_r1024;

SELECT COUNT(*) FROM tempx;
BEGIN IMMEDIATE;
PRAGMA journal_size_limit;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA table_list("users");
.fullschema --indent -1
CREATE TABLE x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

ALTER TABLE tempx DROP COLUMN a;
ALTER TABLE x RENAME TO x_r8708;
END;
ALTER TABLE x RENAME  COLUMN a TO a_r1024;

SELECT COUNT(*) FROM tempx;
BEGIN IMMEDIATE;
PRAGMA journal_size_limit;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA table_list("users");
.fullschema --indent -1
CREATE TABLE x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

ALTER TABLE tempx DROP COLUMN a;
ALTER TABLE x RENAME TO x_r8708;
END;
ALTER TABLE x RENAME  COLUMN a TO a_r1024;

SELECT COUNT(*) FROM tempx;
BEGIN IMMEDIATE;
PRAGMA journal_size_limit;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA table_list("users");
.fullschema --indent -1
CREATE TABLE x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

ALTER TABLE tempx DROP COLUMN a;
ALTER TABLE x RENAME TO x_r8708;
END;
ALTER TABLE x RENAME  COLUMN a TO a_r1024;

SELECT COUNT(*) FROM tempx;
BEGIN IMMEDIATE;
PRAGMA journal_size_limit;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA table_list("users");
.fullschema --indent -1
CREATE TABLE x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

ALTER TABLE tempx DROP COLUMN a;
ALTER TABLE x RENAME TO x_r8708;
END;
ALTER TABLE x RENAME  COLUMN a TO a_r1024;

SELECT COUNT(*) FROM tempx;
BEGIN IMMEDIATE;
PRAGMA journal_size_limit;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA table_list("users");
.fullschema --indent -1
CREATE TABLE x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

ALTER TABLE tempx DROP COLUMN a;
ALTER TABLE x RENAME TO x_r8708;
END;
ALTER TABLE x RENAME  COLUMN a TO a_r1024;

SELECT COUNT(*) FROM tempx;
BEGIN IMMEDIATE;
PRAGMA journal_size_limit;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA table_list("users");
.fullschema --indent -1
CREATE TABLE x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

ALTER TABLE tempx DROP COLUMN a;
ALTER TABLE x RENAME TO x_r8708;
END;
ALTER TABLE x RENAME  COLUMN a TO a_r1024;

SELECT COUNT(*) FROM tempx;
BEGIN IMMEDIATE;
PRAGMA journal_size_limit;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA table_list("users");
.fullschema --indent -1
CREATE TABLE x(id integer primary key, a TEXT NULL);
INSERT INTO x (a) VALUES ('first');
CREATE TABLE tempx(id integer primary key, a TEXT NULL);
INSERT INTO tempx (a) VALUES ('t-first');
CREATE VIEW tv1 AS SELECT x.id, tx.id FROM x JOIN tempx tx ON tx.id=x.id;
CREATE VIEW tv1b AS SELECT x.id, tx.id FROM x JOIN tempx tx on tx.id=x.id;
CREATE VIEW tv2 AS SELECT * FROM tv1 UNION SELECT * FROM tv1b;
SELECT * FROM tv2;

ALTER TABLE tempx DROP COLUMN a;
ALTER TABLE x RENAME TO x_r8708;
END;
ALTER TABLE x RENAME  COLUMN a TO a_r1024;

SELECT COUNT(*) FROM tempx;

SELECT * FROM tempx AS a RIGHT OUTER JOIN tempx AS b ON a.rowid = b.rowid;
ROLLBACK;
SELECT * FROM tempx;
WITH cte AS (SELECT id, ROW_NUMBER() OVER (ORDER BY id) AS rn FROM tempx) SELECT * FROM cte WHERE rn <= CAST(atanh(5) AS REAL);
ALTER TABLE x ADD COLUMN extra_1346 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
SELECT TOTAL(id) OVER (PARTITION BY id ORDER BY id) FROM tempx;
INSERT INTO tempx DEFAULT VALUES;
```

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

