## 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
.log ON
.restore
PRAGMA defer_foreign_keys = YES;
PRAGMA query_only = TRUE;
PRAGMA full_column_names = TRUE;
.separator >_<
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(strftime('%s', x'3cf3877c0e24a245b965'),'abc'),(234,'def'),(234,'ghi'),(345,'jkl');
CREATE TABLE t2(x,y);
INSERT INTO t2 VALUES(987,'zyx'),(654,'wvu'),(987,'rqp');
SELECT *, '|' FROM t1, t2 WHERE a=234 OR x=987 ORDER BY +b;
SELECT *, '|' FROM t1, t2 WHERE a=234 AND x=555;
SELECT *, '|' FROM t1 LEFT JOIN t2 ON a=234 AND x=555;

ALTER TABLE t1 ADD COLUMN extra_6649 VARCHAR(255) UNIQUE;
INSERT INTO t1 SELECT * FROM t1;
.restore
PRAGMA defer_foreign_keys = YES;
PRAGMA query_only = TRUE;
PRAGMA full_column_names = TRUE;
.separator >_<
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(strftime('%s', 123),'abc'),(234,'def'),(234,'ghi'),(345,'jkl');
CREATE TABLE t2(x,y);
INSERT INTO t2 VALUES(987,'zyx'),(654,'wvu'),(987,'rqp');
SELECT *, '|' FROM t1, t2 WHERE a=234 OR x=987 ORDER BY +b;
SELECT *, '|' FROM t1, t2 WHERE a=234 AND x=555;
SELECT *, '|' FROM t1 LEFT JOIN t2 ON a=234 AND x=555;

ALTER TABLE t1 ADD COLUMN extra_6649 VARCHAR(255) UNIQUE;
INSERT INTO t1 SELECT * FROM t1;
.restore
PRAGMA defer_foreign_keys = YES;
PRAGMA query_only = TRUE;
PRAGMA full_column_names = TRUE;
.separator >_<
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(strftime('%s', 123),'abc'),(234,'def'),(234,'ghi'),(345,'jkl');
CREATE TABLE t2(x,y);
INSERT INTO t2 VALUES(987,'zyx'),(654,'wvu'),(987,'rqp');
SELECT *, '|' FROM t1, t2 WHERE a=234 OR x=987 ORDER BY +b;
SELECT *, '|' FROM t1, t2 WHERE a=234 AND x=555;
SELECT *, '|' FROM t1 LEFT JOIN t2 ON a=234 AND x=555;

ALTER TABLE t1 ADD COLUMN extra_6649 VARCHAR(255) UNIQUE;
INSERT INTO t1 SELECT * FROM t1;
.restore
PRAGMA defer_foreign_keys = YES;
PRAGMA query_only = TRUE;
PRAGMA full_column_names = TRUE;
.separator >_<
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(strftime('%s', 123),'abc'),(234,'def'),(234,'ghi'),(345,'jkl');
CREATE TABLE t2(x,y);
INSERT INTO t2 VALUES(987,'zyx'),(654,'wvu'),(987,'rqp');
SELECT *, '|' FROM t1, t2 WHERE a=234 OR x=987 ORDER BY +b;
SELECT *, '|' FROM t1, t2 WHERE a=234 AND x=555;
SELECT *, '|' FROM t1 LEFT JOIN t2 ON a=234 AND x=555;

ALTER TABLE t1 ADD COLUMN extra_6649 VARCHAR(255) UNIQUE;
INSERT INTO t1 SELECT * FROM t1;

.log ON
.restore
PRAGMA defer_foreign_keys = YES;
PRAGMA query_only = TRUE;
PRAGMA full_column_names = TRUE;
.separator >_<
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(strftime('%s', x'3cf3877c0e24a245b965'),'abc'),(234,'def'),(234,'ghi'),(345,'jkl');
CREATE TABLE t2(x,y);
INSERT INTO t2 VALUES(987,'zyx'),(654,'wvu'),(987,'rqp');
SELECT *, '|' FROM t1, t2 WHERE a=234 OR x=987 ORDER BY +b;
SELECT *, '|' FROM t1, t2 WHERE a=234 AND x=555;
SELECT *, '|' FROM t1 LEFT JOIN t2 ON a=234 AND x=555;

ALTER TABLE t1 ADD COLUMN extra_6649 VARCHAR(255) UNIQUE;
INSERT INTO t1 SELECT * FROM t1;
.restore
PRAGMA defer_foreign_keys = YES;
PRAGMA query_only = TRUE;
PRAGMA full_column_names = TRUE;
.separator >_<
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(strftime('%s', 123),'abc'),(234,'def'),(234,'ghi'),(345,'jkl');
CREATE TABLE t2(x,y);
INSERT INTO t2 VALUES(987,'zyx'),(654,'wvu'),(987,'rqp');
SELECT *, '|' FROM t1, t2 WHERE a=234 OR x=987 ORDER BY +b;
SELECT *, '|' FROM t1, t2 WHERE a=234 AND x=555;
SELECT *, '|' FROM t1 LEFT JOIN t2 ON a=234 AND x=555;

ALTER TABLE t1 ADD COLUMN extra_6649 VARCHAR(255) UNIQUE;
INSERT INTO t1 SELECT * FROM t1;
.restore
PRAGMA defer_foreign_keys = YES;
PRAGMA query_only = TRUE;
PRAGMA full_column_names = TRUE;
.separator >_<
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(strftime('%s', 123),'abc'),(234,'def'),(234,'ghi'),(345,'jkl');
CREATE TABLE t2(x,y);
INSERT INTO t2 VALUES(987,'zyx'),(654,'wvu'),(987,'rqp');
SELECT *, '|' FROM t1, t2 WHERE a=234 OR x=987 ORDER BY +b;
SELECT *, '|' FROM t1, t2 WHERE a=234 AND x=555;
SELECT *, '|' FROM t1 LEFT JOIN t2 ON a=234 AND x=555;

ALTER TABLE t1 ADD COLUMN extra_6649 VARCHAR(255) UNIQUE;
INSERT INTO t1 SELECT * FROM t1;
.restore
PRAGMA defer_foreign_keys = YES;
PRAGMA query_only = TRUE;
PRAGMA full_column_names = TRUE;
.separator >_<
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(strftime('%s', 123),'abc'),(234,'def'),(234,'ghi'),(345,'jkl');
CREATE TABLE t2(x,y);
INSERT INTO t2 VALUES(987,'zyx'),(654,'wvu'),(987,'rqp');
SELECT *, '|' FROM t1, t2 WHERE a=234 OR x=987 ORDER BY +b;
SELECT *, '|' FROM t1, t2 WHERE a=234 AND x=555;
SELECT *, '|' FROM t1 LEFT JOIN t2 ON a=234 AND x=555;

ALTER TABLE t1 ADD COLUMN extra_6649 VARCHAR(255) UNIQUE;
INSERT INTO t1 SELECT * FROM t1;


```

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

