## 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
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (1,'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;
.cd bugs
PRAGMA fullsync = min(NULL, 0);
PRAGMA vdbe_trace = NO;
PRAGMA threads;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<31) SELECT * FROM cnt;
SELECT * FROM T AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
PRAGMA reverse_unordered_selects = NO;
SELECT * FROM T WHERE (B) IN (SELECT B FROM T);
CREATE  VIEW IF NOT EXISTS v_T_9540 AS SELECT A FROM T;
DELETE FROM T WHERE 0 RETURNING *;
.cd bugs
PRAGMA fullsync = min(NULL, 0);
PRAGMA vdbe_trace = NO;
PRAGMA threads;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<31) SELECT * FROM cnt;
SELECT * FROM T AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
PRAGMA reverse_unordered_selects = NO;
SELECT * FROM T WHERE (B) IN (SELECT B FROM T);
CREATE  VIEW IF NOT EXISTS v_T_9540 AS SELECT A FROM T;
DELETE FROM T WHERE 0 RETURNING *;
.cd bugs
PRAGMA fullsync = min(NULL, 0);
PRAGMA vdbe_trace = NO;
PRAGMA threads;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<31) SELECT * FROM cnt;
SELECT * FROM T AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
PRAGMA reverse_unordered_selects = NO;
SELECT * FROM T WHERE (B) IN (SELECT B FROM T);
CREATE  VIEW IF NOT EXISTS v_T_9540 AS SELECT A FROM T;
DELETE FROM T WHERE 0 RETURNING *;
.cd bugs
PRAGMA fullsync = min(NULL, 0);
PRAGMA vdbe_trace = NO;
PRAGMA threads;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<31) SELECT * FROM cnt;
SELECT * FROM T AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
PRAGMA reverse_unordered_selects = NO;
SELECT * FROM T WHERE (B) IN (SELECT B FROM T);
CREATE  VIEW IF NOT EXISTS v_T_9540 AS SELECT A FROM T;
DELETE FROM T WHERE 0 RETURNING *;
.cd bugs
PRAGMA fullsync = min(NULL, 0);
PRAGMA vdbe_trace = NO;
PRAGMA threads;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<31) SELECT * FROM cnt;
SELECT * FROM T AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
PRAGMA reverse_unordered_selects = NO;
SELECT * FROM T WHERE (B) IN (SELECT B FROM T);
CREATE  VIEW IF NOT EXISTS v_T_9540 AS SELECT A FROM T;
DELETE FROM T WHERE 0 RETURNING *;
.cd bugs
PRAGMA fullsync = min(NULL, 0);
PRAGMA vdbe_trace = NO;
PRAGMA threads;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<31) SELECT * FROM cnt;
SELECT * FROM T AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
PRAGMA reverse_unordered_selects = NO;
SELECT * FROM T WHERE (B) IN (SELECT B FROM T);
CREATE  VIEW IF NOT EXISTS v_T_9540 AS SELECT A FROM T;
DELETE FROM T WHERE 0 RETURNING *;
.cd bugs
PRAGMA fullsync = min(NULL, 0);
PRAGMA vdbe_trace = NO;
PRAGMA threads;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<31) SELECT * FROM cnt;
SELECT * FROM T AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
PRAGMA reverse_unordered_selects = NO;
SELECT * FROM T WHERE (B) IN (SELECT B FROM T);
CREATE  VIEW IF NOT EXISTS v_T_9540 AS SELECT A FROM T;
DELETE FROM T WHERE 0 RETURNING *;
.cd bugs
PRAGMA fullsync = min(NULL, 0);
PRAGMA vdbe_trace = NO;
PRAGMA threads;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<31) SELECT * FROM cnt;
SELECT * FROM T AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
PRAGMA reverse_unordered_selects = NO;
SELECT * FROM T WHERE (B) IN (SELECT B FROM T);
CREATE  VIEW IF NOT EXISTS v_T_9540 AS SELECT A FROM T;
DELETE FROM T WHERE 0 RETURNING *;
.cd bugs
PRAGMA fullsync = min(NULL, 0);
PRAGMA vdbe_trace = NO;
PRAGMA threads;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(10),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<31) SELECT * FROM cnt;
SELECT * FROM T AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
PRAGMA reverse_unordered_selects = NO;
SELECT * FROM T WHERE (B) IN (SELECT B FROM T);
CREATE  VIEW IF NOT EXISTS v_T_9540 AS SELECT A FROM T;
DELETE FROM T WHERE 0 RETURNING *;

DELETE FROM T WHERE 0;
CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(30),
  C VARCHAR(30),
  PRIMARY KEY (A, B),
  UNIQUE (A, C)
);
INSERT INTO T VALUES ('a', 'p', 'x');
INSERT INTO T VALUES ('a', 'q', 'y');
INSERT INTO T VALUES ('b', 'p', 'z');
INSERT INTO T VALUES ('c', 'r', 'w');
INSERT INTO T VALUES ('d', 's', 'v');
SELECT A, COUNT(DISTINCT B) AS D FROM T GROUP BY A HAVING COUNT(DISTINCT B) >= 1;
INSERT INTO T DEFAULT VALUES;
VACUUM main;
ALTER TABLE T DROP COLUMN A;
ALTER TABLE T RENAME TO T_r4243;
SELECT AVG(B) FROM T;
```

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

