## 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
.filectrl main TRUNCATE x'f66a2152e6'
PRAGMA cell_size_check = YES;
ATTACH DATABASE ':memory:' AS aux0;
PRAGMA cell_size_check;
PRAGMA function_list;
ATTACH DATABASE ':memory:' AS aux57;
PRAGMA parser_trace = NO;
ATTACH DATABASE ':memory:' AS aux99;
.print
BEGIN DEFERRED;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (jsonb_array(ifnull(sign(x'980a5244992c94686b082be96979'), timediff(x'f3542de8ff3bff1eddeb', unistr('\\')))),typeof(NULL),jsonb(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;
SAVEPOINT sp9028;
.width
ATTACH DATABASE '' || (':memory:') AS aux68;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d
INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', CAST(ltrim('xxxhelloxxx', 'x') AS TEXT), CAST(100 -> '$[0]' AS DOUB));
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', 30, 300);

CREATE INDEX t1bc ON t1(b, c);

PRAGMA writable_schema = ON;

.imposter t1bc t2

SELECT * FROM t2;

SELECT b, c FROM t1 ORDER BY b, c;

.quit
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), /* PRAGMA vdbe_debug = FALSE; */ (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
ANALYZE T;
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 OR b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM T;
DETACH DATABASE aux68;
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;
SELECT MIN(b) OVER (PARTITION BY b ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
UPDATE t1 SET d = '' WHERE 1;
INSERT OR ABORT INTO t1 VALUES (0, 0, NULL, 7);
ROLLBACK TRANSACTION TO SAVEPOINT sp9028;
RELEASE SAVEPOINT sp9028;
REINDEX T;
ALTER TABLE t1 DROP COLUMN b;
SELECT * FROM t1 AS a INNER JOIN T AS b ON a.rowid = b.rowid;

SELECT COUNT(*) FROM T;
SELECT SUM(b) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT STRING_AGG(b) FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_495 AS SELECT a FROM T;
END TRANSACTION;
INSERT INTO t1 SELECT * FROM t1;
DROP TABLE IF EXISTS t1;
DELETE FROM T WHERE rowid = 75 RETURNING *;
ALTER TABLE T ADD COLUMN extra_685 DECIMAL(10,5) NOT NULL DEFAULT 0;
ALTER TABLE T ADD COLUMN extra_8806 TEXT COLLATE RTRIM;
DETACH DATABASE aux99;
PRAGMA journal_size_limit;
SELECT * FROM T WHERE b = (SELECT MAX(b) FROM T WHERE b = (SELECT MAX(b) FROM T));
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_2068 ON t1(b COLLATE NOCASE) WHERE b > 0;
SELECT * FROM t1;
ALTER TABLE T ADD COLUMN extra_4370 INT2 COLLATE RTRIM;
VACUUM main;
SELECT * FROM t1 WHERE d <= ANY (SELECT d FROM t1);
ANALYZE T;
DETACH DATABASE aux57;
SELECT LEAD(b, 2) OVER (ORDER BY b RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM T;
DROP VIEW IF EXISTS t1;
SELECT * FROM T WHERE a IN (SELECT a FROM T t2 WHERE t2.a = T.a);
WITH RECURSIVE fib(a,b) AS (VALUES(1,1) UNION ALL SELECT b, a+b FROM fib WHERE b<1000) SELECT a FROM fib;
PRAGMA vdbe_trace = 1;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_5353 ON t1(d) WHERE d IS NOT NULL;
ALTER TABLE t1 RENAME COLUMN d TO d_r4876;
WITH cte AS (SELECT b FROM T INTERSECT SELECT b FROM T) SELECT * FROM cte;
INSERT INTO t1 DEFAULT VALUES;
DETACH DATABASE aux0;
VACUUM;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
SELECT * FROM T AS a FULL JOIN T AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN a;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);

SELECT COUNT(*) FROM T;
.filectrl main TRUNCATE x'f66a2152e6'
PRAGMA cell_size_check = YES;
ATTACH DATABASE ':memory:' AS aux0;
PRAGMA cell_size_check;
PRAGMA function_list;
ATTACH DATABASE ':memory:' AS aux57;
PRAGMA parser_trace = NO;
ATTACH DATABASE ':memory:' AS aux99;
.print
BEGIN DEFERRED;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (jsonb_array(ifnull(sign(x'980a5244992c94686b082be96979'), timediff(x'f3542de8ff3bff1eddeb', unistr('\\')))),typeof(NULL),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;
SAVEPOINT sp9028;
.width
ATTACH DATABASE '' || (':memory:') AS aux68;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d
INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', CAST(ltrim('xxxhelloxxx', 'x') AS TEXT), CAST(100 -> '$[0]' AS DOUB));
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', 30, 300);

CREATE INDEX t1bc ON t1(b, c);

PRAGMA writable_schema = ON;

.imposter t1bc t2

SELECT * FROM t2;

SELECT b, c FROM t1 ORDER BY b, c;

.quit
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), /* PRAGMA vdbe_debug = FALSE; */ (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
ANALYZE T;
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 OR b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM T;
DETACH DATABASE aux68;
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;
SELECT MIN(b) OVER (PARTITION BY b ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
UPDATE t1 SET d = '' WHERE 1;
INSERT OR ABORT INTO t1 VALUES (0, 0, NULL, 7);
ROLLBACK TRANSACTION TO SAVEPOINT sp9028;
RELEASE SAVEPOINT sp9028;
REINDEX T;
ALTER TABLE t1 DROP COLUMN b;
SELECT * FROM t1 AS a INNER JOIN T AS b ON a.rowid = b.rowid;

SELECT COUNT(*) FROM T;
SELECT SUM(b) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT STRING_AGG(b) FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_495 AS SELECT a FROM T;
END TRANSACTION;
INSERT INTO t1 SELECT * FROM t1;
DROP TABLE IF EXISTS t1;
DELETE FROM T WHERE rowid = 75 RETURNING *;
ALTER TABLE T ADD COLUMN extra_685 DECIMAL(10,5) NOT NULL DEFAULT 0;
ALTER TABLE T ADD COLUMN extra_8806 TEXT COLLATE RTRIM;
DETACH DATABASE aux99;
PRAGMA journal_size_limit;
SELECT * FROM T WHERE b = (SELECT MAX(b) FROM T WHERE b = (SELECT MAX(b) FROM T));
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_2068 ON t1(b COLLATE NOCASE) WHERE b > 0;
SELECT * FROM t1;
ALTER TABLE T ADD COLUMN extra_4370 INT2 COLLATE RTRIM;
VACUUM main;
SELECT * FROM t1 WHERE d <= ANY (SELECT d FROM t1);
ANALYZE T;
DETACH DATABASE aux57;
SELECT LEAD(b, 2) OVER (ORDER BY b RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM T;
DROP VIEW IF EXISTS t1;
SELECT * FROM T WHERE a IN (SELECT a FROM T t2 WHERE t2.a = T.a);
WITH RECURSIVE fib(a,b) AS (VALUES(1,1) UNION ALL SELECT b, a+b FROM fib WHERE b<1000) SELECT a FROM fib;
PRAGMA vdbe_trace = 1;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_5353 ON t1(d) WHERE d IS NOT NULL;
ALTER TABLE t1 RENAME COLUMN d TO d_r4876;
WITH cte AS (SELECT b FROM T INTERSECT SELECT b FROM T) SELECT * FROM cte;
INSERT INTO t1 DEFAULT VALUES;
DETACH DATABASE aux0;
VACUUM;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
SELECT * FROM T AS a FULL JOIN T AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN a;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);

SELECT COUNT(*) FROM T;
.filectrl main TRUNCATE x'f66a2152e6'
PRAGMA cell_size_check = YES;
ATTACH DATABASE ':memory:' AS aux0;
PRAGMA cell_size_check;
PRAGMA function_list;
ATTACH DATABASE ':memory:' AS aux57;
PRAGMA parser_trace = NO;
ATTACH DATABASE ':memory:' AS aux99;
.print
BEGIN DEFERRED;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (jsonb_array(ifnull(sign(x'980a5244992c94686b082be96979'), timediff(x'f3542de8ff3bff1eddeb', unistr('\\')))),typeof(NULL),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;
SAVEPOINT sp9028;
.width
ATTACH DATABASE '' || (':memory:') AS aux68;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d
INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', CAST(ltrim('xxxhelloxxx', 'x') AS TEXT), CAST(100 -> '$[0]' AS DOUB));
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', 30, 300);

CREATE INDEX t1bc ON t1(b, c);

PRAGMA writable_schema = ON;

.imposter t1bc t2

SELECT * FROM t2;

SELECT b, c FROM t1 ORDER BY b, c;

.quit
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), /* PRAGMA vdbe_debug = FALSE; */ (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
ANALYZE T;
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 OR b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM T;
DETACH DATABASE aux68;
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;
SELECT MIN(b) OVER (PARTITION BY b ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
UPDATE t1 SET d = '' WHERE 1;
INSERT OR ABORT INTO t1 VALUES (0, 0, NULL, 7);
ROLLBACK TRANSACTION TO SAVEPOINT sp9028;
RELEASE SAVEPOINT sp9028;
REINDEX T;
ALTER TABLE t1 DROP COLUMN b;
SELECT * FROM t1 AS a INNER JOIN T AS b ON a.rowid = b.rowid;

SELECT COUNT(*) FROM T;
SELECT SUM(b) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT STRING_AGG(b) FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_495 AS SELECT a FROM T;
END TRANSACTION;
INSERT INTO t1 SELECT * FROM t1;
DROP TABLE IF EXISTS t1;
DELETE FROM T WHERE rowid = 75 RETURNING *;
ALTER TABLE T ADD COLUMN extra_685 DECIMAL(10,5) NOT NULL DEFAULT 0;
ALTER TABLE T ADD COLUMN extra_8806 TEXT COLLATE RTRIM;
DETACH DATABASE aux99;
PRAGMA journal_size_limit;
SELECT * FROM T WHERE b = (SELECT MAX(b) FROM T WHERE b = (SELECT MAX(b) FROM T));
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_2068 ON t1(b COLLATE NOCASE) WHERE b > 0;
SELECT * FROM t1;
ALTER TABLE T ADD COLUMN extra_4370 INT2 COLLATE RTRIM;
VACUUM main;
SELECT * FROM t1 WHERE d <= ANY (SELECT d FROM t1);
ANALYZE T;
DETACH DATABASE aux57;
SELECT LEAD(b, 2) OVER (ORDER BY b RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM T;
DROP VIEW IF EXISTS t1;
SELECT * FROM T WHERE a IN (SELECT a FROM T t2 WHERE t2.a = T.a);
WITH RECURSIVE fib(a,b) AS (VALUES(1,1) UNION ALL SELECT b, a+b FROM fib WHERE b<1000) SELECT a FROM fib;
PRAGMA vdbe_trace = 1;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_5353 ON t1(d) WHERE d IS NOT NULL;
ALTER TABLE t1 RENAME COLUMN d TO d_r4876;
WITH cte AS (SELECT b FROM T INTERSECT SELECT b FROM T) SELECT * FROM cte;
INSERT INTO t1 DEFAULT VALUES;
DETACH DATABASE aux0;
VACUUM;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
SELECT * FROM T AS a FULL JOIN T AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN a;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);

SELECT COUNT(*) FROM T;
.filectrl main TRUNCATE x'f66a2152e6'
PRAGMA cell_size_check = YES;
ATTACH DATABASE ':memory:' AS aux0;
PRAGMA cell_size_check;
PRAGMA function_list;
ATTACH DATABASE ':memory:' AS aux57;
PRAGMA parser_trace = NO;
ATTACH DATABASE ':memory:' AS aux99;
.print
BEGIN DEFERRED;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (jsonb_array(ifnull(sign(x'980a5244992c94686b082be96979'), timediff(x'f3542de8ff3bff1eddeb', unistr('\\')))),typeof(NULL),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;
SAVEPOINT sp9028;
.width
ATTACH DATABASE '' || (':memory:') AS aux68;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d
INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', CAST(ltrim('xxxhelloxxx', 'x') AS TEXT), CAST(100 -> '$[0]' AS DOUB));
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', 30, 300);

CREATE INDEX t1bc ON t1(b, c);

PRAGMA writable_schema = ON;

.imposter t1bc t2

SELECT * FROM t2;

SELECT b, c FROM t1 ORDER BY b, c;

.quit
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), /* PRAGMA vdbe_debug = FALSE; */ (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
ANALYZE T;
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 OR b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM T;
DETACH DATABASE aux68;
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;
SELECT MIN(b) OVER (PARTITION BY b ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
UPDATE t1 SET d = '' WHERE 1;
INSERT OR ABORT INTO t1 VALUES (0, 0, NULL, 7);
ROLLBACK TRANSACTION TO SAVEPOINT sp9028;
RELEASE SAVEPOINT sp9028;
REINDEX T;
ALTER TABLE t1 DROP COLUMN b;
SELECT * FROM t1 AS a INNER JOIN T AS b ON a.rowid = b.rowid;

SELECT COUNT(*) FROM T;
SELECT SUM(b) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT STRING_AGG(b) FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_495 AS SELECT a FROM T;
END TRANSACTION;
INSERT INTO t1 SELECT * FROM t1;
DROP TABLE IF EXISTS t1;
DELETE FROM T WHERE rowid = 75 RETURNING *;
ALTER TABLE T ADD COLUMN extra_685 DECIMAL(10,5) NOT NULL DEFAULT 0;
ALTER TABLE T ADD COLUMN extra_8806 TEXT COLLATE RTRIM;
DETACH DATABASE aux99;
PRAGMA journal_size_limit;
SELECT * FROM T WHERE b = (SELECT MAX(b) FROM T WHERE b = (SELECT MAX(b) FROM T));
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_2068 ON t1(b COLLATE NOCASE) WHERE b > 0;
SELECT * FROM t1;
ALTER TABLE T ADD COLUMN extra_4370 INT2 COLLATE RTRIM;
VACUUM main;
SELECT * FROM t1 WHERE d <= ANY (SELECT d FROM t1);
ANALYZE T;
DETACH DATABASE aux57;
SELECT LEAD(b, 2) OVER (ORDER BY b RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM T;
DROP VIEW IF EXISTS t1;
SELECT * FROM T WHERE a IN (SELECT a FROM T t2 WHERE t2.a = T.a);
WITH RECURSIVE fib(a,b) AS (VALUES(1,1) UNION ALL SELECT b, a+b FROM fib WHERE b<1000) SELECT a FROM fib;
PRAGMA vdbe_trace = 1;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_5353 ON t1(d) WHERE d IS NOT NULL;
ALTER TABLE t1 RENAME COLUMN d TO d_r4876;
WITH cte AS (SELECT b FROM T INTERSECT SELECT b FROM T) SELECT * FROM cte;
INSERT INTO t1 DEFAULT VALUES;
DETACH DATABASE aux0;
VACUUM;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
SELECT * FROM T AS a FULL JOIN T AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN a;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);

SELECT COUNT(*) FROM T;
.filectrl main TRUNCATE x'f66a2152e6'
PRAGMA cell_size_check = YES;
ATTACH DATABASE ':memory:' AS aux0;
PRAGMA cell_size_check;
PRAGMA function_list;
ATTACH DATABASE ':memory:' AS aux57;
PRAGMA parser_trace = NO;
ATTACH DATABASE ':memory:' AS aux99;
.print
BEGIN DEFERRED;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (jsonb_array(ifnull(sign(x'980a5244992c94686b082be96979'), timediff(x'f3542de8ff3bff1eddeb', unistr('\\')))),typeof(NULL),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;
SAVEPOINT sp9028;
.width
ATTACH DATABASE '' || (':memory:') AS aux68;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d
INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', CAST(ltrim('xxxhelloxxx', 'x') AS TEXT), CAST(100 -> '$[0]' AS DOUB));
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', 30, 300);

CREATE INDEX t1bc ON t1(b, c);

PRAGMA writable_schema = ON;

.imposter t1bc t2

SELECT * FROM t2;

SELECT b, c FROM t1 ORDER BY b, c;

.quit
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), /* PRAGMA vdbe_debug = FALSE; */ (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
ANALYZE T;
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 OR b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM T;
DETACH DATABASE aux68;
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;
SELECT MIN(b) OVER (PARTITION BY b ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
UPDATE t1 SET d = '' WHERE 1;
INSERT OR ABORT INTO t1 VALUES (0, 0, NULL, 7);
ROLLBACK TRANSACTION TO SAVEPOINT sp9028;
RELEASE SAVEPOINT sp9028;
REINDEX T;
ALTER TABLE t1 DROP COLUMN b;
SELECT * FROM t1 AS a INNER JOIN T AS b ON a.rowid = b.rowid;

SELECT COUNT(*) FROM T;
SELECT SUM(b) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT STRING_AGG(b) FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_495 AS SELECT a FROM T;
END TRANSACTION;
INSERT INTO t1 SELECT * FROM t1;
DROP TABLE IF EXISTS t1;
DELETE FROM T WHERE rowid = 75 RETURNING *;
ALTER TABLE T ADD COLUMN extra_685 DECIMAL(10,5) NOT NULL DEFAULT 0;
ALTER TABLE T ADD COLUMN extra_8806 TEXT COLLATE RTRIM;
DETACH DATABASE aux99;
PRAGMA journal_size_limit;
SELECT * FROM T WHERE b = (SELECT MAX(b) FROM T WHERE b = (SELECT MAX(b) FROM T));
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_2068 ON t1(b COLLATE NOCASE) WHERE b > 0;
SELECT * FROM t1;
ALTER TABLE T ADD COLUMN extra_4370 INT2 COLLATE RTRIM;
VACUUM main;
SELECT * FROM t1 WHERE d <= ANY (SELECT d FROM t1);
ANALYZE T;
DETACH DATABASE aux57;
SELECT LEAD(b, 2) OVER (ORDER BY b RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM T;
DROP VIEW IF EXISTS t1;
SELECT * FROM T WHERE a IN (SELECT a FROM T t2 WHERE t2.a = T.a);
WITH RECURSIVE fib(a,b) AS (VALUES(1,1) UNION ALL SELECT b, a+b FROM fib WHERE b<1000) SELECT a FROM fib;
PRAGMA vdbe_trace = 1;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_5353 ON t1(d) WHERE d IS NOT NULL;
ALTER TABLE t1 RENAME COLUMN d TO d_r4876;
WITH cte AS (SELECT b FROM T INTERSECT SELECT b FROM T) SELECT * FROM cte;
INSERT INTO t1 DEFAULT VALUES;
DETACH DATABASE aux0;
VACUUM;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
SELECT * FROM T AS a FULL JOIN T AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN a;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);

SELECT COUNT(*) FROM T;
.filectrl main TRUNCATE x'f66a2152e6'
PRAGMA cell_size_check = YES;
ATTACH DATABASE ':memory:' AS aux0;
PRAGMA cell_size_check;
PRAGMA function_list;
ATTACH DATABASE ':memory:' AS aux57;
PRAGMA parser_trace = NO;
ATTACH DATABASE ':memory:' AS aux99;
.print
BEGIN DEFERRED;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (jsonb_array(ifnull(sign(x'980a5244992c94686b082be96979'), timediff(x'f3542de8ff3bff1eddeb', unistr('\\')))),typeof(NULL),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;
SAVEPOINT sp9028;
.width
ATTACH DATABASE '' || (':memory:') AS aux68;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d
INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', CAST(ltrim('xxxhelloxxx', 'x') AS TEXT), CAST(100 -> '$[0]' AS DOUB));
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', 30, 300);

CREATE INDEX t1bc ON t1(b, c);

PRAGMA writable_schema = ON;

.imposter t1bc t2

SELECT * FROM t2;

SELECT b, c FROM t1 ORDER BY b, c;

.quit
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), /* PRAGMA vdbe_debug = FALSE; */ (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
ANALYZE T;
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 OR b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM T;
DETACH DATABASE aux68;
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;
SELECT MIN(b) OVER (PARTITION BY b ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
UPDATE t1 SET d = '' WHERE 1;
INSERT OR ABORT INTO t1 VALUES (0, 0, NULL, 7);
ROLLBACK TRANSACTION TO SAVEPOINT sp9028;
RELEASE SAVEPOINT sp9028;
REINDEX T;
ALTER TABLE t1 DROP COLUMN b;
SELECT * FROM t1 AS a INNER JOIN T AS b ON a.rowid = b.rowid;

SELECT COUNT(*) FROM T;
SELECT SUM(b) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT STRING_AGG(b) FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_495 AS SELECT a FROM T;
END TRANSACTION;
INSERT INTO t1 SELECT * FROM t1;
DROP TABLE IF EXISTS t1;
DELETE FROM T WHERE rowid = 75 RETURNING *;
ALTER TABLE T ADD COLUMN extra_685 DECIMAL(10,5) NOT NULL DEFAULT 0;
ALTER TABLE T ADD COLUMN extra_8806 TEXT COLLATE RTRIM;
DETACH DATABASE aux99;
PRAGMA journal_size_limit;
SELECT * FROM T WHERE b = (SELECT MAX(b) FROM T WHERE b = (SELECT MAX(b) FROM T));
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_2068 ON t1(b COLLATE NOCASE) WHERE b > 0;
SELECT * FROM t1;
ALTER TABLE T ADD COLUMN extra_4370 INT2 COLLATE RTRIM;
VACUUM main;
SELECT * FROM t1 WHERE d <= ANY (SELECT d FROM t1);
ANALYZE T;
DETACH DATABASE aux57;
SELECT LEAD(b, 2) OVER (ORDER BY b RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM T;
DROP VIEW IF EXISTS t1;
SELECT * FROM T WHERE a IN (SELECT a FROM T t2 WHERE t2.a = T.a);
WITH RECURSIVE fib(a,b) AS (VALUES(1,1) UNION ALL SELECT b, a+b FROM fib WHERE b<1000) SELECT a FROM fib;
PRAGMA vdbe_trace = 1;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_5353 ON t1(d) WHERE d IS NOT NULL;
ALTER TABLE t1 RENAME COLUMN d TO d_r4876;
WITH cte AS (SELECT b FROM T INTERSECT SELECT b FROM T) SELECT * FROM cte;
INSERT INTO t1 DEFAULT VALUES;
DETACH DATABASE aux0;
VACUUM;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
SELECT * FROM T AS a FULL JOIN T AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN a;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);

SELECT COUNT(*) FROM T;
.filectrl main TRUNCATE x'f66a2152e6'
PRAGMA cell_size_check = YES;
ATTACH DATABASE ':memory:' AS aux0;
PRAGMA cell_size_check;
PRAGMA function_list;
ATTACH DATABASE ':memory:' AS aux57;
PRAGMA parser_trace = NO;
ATTACH DATABASE ':memory:' AS aux99;
.print
BEGIN DEFERRED;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (jsonb_array(ifnull(sign(x'980a5244992c94686b082be96979'), timediff(x'f3542de8ff3bff1eddeb', unistr('\\')))),typeof(NULL),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;
SAVEPOINT sp9028;
.width
ATTACH DATABASE '' || (':memory:') AS aux68;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d
INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', CAST(ltrim('xxxhelloxxx', 'x') AS TEXT), CAST(100 -> '$[0]' AS DOUB));
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', 30, 300);

CREATE INDEX t1bc ON t1(b, c);

PRAGMA writable_schema = ON;

.imposter t1bc t2

SELECT * FROM t2;

SELECT b, c FROM t1 ORDER BY b, c;

.quit
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), /* PRAGMA vdbe_debug = FALSE; */ (3,0.0);
SELECT a,b FROM T WHERE NOT NOT (a >= 2) ORDER BY b;
ANALYZE T;
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 OR b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM T;
DETACH DATABASE aux68;
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;
SELECT MIN(b) OVER (PARTITION BY b ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
UPDATE t1 SET d = '' WHERE 1;
INSERT OR ABORT INTO t1 VALUES (0, 0, NULL, 7);
ROLLBACK TRANSACTION TO SAVEPOINT sp9028;
RELEASE SAVEPOINT sp9028;
REINDEX T;
ALTER TABLE t1 DROP COLUMN b;
SELECT * FROM t1 AS a INNER JOIN T AS b ON a.rowid = b.rowid;

SELECT COUNT(*) FROM T;
SELECT SUM(b) FROM t1;

SELECT COUNT(*) FROM t1;
SELECT STRING_AGG(b) FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_495 AS SELECT a FROM T;
END TRANSACTION;
INSERT INTO t1 SELECT * FROM t1;
DROP TABLE IF EXISTS t1;
DELETE FROM T WHERE rowid = 75 RETURNING *;
ALTER TABLE T ADD COLUMN extra_685 DECIMAL(10,5) NOT NULL DEFAULT 0;
ALTER TABLE T ADD COLUMN extra_8806 TEXT COLLATE RTRIM;
DETACH DATABASE aux99;
PRAGMA journal_size_limit;
SELECT * FROM T WHERE b = (SELECT MAX(b) FROM T WHERE b = (SELECT MAX(b) FROM T));
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_2068 ON t1(b COLLATE NOCASE) WHERE b > 0;
SELECT * FROM t1;
ALTER TABLE T ADD COLUMN extra_4370 INT2 COLLATE RTRIM;
VACUUM main;
SELECT * FROM t1 WHERE d <= ANY (SELECT d FROM t1);
ANALYZE T;
DETACH DATABASE aux57;
SELECT LEAD(b, 2) OVER (ORDER BY b RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM T;
DROP VIEW IF EXISTS t1;
SELECT * FROM T WHERE a IN (SELECT a FROM T t2 WHERE t2.a = T.a);
WITH RECURSIVE fib(a,b) AS (VALUES(1,1) UNION ALL SELECT b, a+b FROM fib WHERE b<1000) SELECT a FROM fib;
PRAGMA vdbe_trace = 1;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_5353 ON t1(d) WHERE d IS NOT NULL;
ALTER TABLE t1 RENAME COLUMN d TO d_r4876;
WITH cte AS (SELECT b FROM T INTERSECT SELECT b FROM T) SELECT * FROM cte;
INSERT INTO t1 DEFAULT VALUES;
DETACH DATABASE aux0;
VACUUM;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
SELECT * FROM T AS a FULL JOIN T AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN a;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);

SELECT COUNT(*) FROM T;

ALTER TABLE t1 DROP COLUMN a;
```

## Actual output

```sql
Usage: /home/test/sqlite3-src/build/sqlite3 [OPTIONS] FILENAME [SQL]
FILENAME is the name of an SQLite database. A new database is created
if the file does not previously exist.
OPTIONS include:
   -append              append the database to the end of the file
   -ascii               set output mode to 'ascii'
   -bail                stop after hitting an error
   -batch               force batch I/O
   -box                 set output mode to 'box'
   -column              set output mode to 'column'
   -cmd COMMAND         run "COMMAND" before reading stdin
   -csv                 set output mode to 'csv'
   -deserialize         open the database using sqlite3_deserialize()
   -echo                print commands before execution
   -init FILENAME       read/process named file
   -[no]header          turn headers on or off
   -help                show this message
   -html                set output mode to HTML
   -interactive         force interactive I/O
   -json                set output mode to 'json'
   -line                set output mode to 'line'
   -list                set output mode to 'list'
   -lookaside SIZE N    use N entries of SZ bytes for lookaside memory
   -markdown            set output mode to 'markdown'
   -maxsize N           maximum size for a --deserialize database
   -memtrace            trace all memory allocations and deallocations
   -mmap N              default mmap size set to N
   -newline SEP         set output row separator. Default: '\n'
   -nofollow            refuse to open symbolic links to database files
   -nonce STRING        set the safe-mode escape nonce
   -nullvalue TEXT      set text string for NULL values. Default ''
   -pagecache SIZE N    use N slots of SZ bytes each for page cache memory
   -quote               set output mode to 'quote'
   -readonly            open the database read-only
   -safe                enable safe-mode
   -separator SEP       set output column separator. Default: '|'
   -stats               print memory stats before each finalize
   -table               set output mode to 'table'
   -tabs                set output mode to 'tabs'
   -version             show SQLite version
   -vfs NAME            use NAME as the default VFS
```

## Expectation

```sql

```

## Flag

```
-help
```

