## 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
PRAGMA temp_store = 'MEMORY';
BEGIN;
.exit --2147483649
PRAGMA defer_foreign_keys = 0;
BEGIN EXCLUSIVE TRANSACTION;
-- COUNT({c}) FILTER (WHERE {c} IS NOT NULL)

.headers off
.cd bugs
CREATE TABLE main.main.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 DOUBLE,
  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);
WITH _m AS MATERIALIZED (SELECT * FROM T2) SELECT X, SUM(C) AS D, COUNT(*) AS E FROM _m GROUP BY X;
PRAGMA vdbe_listing = TRUE;
-- .save

PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE NOT NOT rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
INSERT OR FAIL INTO t1 VALUES (NULL, -4);
SELECT CUME_DIST() OVER (ORDER BY x ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
UPDATE t1 SET y = json_object('k', y) WHERE y IS NOT NULL;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
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');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
INSERT OR FAIL INTO t1 VALUES (NULL, -4);
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b',1.0), ('a','c',-1.0), ('b','d',0.0);
SELECT
COALESCE(a,'e') AS d,
COALESCE(b,'f') AS e,
SUM(c) AS f
FROM T
GROUP BY a,b;
SELECT CUME_DIST() OVER (ORDER BY x ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
UPDATE t1 SET y = json_object('k', y) WHERE y IS NOT NULL;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE /**/ sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
INSERT OR FAIL INTO t1 VALUES (NULL, -4);
SELECT CUME_DIST() OVER (ORDER BY x ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
UPDATE t1 SET y = json_object('k', y) WHERE y IS NOT NULL;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
INSERT OR FAIL INTO t1 VALUES (NULL, -4);
SELECT CUME_DIST() OVER (ORDER BY x ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
UPDATE t1 SET y = json_object('k', y) WHERE y IS NOT NULL;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
PRAGMA vdbe_listing = TRUE;
PRAGMA automatic_index = 1;
.headers on
ATTACH DATABASE ':memory:' AS aux37;
.exit NULL
SAVEPOINT sp4527;
CREATE TABLE t0(c0 AS(TYPEOF(c1)), c1);
INSERT INTO t0(c1) VALUES(unixepoch(-CAST(2147483646 AS CHARINT)));
CREATE TABLE t1(x AS (typeof(y)), y);
INSERT INTO t1 SELECT * FROM t0;
SELECT * FROM t1;
ALTER TABLE t0 DROP COLUMN c0;
SELECT GROUP_CONCAT(x) FROM t1;
VACUUM main;
RELEASE sp4527;
DETACH DATABASE aux37;
CREATE TRIGGER IF NOT EXISTS trg_t1_7606 AFTER INSERT ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t0 VALUES (NULL, 1) ON CONFLICT(c0) DO UPDATE SET c0 = excluded.c0, c1 = excluded.c1;
PRAGMA vdbe_addoptrace = NO;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
REINDEX;
ALTER TABLE t0 ADD COLUMN extra_5135 NATIVE CHARACTER(70)NVARCHAR(100) DEFAULT '';
UPDATE t0 SET c1 = '' WHERE rowid = 1;
INSERT OR FAIL INTO t1 VALUES (NULL, -4);
SELECT CUME_DIST() OVER (ORDER BY x ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
UPDATE t1 SET y = json_object('k', y) WHERE y IS NOT NULL;
SELECT TOTAL(c0) FROM t0;
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;
SELECT LEAD(A, 2, A) OVER (ORDER BY A) FROM T2;
SELECT * FROM T2 NATURAL JOIN t1;
DROP TRIGGER IF EXISTS t1;
INSERT INTO T2 SELECT * FROM T2;
DELETE FROM T1 WHERE 0;
WITH RECURSIVE tree(id, path) AS (VALUES(1, "/1") UNION ALL SELECT id+1, path || "/" || (id+1) FROM tree WHERE id<77) SELECT * FROM tree;
PRAGMA index_info(idx1);
ALTER TABLE T1 ADD COLUMN extra_9473 BIGINT DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE t1 RENAME TO t1_r6354;
REINDEX;
SELECT TOTAL(Y) FROM T2;
SELECT * FROM T1 AS a LEFT OUTER JOIN T2 AS b ON a.rowid = b.rowid;
WITH m AS MATERIALIZED (SELECT * FROM t0) SELECT m.c1 FROM m JOIN m AS m2 ON m.c1 = m2.c1;
ALTER TABLE T1 RENAME COLUMN X TO X_r4799;
UPDATE T1 SET X = CURRENT_TIMESTAMP WHERE 1;
SELECT COUNT(*) FILTER (WHERE c1 IS NOT NULL), SUM(rowid) FILTER (WHERE c1 > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c1) FILTER (WHERE c1 > 0 AND c1 < 100), COUNT(*) FILTER (WHERE typeof(c1) = "text") FROM t0;
PRAGMA vdbe_addoptrace = YES;
SELECT * FROM t1 WHERE y = (SELECT MAX(y) FROM t1 WHERE y = (SELECT MAX(y) FROM t1));
END TRANSACTION;
SELECT COUNT(*) FILTER (WHERE x IS NOT NULL), SUM(rowid) FILTER (WHERE x > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(x) FILTER (WHERE x > 0 AND x < 100), COUNT(*) FILTER (WHERE typeof(x) = "text") FROM t1;
SELECT NTILE(0) OVER (ORDER BY A GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T2;
WITH cte AS (SELECT A, LEAD(A) OVER (ORDER BY A) AS nxt FROM T1) SELECT * FROM cte;
SELECT COUNT(*) FROM T1;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T2_8324 ON T2(lower(Y)) WHERE Y IS NOT NULL;
INSERT INTO t1 SELECT * FROM t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T2_4702 AS SELECT Y FROM T2;
PRAGMA fullsync = ON;
VACUUM;
VACUUM main;
DELETE FROM T1 WHERE X > (SELECT AVG(X) FROM T1) RETURNING *;
INSERT INTO T2 VALUES (1, 1) ON CONFLICT(A) DO UPDATE SET A = excluded.A, Y = excluded.Y;
VACUUM;
REINDEX;
VACUUM main;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<65) SELECT COUNT(*) FROM cnt;
INSERT INTO T1 VALUES (NULL, NULL);
SELECT COUNT(*) FILTER (WHERE c1 IS NOT NULL), SUM(rowid) FILTER (WHERE c1 > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c1) FILTER (WHERE c1 > 0 AND c1 < 100), COUNT(*) FILTER (WHERE typeof(c1) = "text") FROM t0;
ALTER TABLE t1 RENAME TO t1_r5483;
ANALYZE;
SELECT SUM(X) FROM T1;
VACUUM main;
ALTER TABLE t0 RENAME COLUMN c1 TO c1_r2788;
VACUUM main;
SELECT COUNT(c0) OVER (ORDER BY c0 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t0;
COMMIT;
WITH a AS (SELECT * FROM T WHERE a IS NOT NULL), b AS (SELECT * FROM a WHERE a > 0), c AS (SELECT * FROM b LIMIT 10) SELECT * FROM c;
UPDATE t0 SET c1 = json_object('k', c1) WHERE c1 BETWEEN 0 AND 100;
ALTER TABLE T1 ADD COLUMN extra_2634 INTEGER;
```

## Actual output

```sql
SQLite version 3.39.0 2022-05-10 23:28:12
Enter ".help" for usage hints.
sqlite> sqlite> sqlite>
```

## Expectation

```sql
SQLite version 3.51.1 2025-11-28 17:28:25
Enter ".help" for usage hints.
sqlite> sqlite> sqlite>
```

## Flag

```
-interactive
```

