## 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 sp2891;
SAVEPOINT sp3175;
SAVEPOINT sp7170;
-- NTILE(0)

PRAGMA empty_result_callbacks = TRUE;
SAVEPOINT sp7793;
PRAGMA reverse_unordered_selects = -9223372036854775808;
.quit
PRAGMA writable_schema IS NOT NO;
BEGIN IMMEDIATE TRANSACTION;
PRAGMA cache_size = -strftime('%s', CAST(2000 AS CHAR(10)));
ATTACH DATABASE ':memory:' AS aux23;
PRAGMA empty_result_callbacks = ON;
SAVEPOINT sp2455;
CREATE TABLE T1 (
  a DOUBLE PRECISION,
  b REAL
);
CREATE TABLE T2 (
  a INTEGER,
  b REAL
);
INSERT INTO T1 VALUES (1,1.0);
INSERT INTO T2 VALUES (1,-1.0),(2,9e999);
INSERT AND REPLACE INTO T1
SELECT * FROM T2;
SELECT * FROM T1;
.show
ATTACH DATABASE ':memory:' AS aux46;
create temp table `t1`(x);
insert into t1 values('amx');
insert into t1 values('anx');
insert into t1 values('amy');
insert /* -vfs unix */ into t1 values('bmy');
CREATE TABLE T1 (
  A VARCHAR(20) PRIMARY KEY,
  X VARCHAR(10) UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(20) PRIMARY KEY,
  Y VARCHAR(10) UNIQUE
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
INSERT INTO T2 VALUES ('c', 'l');
SELECT A FROM T1 INTERSECT SELECT A FROM T2;
select * from t1 WHERE NOT x like 'a__' intersect select * from t1 where x like '_m_' intersect select * from t1 where x like '__x';
SELECT TOTAL(x) FROM t1;
SELECT * FROM t1 AS a LEFT JOIN t1 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux46;
INSERT INTO t1 SELECT * FROM t1;
WITH a AS (SELECT x FROM t1), b AS (SELECT COUNT(*) AS cnt FROM a) SELECT * FROM b;
CREATE  VIEW IF NOT EXISTS v_t1_5880 AS SELECT x FROM t1;
DROP INDEX IF EXISTS t1;
INSERT INTO t1 VALUES (NULL);
REINDEX t1;
INSERT INTO t1 SELECT * FROM t1;
SELECT COUNT(x) FROM t1;
SELECT * FROM t1 t1 JOIN (SELECT * FROM t1) AS sub ON t1.x = sub.x;
REINDEX;
INSERT OR ABORT INTO t1 VALUES (-CAST(9 AS DATE));
SELECT MIN(x) FILTER (WHERE x IS NOT NULL) OVER (ORDER BY x ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;
ALTER TABLE t1 RENAME TO t1_r5893;
INSERT INTO t1 SELECT * FROM t1;
ALTER TABLE T2 ADD COLUMN extra_1904 DATETIME;
RELEASE sp2455;
ANALYZE;
VACUUM;
SELECT * FROM t1 AS a LEFT JOIN T2 AS b ON a.rowid = b.rowid;
CREATE TRIGGER IF NOT EXISTS trg_T1_9347 AFTER uPdaTE ON T1 FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
VACUUM;
SELECT COUNT(a) FILTER (WHERE NULL) OVER (PARTITION BY a ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T2;
DETACH DATABASE aux23;
INSERT INTO T2 DEFAULT VALUES;
DROP VIEW IF EXISTS t1;
SELECT * FROM t1 NATURAL JOIN T1;
CREATE TABLE T1 (
  a INTEGER,
  b REAL
);
CREATE TABLE T2 (
  a INTEGER,
  b REAL
);
INSERT INTO T1 VALUES (1,1.0);
INSERT INTO T2 VALUES (1,-1.0),(2,9e999);
INSERT OR REPLACE INTO T1
SELECT * FROM T2;
SELECT * FROM T1;
END;
SELECT * FROM t1;
INSERT INTO T1 VALUES (NULL, NULL);
INSERT INTO T2 VALUES (NULL, NULL);
INSERT INTO T2 DEFAULT VALUES;
SELECT x FROM t1 EXCEPT SELECT x FROM (SELECT * FROM t1) AS sub;
ANALYZE T2;
SELECT ROW_NUMBER() OVER (PARTITION BY b ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM T1;
INSERT OR REPLACE INTO t1 VALUES (-8);
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_8548 ON t1(x COLLATE NOCASE) WHERE x IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_t1_9457 BEFORE INSERT ON t1 FOR EACH ROW BEGIN INSERT INTO t1(x) VALUES (NULL); END;
INSERT INTO T2 VALUES (NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
DELETE FROM t1 WHERE +rowid = 54;
INSERT INTO T1 VALUES (1, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
SELECT * FROM T1;
WITH a AS NOT MATERIALIZED (SELECT * FROM t1), b AS MATERIALIZED (SELECT * FROM a) SELECT * FROM b;
CREATE TEMP  VIEW IF /* PRAGMA read_uncommitted = OFF; */ NOT EXISTS v_T2_3416 AS SELECT a FROM T2;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_2725 ON t1(x) WHERE x > 0;
SELECT LAG(x, 1) OVER (PARTITION BY x ORDER BY x RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM T2;
CREATE TABLE T (
  A VARCHAR(15) PRIMARY KEY,
  B VARCHAR(30) NOT NULL,
  C BIGINT UNIQUE
);
INSERT INTO T VALUES ('a', 'x', -9223372036854775808);
INSERT INTO T VALUES ('b', 'y', -1000000);
INSERT INTO T VALUES ('c', 'y', 0);
INSERT INTO T VALUES ('d', 'y', 42);
INSERT INTO T VALUES ('e', 'x', 9223372036854775807);
INSERT INTO T VALUES ('f', 'z', 2147483648);
SELECT * FROM T WHERE C > 0 ORDER BY C DESC;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM T1;
INSERT INTO T1 VALUES (NULL, NULL);
ROLLBACK TO sp7793;
RELEASE sp7793;
SELECT AVG(B) FROM T;
DROP TABLE IF EXISTS T2;
WITH a AS (SELECT a FROM T2), b AS (SELECT a FROM a), c AS (SELECT a FROM b) SELECT * FROM c;
SELECT * FROM T1 WHERE a > (SELECT MAX(a) FROM T1);
SELECT FIRST_VALUE(a) OVER (PARTITION BY a ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T2;
RELEASE sp7170;
CREATE TABLE T (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
CREATE TABLE T1 (
  A VARCHAR(15) PRIMARY KEY,
  B VARCHAR(30) NOT NULL UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(10) PRIMARY KEY,
  X VARCHAR(15) NOT NULL,
  C BIGINT,
  FOREIGN KEY (X) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('p', 'x');
INSERT INTO T1 VALUES ('q', 'y');
INSERT INTO T2 VALUES ('a', 'p', 9223372036854775807);
INSERT INTO T2 VALUES ('b', 'q', -9223372036854775808);
SELECT X, SUM(C) AS D, COUNT(*) AS E FROM T2 GROUP BY X;
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
CREATE TEMP  VIEW IF NOT EXISTS v_T1_1990 AS SELECT b FROM T1;
INSERT INTO T VALUES (1, 'x', 'x') ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;
SELECT * FROM T1 AS a RIGHT JOIN T AS b ON a.rowid = b.rowid;
SELECT * FROM T2 AS a RIGHT OUTER JOIN T AS b ON a.rowid = b.rowid;
ALTER TABLE T1 ADD COLUMN extra_5061 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT (abs(random()) % 1000);
INSERT INTO t1 DEFAULT VALUES;
DELETE FROM T1 WHERE b > (SELECT AVG(b) FROM T1) RETURNING *;
VACUUM;
REINDEX T;
INSERT OR REPLACE INTO T2 VALUES (7, 'x', '');
SELECT COUNT(*) FILTER (WHERE B IS NOT NULL), SUM(rowid) FILTER (WHERE B > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(B) FILTER (WHERE B > 0 AND B < 100), COUNT(*) FILTER (WHERE typeof(B) = "text") FROM T;
INSERT INTO T2 SELECT * FROM T2;
INSERT OR REPLACE INTO T2 VALUES (-2, 'x', 0);
CREATE TRIGGER IF NOT EXISTS trg_T_3874 BEFORE INSERT ON T BEGIN SELECT RAISE(FAIL, 'no'); END;
ROLLBACK TRANSACTION TO SAVEPOINT sp3175;
RELEASE SAVEPOINT sp3175;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (1,2.0,10.5), (1,-3.5,20.25), (2,9e999,-1.0);
WITH d AS (SELECT a,SUM(b*c) AS e FROM T GROUP BY a) SELECT * FROM d;
UPDATE t1 SET x = 'x' WHERE rowid = 1 RETURNING *;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
INSERT INTO t1 DEFAULT VALUES;
RELEASE sp2891;
```

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

