## 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 synchronous = '2';
PRAGMA vdbe_trace = NO;
.vfsinfo
PRAGMA secure_delete;
-- DATE

PRAGMA reverse_unordered_selects = ON;
.schema @@@@@@@@@@@@@@@@
.fullschema
PRAGMA auto_vacuum = INCREMENTAL;
PRAGMA recursive_triggers;
BEGIN IMMEDIATE TRANSACTION;
ATTACH DATABASE ':memory:' AS aux42;
SAVEPOINT sp664;
.read commands.sql
CREATE TABLE "t1"(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (round(unlikely(NULL), x'2f972a75f5d004ce366600'), 'Wernher', CAST(round(NULL, (-(-(if('', radians(1.7976931348623157e+308), 2))) * 1)) AS FLOAT), 100);
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;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
.quit
ATTACH DATABASE ':memory:' AS aux33;
ATTACH DATABASE ':memory:' AS aux74;
.nullvalue 232327d3-536b-41de-a764-a6301986aeab
CREATE TABLE [T] (
  A VARCHAR(upper('你好')) PRIMARY KEY,
  B VARCHAR(json_array()) NOT NULL,
  C INTEGER,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -degrees(2147483648));
INSERT INTO T VALUES ('b', 'q', 700);
INSERT INTO T VALUES ('c', 'r', 0);
INSERT INTO T VALUES ('d', 's', 2147483647);
INSERT INTO T VALUES ('e', 't', -1);
INSERT INTO T VALUES ('f', 'u', 1);
SELECT * FROM T WHERE NOT NOT (C BETWEEN -1000 AND 1000) ORDER BY C ASC;
SELECT * FROM T;
PRAGMA vdbe_debug = 0;
ALTER TABLE T DROP COLUMN B;
CREATE TRIGGER IF NOT EXISTS trg_T_6262 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
CREATE TRIGGER IF NOT EXISTS trg_T_1635 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
SELECT AVG(C) FROM T;
ALTER TABLE T RENAME COLUMN B TO B_r9915;
DETACH DATABASE aux74;
DETACH DATABASE aux33;
SELECT * FROM t1 WHERE +a > ALL (SELECT a FROM t1);
DELETE FROM t1 WHERE 0;
INSERT OR ROLLBACK INTO t1 VALUES (NULL, 0, -6, '');
CREATE TRIGGER IF NOT EXISTS trg_t1_7285 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP TRIGGER IF EXISTS t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
RELEASE sp664;
ALTER TABLE t1 ADD COLUMN extra_6969 DOUBLE NOT NULL DEFAULT 0;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1;
REINDEX;
SELECT STRING_AGG(d) FROM t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5722 AS SELECT a FROM t1;
ALTER TABLE t1 RENAME COLUMN c TO c_r6930;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux42;
ALTER TABLE t1 RENAME COLUMN d TO d_r1370;
SELECT * FROM t1 AS a JOIN t1 AS b ON a.rowid = b.rowid;
INSERT OR REPLACE INTO t1 VALUES (NULL, 0, -9, -5);
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
REINDEX t1;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t1;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE d BETWEEN 0 AND 100;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE 1 RETURNING *;
BEGIN IMMEDIATE TRANSACTION;
ATTACH DATABASE ':memory:' AS aux42;
SAVEPOINT sp664;
.read commands.sql
CREATE TABLE "t1"(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (round(unlikely(NULL), x'2f972a75f5d004ce366600'), 'Wernher', CAST(10 AS FLOAT), 100);
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;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
.quit
ATTACH DATABASE ':memory:' AS aux33;
ATTACH DATABASE ':memory:' AS aux74;
.nullvalue 232327d3-536b-41de-a764-a6301986aeab
CREATE TABLE [T] (
  A VARCHAR(upper('你好')) PRIMARY KEY,
  B VARCHAR(json_array()) NOT NULL,
  C INTEGER,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -degrees(2147483648));
INSERT INTO T VALUES ('b', 'q', 700);
INSERT INTO T VALUES ('c', 'r', 0);
INSERT INTO T VALUES ('d', 's', 2147483647);
INSERT INTO T VALUES ('e', 't', -1);
INSERT INTO T VALUES ('f', 'u', 1);
SELECT * FROM T WHERE NOT NOT (C BETWEEN -1000 AND 1000) ORDER BY C ASC;
SELECT * FROM T;
PRAGMA vdbe_debug = 0;
ALTER TABLE T DROP COLUMN B;
CREATE TRIGGER IF NOT EXISTS trg_T_6262 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
CREATE TRIGGER IF NOT EXISTS trg_T_1635 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
SELECT AVG(C) FROM T;
ALTER TABLE T RENAME COLUMN B TO B_r9915;
DETACH DATABASE aux74;
DETACH DATABASE aux33;
SELECT * FROM t1 WHERE +a > ALL (SELECT a FROM t1);
DELETE FROM t1 WHERE 0;
INSERT OR ROLLBACK INTO t1 VALUES (NULL, 0, -6, '');
CREATE TRIGGER IF NOT EXISTS trg_t1_7285 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP TRIGGER IF EXISTS t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
RELEASE sp664;
ALTER TABLE t1 ADD COLUMN extra_6969 DOUBLE NOT NULL DEFAULT 0;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1;
REINDEX;
SELECT STRING_AGG(d) FROM t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5722 AS SELECT a FROM t1;
ALTER TABLE t1 RENAME COLUMN c TO c_r6930;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux42;
ALTER TABLE t1 RENAME COLUMN d TO d_r1370;
SELECT * FROM t1 AS a JOIN t1 AS b ON a.rowid = b.rowid;
INSERT OR REPLACE INTO t1 VALUES (NULL, 0, -9, -5);
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
REINDEX t1;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t1;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE d BETWEEN 0 AND 100;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE 1 RETURNING *;
BEGIN IMMEDIATE TRANSACTION;
ATTACH DATABASE ':memory:' AS aux42;
SAVEPOINT sp664;
.read commands.sql
CREATE TABLE "t1"(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (round(unlikely(NULL), x'2f972a75f5d004ce366600'), 'Wernher', CAST(10 AS FLOAT), 100);
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;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
.quit
ATTACH DATABASE ':memory:' AS aux33;
ATTACH DATABASE ':memory:' AS aux74;
.nullvalue 232327d3-536b-41de-a764-a6301986aeab
CREATE TABLE [T] (
  A VARCHAR(upper('你好')) PRIMARY KEY,
  B VARCHAR(json_array()) NOT NULL,
  C INTEGER,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -degrees(2147483648));
INSERT INTO T VALUES ('b', 'q', 700);
INSERT INTO T VALUES ('c', 'r', 0);
INSERT INTO T VALUES ('d', 's', 2147483647);
INSERT INTO T VALUES ('e', 't', -1);
INSERT INTO T VALUES ('f', 'u', 1);
SELECT * FROM T WHERE NOT NOT (C BETWEEN -1000 AND 1000) ORDER BY C ASC;
SELECT * FROM T;
PRAGMA vdbe_debug = 0;
ALTER TABLE T DROP COLUMN B;
CREATE TRIGGER IF NOT EXISTS trg_T_6262 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
CREATE TRIGGER IF NOT EXISTS trg_T_1635 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
SELECT AVG(C) FROM T;
ALTER TABLE T RENAME COLUMN B TO B_r9915;
DETACH DATABASE aux74;
DETACH DATABASE aux33;
SELECT * FROM t1 WHERE +a > ALL (SELECT a FROM t1);
DELETE FROM t1 WHERE 0;
INSERT OR ROLLBACK INTO t1 VALUES (NULL, 0, -6, '');
CREATE TRIGGER IF NOT EXISTS trg_t1_7285 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP TRIGGER IF EXISTS t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
RELEASE sp664;
ALTER TABLE t1 ADD COLUMN extra_6969 DOUBLE NOT NULL DEFAULT 0;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1;
REINDEX;
SELECT STRING_AGG(d) FROM t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5722 AS SELECT a FROM t1;
ALTER TABLE t1 RENAME COLUMN c TO c_r6930;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux42;
ALTER TABLE t1 RENAME COLUMN d TO d_r1370;
SELECT * FROM t1 AS a JOIN t1 AS b ON a.rowid = b.rowid;
INSERT OR REPLACE INTO t1 VALUES (NULL, 0, -9, -5);
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
REINDEX t1;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t1;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE d BETWEEN 0 AND 100;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE 1 RETURNING *;
BEGIN IMMEDIATE TRANSACTION;
ATTACH DATABASE ':memory:' AS aux42;
SAVEPOINT sp664;
.read commands.sql
CREATE TABLE "t1"(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (round(unlikely(NULL), x'2f972a75f5d004ce366600'), 'Wernher', CAST(10 AS FLOAT), 100);
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;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
.quit
ATTACH DATABASE ':memory:' AS aux33;
ATTACH DATABASE ':memory:' AS aux74;
.nullvalue 232327d3-536b-41de-a764-a6301986aeab
CREATE TABLE [T] (
  A VARCHAR(upper('你好')) PRIMARY KEY,
  B VARCHAR(json_array()) NOT NULL,
  C INTEGER,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -degrees(2147483648));
INSERT INTO T VALUES ('b', 'q', 700);
INSERT INTO T VALUES ('c', 'r', 0);
INSERT INTO T VALUES ('d', 's', 2147483647);
INSERT INTO T VALUES ('e', 't', -1);
INSERT INTO T VALUES ('f', 'u', 1);
SELECT * FROM T WHERE NOT NOT (C BETWEEN -1000 AND 1000) ORDER BY C ASC;
SELECT * FROM T;
PRAGMA vdbe_debug = 0;
ALTER TABLE T DROP COLUMN B;
CREATE TRIGGER IF NOT EXISTS trg_T_6262 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
CREATE TRIGGER IF NOT EXISTS trg_T_1635 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
SELECT AVG(C) FROM T;
ALTER TABLE T RENAME COLUMN B TO B_r9915;
DETACH DATABASE aux74;
DETACH DATABASE aux33;
SELECT * FROM t1 WHERE +a > ALL (SELECT a FROM t1);
DELETE FROM t1 WHERE 0;
INSERT OR ROLLBACK INTO t1 VALUES (NULL, 0, -6, '');
CREATE TRIGGER IF NOT EXISTS trg_t1_7285 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP TRIGGER IF EXISTS t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
RELEASE sp664;
ALTER TABLE t1 ADD COLUMN extra_6969 DOUBLE NOT NULL DEFAULT 0;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1;
REINDEX;
SELECT STRING_AGG(d) FROM t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5722 AS SELECT a FROM t1;
ALTER TABLE t1 RENAME COLUMN c TO c_r6930;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux42;
ALTER TABLE t1 RENAME COLUMN d TO d_r1370;
SELECT * FROM t1 AS a JOIN t1 AS b ON a.rowid = b.rowid;
INSERT OR REPLACE INTO t1 VALUES (NULL, 0, -9, -5);
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
REINDEX t1;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t1;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE d BETWEEN 0 AND 100;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE 1 RETURNING *;
BEGIN IMMEDIATE TRANSACTION;
ATTACH DATABASE ':memory:' AS aux42;
SAVEPOINT sp664;
.read commands.sql
CREATE TABLE "t1"(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (round(unlikely(NULL), x'2f972a75f5d004ce366600'), 'Wernher', CAST(10 AS FLOAT), 100);
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;
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;
.imposter t1bc t2

SELECT * FROM t2;
SELECT b, c FROM t1 ORDER BY b, c;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
.quit
ATTACH DATABASE ':memory:' AS aux33;
ATTACH DATABASE ':memory:' AS aux74;
.nullvalue 232327d3-536b-41de-a764-a6301986aeab
CREATE TABLE [T] (
  A VARCHAR(upper('你好')) PRIMARY KEY,
  B VARCHAR(json_array()) NOT NULL,
  C INTEGER,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -degrees(2147483648));
INSERT INTO T VALUES ('b', 'q', 700);
INSERT INTO T VALUES ('c', 'r', 0);
INSERT INTO T VALUES ('d', 's', 2147483647);
INSERT INTO T VALUES ('e', 't', -1);
INSERT INTO T VALUES ('f', 'u', 1);
SELECT * FROM T WHERE NOT NOT (C BETWEEN -1000 AND 1000) ORDER BY C ASC;
SELECT * FROM T;
PRAGMA vdbe_debug = 0;
ALTER TABLE T DROP COLUMN B;
CREATE TRIGGER IF NOT EXISTS trg_T_6262 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
CREATE TRIGGER IF NOT EXISTS trg_T_1635 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
SELECT AVG(C) FROM T;
ALTER TABLE T RENAME COLUMN B TO B_r9915;
DETACH DATABASE aux74;
DETACH DATABASE aux33;
SELECT * FROM t1 WHERE +a > ALL (SELECT a FROM t1);
DELETE FROM t1 WHERE 0;
INSERT OR ROLLBACK INTO t1 VALUES (NULL, 0, -6, '');
CREATE TRIGGER IF NOT EXISTS trg_t1_7285 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP TRIGGER IF EXISTS t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
RELEASE sp664;
ALTER TABLE t1 ADD COLUMN extra_6969 DOUBLE NOT NULL DEFAULT 0;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1;
REINDEX;
SELECT STRING_AGG(d) FROM t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5722 AS SELECT a FROM t1;
ALTER TABLE t1 RENAME COLUMN c TO c_r6930;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux42;
ALTER TABLE t1 RENAME COLUMN d TO d_r1370;
SELECT * FROM t1 AS a JOIN t1 AS b ON a.rowid = b.rowid;
INSERT OR REPLACE INTO t1 VALUES (NULL, 0, -9, -5);
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
REINDEX t1;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t1;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE d BETWEEN 0 AND 100;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE 1 RETURNING *;
BEGIN IMMEDIATE TRANSACTION;
ATTACH DATABASE ':memory:' AS aux42;
SAVEPOINT sp664;
.read commands.sql
CREATE TABLE "t1"(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (round(unlikely(NULL), x'2f972a75f5d004ce366600'), 'Wernher', CAST(10 AS FLOAT), 100);
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;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
.quit
ATTACH DATABASE ':memory:' AS aux33;
ATTACH DATABASE ':memory:' AS aux74;
.nullvalue 232327d3-536b-41de-a764-a6301986aeab
CREATE TABLE [T] (
  A VARCHAR(upper('你好')) PRIMARY KEY,
  B VARCHAR(json_array()) NOT NULL,
  C INTEGER,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -degrees(2147483648));
INSERT INTO T VALUES ('b', 'q', 700);
INSERT INTO T VALUES ('c', 'r', 0);
INSERT INTO T VALUES ('d', 's', 2147483647);
INSERT INTO T VALUES ('e', 't', -1);
INSERT INTO T VALUES ('f', 'u', 1);
SELECT * FROM T WHERE NOT NOT (C BETWEEN -1000 AND 1000) ORDER BY C ASC;
SELECT * FROM T;
PRAGMA vdbe_debug = 0;
ALTER TABLE T DROP COLUMN B;
CREATE TRIGGER IF NOT EXISTS trg_T_6262 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
CREATE TRIGGER IF NOT EXISTS trg_T_1635 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
SELECT AVG(C) FROM T;
ALTER TABLE T RENAME COLUMN B TO B_r9915;
DETACH DATABASE aux74;
DETACH DATABASE aux33;
SELECT * FROM t1 WHERE +a > ALL (SELECT a FROM t1);
DELETE FROM t1 WHERE 0;
INSERT OR ROLLBACK INTO t1 VALUES (NULL, 0, -6, '');
CREATE TRIGGER IF NOT EXISTS trg_t1_7285 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP TRIGGER IF EXISTS t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
RELEASE sp664;
ALTER TABLE t1 ADD COLUMN extra_6969 DOUBLE NOT NULL DEFAULT 0;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1;
REINDEX;
SELECT STRING_AGG(d) FROM t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5722 AS SELECT a FROM t1;
ALTER TABLE t1 RENAME COLUMN c TO c_r6930;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux42;
ALTER TABLE t1 RENAME COLUMN d TO d_r1370;
SELECT * FROM t1 AS a JOIN t1 AS b ON a.rowid = b.rowid;
INSERT OR REPLACE INTO t1 VALUES (NULL, 0, -9, -5);
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
REINDEX t1;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t1;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE d BETWEEN 0 AND 100;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE 1 RETURNING *;
BEGIN IMMEDIATE TRANSACTION;
ATTACH DATABASE ':memory:' AS aux42;
SAVEPOINT sp664;
.read commands.sql
CREATE TABLE "t1"(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (round(unlikely(NULL), x'2f972a75f5d004ce366600'), 'Wernher', CAST(10 AS FLOAT), 100);
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;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
.quit
ATTACH DATABASE ':memory:' AS aux33;
ATTACH DATABASE ':memory:' AS aux74;
.nullvalue 232327d3-536b-41de-a764-a6301986aeab
CREATE TABLE [T] (
  A VARCHAR(upper('你好')) PRIMARY KEY,
  B VARCHAR(json_array()) NOT NULL,
  C INTEGER,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -degrees(2147483648));
INSERT INTO T VALUES ('b', 'q', 700);
INSERT INTO T VALUES ('c', 'r', 0);
INSERT INTO T VALUES ('d', 's', 2147483647);
INSERT INTO T VALUES ('e', 't', -1);
INSERT INTO T VALUES ('f', 'u', 1);
SELECT * FROM T WHERE NOT NOT (C BETWEEN -1000 AND 1000) ORDER BY C ASC;
SELECT * FROM T;
PRAGMA vdbe_debug = 0;
ALTER TABLE T DROP COLUMN B;
CREATE TRIGGER IF NOT EXISTS trg_T_6262 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
CREATE TRIGGER IF NOT EXISTS trg_T_1635 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
SELECT AVG(C) FROM T;
ALTER TABLE T RENAME COLUMN B TO B_r9915;
DETACH DATABASE aux74;
DETACH DATABASE aux33;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
SELECT * FROM t1 WHERE +a > ALL (SELECT a FROM t1);
DELETE FROM t1 WHERE 0;
INSERT OR ROLLBACK INTO t1 VALUES (NULL, 0, -6, '');
CREATE TRIGGER IF NOT EXISTS trg_t1_7285 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP TRIGGER IF EXISTS t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
RELEASE sp664;
ALTER TABLE t1 ADD COLUMN extra_6969 DOUBLE NOT NULL DEFAULT 0;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1;
REINDEX;
SELECT STRING_AGG(d) FROM t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5722 AS SELECT a FROM t1;
ALTER TABLE t1 RENAME COLUMN c TO c_r6930;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux42;
ALTER TABLE t1 RENAME COLUMN d TO d_r1370;
SELECT * FROM t1 AS a JOIN t1 AS b ON a.rowid = b.rowid;
INSERT OR REPLACE INTO t1 VALUES (NULL, 0, -9, -5);
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
REINDEX t1;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t1;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE d BETWEEN 0 AND 100;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE 1 RETURNING *;
BEGIN IMMEDIATE TRANSACTION;
ATTACH DATABASE ':memory:' AS aux42;
SAVEPOINT sp664;
.read commands.sql
CREATE TABLE "t1"(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (round(unlikely(NULL), x'2f972a75f5d004ce366600'), 'Wernher', CAST(10 AS FLOAT), 100);
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;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
.quit
ATTACH DATABASE ':memory:' AS aux33;
ATTACH DATABASE ':memory:' AS aux74;
.nullvalue 232327d3-536b-41de-a764-a6301986aeab
CREATE TABLE [T] (
  A VARCHAR(upper('你好')) PRIMARY KEY,
  B VARCHAR(json_array()) NOT NULL,
  C INTEGER,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -degrees(2147483648));
INSERT INTO T VALUES ('b', 'q', 700);
INSERT INTO T VALUES ('c', 'r', 0);
INSERT INTO T VALUES ('d', 's', 2147483647);
INSERT INTO T VALUES ('e', 't', -1);
INSERT INTO T VALUES ('f', 'u', 1);
SELECT * FROM T WHERE NOT NOT (C BETWEEN -1000 AND 1000) ORDER BY C ASC;
SELECT * FROM T;
PRAGMA vdbe_debug = 0;
ALTER TABLE T DROP COLUMN B;
CREATE TRIGGER IF NOT EXISTS trg_T_6262 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
CREATE TRIGGER IF NOT EXISTS trg_T_1635 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
SELECT AVG(C) FROM T;
ALTER TABLE T RENAME COLUMN B TO B_r9915;
DETACH DATABASE aux74;
DETACH DATABASE aux33;
SELECT * FROM t1 WHERE +a > ALL (SELECT a FROM t1);
DELETE FROM t1 WHERE 0;
INSERT OR ROLLBACK INTO t1 VALUES (NULL, 0, -6, '');
CREATE TRIGGER IF NOT EXISTS trg_t1_7285 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP TRIGGER IF EXISTS t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
RELEASE sp664;
ALTER TABLE t1 ADD COLUMN extra_6969 DOUBLE NOT NULL DEFAULT 0;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1;
REINDEX;
SELECT STRING_AGG(d) FROM t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5722 AS SELECT a FROM t1;
ALTER TABLE t1 RENAME COLUMN c TO c_r6930;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux42;
ALTER TABLE t1 RENAME COLUMN d TO d_r1370;
SELECT * FROM t1 AS a JOIN t1 AS b ON a.rowid = b.rowid;
INSERT OR REPLACE INTO t1 VALUES (NULL, 0, -9, -5);
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
REINDEX t1;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t1;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE d BETWEEN 0 AND 100;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE 1 RETURNING *;
BEGIN IMMEDIATE TRANSACTION;
ATTACH DATABASE ':memory:' AS aux42;
SAVEPOINT sp664;
.read commands.sql
CREATE TABLE "t1"(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (round(unlikely(NULL), x'2f972a75f5d004ce366600'), 'Wernher', CAST(10 AS FLOAT), 100);
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;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
.quit
ATTACH DATABASE ':memory:' AS aux33;
ATTACH DATABASE ':memory:' AS aux74;
.nullvalue 232327d3-536b-41de-a764-a6301986aeab
CREATE TABLE [T] (
  A VARCHAR(upper('你好')) PRIMARY KEY,
  B VARCHAR(json_array()) NOT NULL,
  C INTEGER,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -degrees(2147483648));
INSERT INTO T VALUES ('b', 'q', 700);
INSERT INTO T VALUES ('c', 'r', 0);
INSERT INTO T VALUES ('d', 's', 2147483647);
INSERT INTO T VALUES ('e', 't', -1);
INSERT INTO T VALUES ('f', 'u', 1);
SELECT * FROM T WHERE NOT NOT (C BETWEEN -1000 AND 1000) ORDER BY C ASC;
SELECT * FROM T;
PRAGMA vdbe_debug = 0;
ALTER TABLE T DROP COLUMN B;
CREATE TRIGGER IF NOT EXISTS trg_T_6262 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
CREATE TRIGGER IF NOT EXISTS trg_T_1635 AFTER UPDATE OF A ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
SELECT AVG(C) FROM T;
ALTER TABLE T RENAME COLUMN B TO B_r9915;
DETACH DATABASE aux74;
DETACH DATABASE aux33;
SELECT * FROM t1 WHERE +a > ALL (SELECT a FROM t1);
DELETE FROM t1 WHERE 0;
INSERT OR ROLLBACK INTO t1 VALUES (NULL, 0, -6, '');
CREATE TRIGGER IF NOT EXISTS trg_t1_7285 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP TRIGGER IF EXISTS t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
RELEASE sp664;
ALTER TABLE t1 ADD COLUMN extra_6969 DOUBLE NOT NULL DEFAULT 0;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1;
REINDEX;
SELECT STRING_AGG(d) FROM t1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5722 AS SELECT a FROM t1;
ALTER TABLE t1 RENAME COLUMN c TO c_r6930;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux42;
ALTER TABLE t1 RENAME COLUMN d TO d_r1370;
SELECT * FROM t1 AS a JOIN t1 AS b ON a.rowid = b.rowid;
INSERT OR REPLACE INTO t1 VALUES (NULL, 0, -9, -5);
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
REINDEX t1;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t1;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE d BETWEEN 0 AND 100;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
COMMIT;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE 1 RETURNING *;
DELETE FROM t1 WHERE a > (SELECT AVG(a) FROM t1) RETURNING *;
ALTER TABLE t1 ADD COLUMN extra_1693 DOUBLE PRECISION COLLATE RTRIM;
INSERT INTO t1 VALUES (1, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
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 t1;
WITH cte(x, y) AS (VALUES(1,2),(3,4),(5,6)) SELECT * FROM cte;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE a < 0);
SELECT COUNT(*) FROM t1;
SELECT * FROM t1 WHERE d = (SELECT d FROM t1 ORDER BY d LIMIT 1 OFFSET (SELECT COUNT(*) FROM t1 / 2));
CREATE TEMP  VIEW IF NOT EXISTS v_t1_4538 AS SELECT a FROM t1;
UPDATE t1 SET b = '';
SELECT COUNT(*) FROM t1;
WITH cte AS (SELECT b, LEAD(b) OVER (ORDER BY b) AS nxt FROM t1) SELECT * FROM cte;
SELECT * FROM t1;
DROP INDEX IF EXISTS t1;
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
SELECT GROUP_CONCAT(a, '|') FROM t1;
WITH RECURSIVE tree(id, parent, depth) AS (VALUES(1, NULL, 0) UNION ALL SELECT id+1, id, depth+1 FROM tree WHERE depth<29) SELECT * FROM tree;
SELECT * FROM t1 WHERE d IN (SELECT d FROM t1 LIMIT 0);
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM t1;
INSERT OR FAIL INTO t1 VALUES ('', 'x', NULL, '');
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<38) SELECT SUM(x) FROM cnt;
INSERT INTO t1 DEFAULT VALUES;
INSERT OR ROLLBACK INTO t1 VALUES (-5, NULL, 'x', NULL);
CREATE  INDEX IF NOT EXISTS idx_t1_2534 ON t1(lower(d)) WHERE d > 0;
CREATE TRIGGER IF NOT EXISTS trg_T_332 AFTER UPDATE OF a ON T BEGIN SELECT RAISE(IGNORE); END;
SELECT MIN(a) FROM T;
SELECT * FROM t1 WHERE c IN (SELECT c FROM t1 WHERE ROW_NUMBER() OVER (ORDER BY c) = 1);
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;
ALTER TABLE T DROP COLUMN B;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
INSERT INTO T SELECT * FROM T;
SELECT GROUP_CONCAT(A) FROM T;
```

## Actual output

```sql
vfs.zName      = "unix"
vfs.iVersion   = 3
vfs.szOsFile   = 120
vfs.mxPathname = 512
0
/* No STAT tables available */
0
1
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
WARNING: writing to an imposter table will corrupt the "t1bc" index!
von|20|2
Braun|30|3
Braun|30
von|20
```

## Expectation

```sql

```

## Flag

```

```

