## 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
ATTACH DATABASE ':memory:' AS aux58;
.read commands.sql
.explain on
.log ON
.system echo "mwahaha i am root"
PRAGMA recursive_triggers = FALSE;
PRAGMA wal_autocheckpoint;
ATTACH DATABASE ':memory:' AS aux69;
PRAGMA locking_mode = 'NORMAL';
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', json_pretty(CAST(jsonb_patch(-upper('你好'), CAST(substring(unhex(NULL, ' '), 1, 2) AS INT)) AS NUMERIC)), 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;
.quit
.auth ON
.exit
.save
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA writable_schema = RESET;
CREATE TABLE main.t1(a INTEGER PRIMARY KEY, b TEXT, c /**/ INT, d INT);
iNSErt INTO t1 VALUES (-2147483647, 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', /* concat_ws('|', NULL, NULL, NULL) */ 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
SELECT * FROM t1 AS a JoIn t1 AS b ON a.rowid = b.rowid;
UPDATE t1 SET b = 'x' WHERE NOT NOT (NOT NOT (NOT NOT (NOT NOT (NOT 1)))) RETURNING *;
INSERT INTO t1 DEFAULT VALUES;
REINDEX;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
INSERT INTO t1 DEFAULT VALUES;
COMMIT TRANSACTION;
CREATE  INDEX IF NOT EXISTS idx_t1_9558 ON t1(lower(d)) WHERE d IS NOT NULL;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT MIN(c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM t1;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE +a < 0);
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-2.5), (3,0.0);
CREATE INDEX c
ON T(b);
SELECT * FROM T WHERE b >= -2.5 AND b < 2.0;
WITH cte AS (SELECT * FROM t1 LIMIT 1) DELETE FROM t1 WHERE a IN (SELECT a FROM cte) AND 1=0;
WITH cte AS (SELECT CASE WHEN a IS NULL THEN 0 ELSE a END AS val FROM t1) SELECT * FROM cte;
ALTER TABLE t1 RENAME TO t1_r1583;
WITH cte AS (SELECT CASE WHEN c IS NULL THEN 0 ELSE c END AS val FROM t1) SELECT * FROM cte;
ANALYZE;
INSERT INTO T VALUES (NULL, NULL);
PRAGMA journal_mode = 'TRUNCATE';
DROP VIEW IF EXISTS t1;
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN b;
UPDATE T SET b = b + 1 WHERE rowid = 1;
CREATE  INDEX IF NOT EXISTS idx_T_1879 ON T((a + 1)) WHERE a > 0;
SELECT * FROM t1 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_498 ON t1((a + 1)) WHERE a IS NOT NULL;
SELECT * FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_5177 ON t1(lower(b)) WHERE b > 0;
SELECT LEAD(c, c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_652 AFTER INSERT ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
DETACH DATABASE aux69;
CREATE  INDEX IF NOT EXISTS idx_T_284 ON T(b COLLATE NOCASE) WHERE b IS NOT NULL;
PRAGMA foreign_key_list(users);
CREATE TRIGGER IF NOT EXISTS trg_t1_7673 AFTER UPDATE OF d ON t1 FOR EACH ROW  BEGIN SELECT RAISE(ABORT, 'abort'); END;
WITH cte AS (SELECT b, SUM(b) OVER (ORDER BY b) AS running FROM t1) SELECT * FROM cte;
ALTER TABLE t1 DROP COLUMN c;
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;
SELECT COUNT(*) FROM T;
SELECT TOTAL(c) FROM t1;
ANALYZE T;
SELECT COUNT(*) FROM T;
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;
ALTER TABLE t1 DROP COLUMN b;
INSERT INTO T VALUES (NULL, NULL, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;
REINDEX;
DROP VIEW IF EXISTS t1;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t1_5347 AFTER UPDATE OF a ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
ALTER TABLE T RENAME COLUMN A TO A_r8983;
ALTER TABLE T RENAME COLUMN B TO B_r4024;
.explain on
.log ON
.system echo "mwahaha i am root"
PRAGMA recursive_triggers = FALSE;
PRAGMA wal_autocheckpoint;
ATTACH DATABASE ':memory:' AS aux69;
PRAGMA locking_mode = 'NORMAL';
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', json_pretty(CAST(jsonb_patch(-upper('你好'), CAST(substring(2147483648, 1, 2) AS INT)) AS NUMERIC)), 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;
.quit
.auth ON
.exit
.save
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA writable_schema = RESET;
CREATE TABLE main.t1(a INTEGER PRIMARY KEY, b TEXT, c /**/ INT, d INT);
iNSErt INTO t1 VALUES (-2147483647, 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', /* concat_ws('|', NULL, NULL, NULL) */ 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
SELECT * FROM t1 AS a JoIn t1 AS b ON a.rowid = b.rowid;
UPDATE t1 SET b = 'x' WHERE NOT NOT (NOT 1) RETURNING *;
INSERT INTO t1 DEFAULT VALUES;
REINDEX;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
INSERT INTO t1 DEFAULT VALUES;
COMMIT TRANSACTION;
CREATE  INDEX IF NOT EXISTS idx_t1_9558 ON t1(lower(d)) WHERE d IS NOT NULL;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT MIN(c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM t1;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE a < 0);
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-2.5), (3,0.0);
CREATE INDEX c
ON T(b);
SELECT * FROM T WHERE b >= -2.5 AND b < 2.0;
WITH cte AS (SELECT * FROM t1 LIMIT 1) DELETE FROM t1 WHERE a IN (SELECT a FROM cte) AND 1=0;
WITH cte AS (SELECT CASE WHEN a IS NULL THEN 0 ELSE a END AS val FROM t1) SELECT * FROM cte;
ALTER TABLE t1 RENAME TO t1_r1583;
WITH cte AS (SELECT CASE WHEN c IS NULL THEN 0 ELSE c END AS val FROM t1) SELECT * FROM cte;
ANALYZE;
INSERT INTO T VALUES (NULL, NULL);
PRAGMA journal_mode = 'TRUNCATE';
DROP VIEW IF EXISTS t1;
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN b;
UPDATE T SET b = b + 1 WHERE rowid = 1;
CREATE  INDEX IF NOT EXISTS idx_T_1879 ON T((a + 1)) WHERE a > 0;
SELECT * FROM t1 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_498 ON t1((a + 1)) WHERE a IS NOT NULL;
SELECT * FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_5177 ON t1(lower(b)) WHERE b > 0;
SELECT LEAD(c, c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_652 AFTER INSERT ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
DETACH DATABASE aux69;
CREATE  INDEX IF NOT EXISTS idx_T_284 ON T(b COLLATE NOCASE) WHERE b IS NOT NULL;
PRAGMA foreign_key_list(users);
CREATE TRIGGER IF NOT EXISTS trg_t1_7673 AFTER UPDATE OF d ON t1 FOR EACH ROW  BEGIN SELECT RAISE(ABORT, 'abort'); END;
WITH cte AS (SELECT b, SUM(b) OVER (ORDER BY b) AS running FROM t1) SELECT * FROM cte;
ALTER TABLE t1 DROP COLUMN c;
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;
SELECT COUNT(*) FROM T;
SELECT TOTAL(c) FROM t1;
ANALYZE T;
SELECT COUNT(*) FROM T;
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;
ALTER TABLE t1 DROP COLUMN b;
INSERT INTO T VALUES (NULL, NULL, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;
REINDEX;
DROP VIEW IF EXISTS t1;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t1_5347 AFTER UPDATE OF a ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
ALTER TABLE T RENAME COLUMN A TO A_r8983;
ALTER TABLE T RENAME COLUMN B TO B_r4024;
.explain on
.log ON
.system echo "mwahaha i am root"
PRAGMA recursive_triggers = FALSE;
PRAGMA wal_autocheckpoint;
ATTACH DATABASE ':memory:' AS aux69;
PRAGMA locking_mode = 'NORMAL';
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', json_pretty(CAST(jsonb_patch(-upper('你好'), CAST(substring(2147483648, 1, 2) AS INT)) AS NUMERIC)), 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;
.quit
.auth ON
.exit
.save
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA writable_schema = RESET;
CREATE TABLE main.t1(a INTEGER PRIMARY KEY, b TEXT, c /**/ INT, d INT);
iNSErt INTO t1 VALUES (-2147483647, 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', /* concat_ws('|', NULL, NULL, NULL) */ 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
SELECT * FROM t1 AS a JoIn t1 AS b ON a.rowid = b.rowid;
UPDATE t1 SET b = 'x' WHERE NOT NOT (NOT 1) RETURNING *;
INSERT INTO t1 DEFAULT VALUES;
REINDEX;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
INSERT INTO t1 DEFAULT VALUES;
COMMIT TRANSACTION;
CREATE  INDEX IF NOT EXISTS idx_t1_9558 ON t1(lower(d)) WHERE d IS NOT NULL;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT MIN(c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM t1;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE a < 0);
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-2.5), (3,0.0);
CREATE INDEX c
ON T(b);
SELECT * FROM T WHERE b >= -2.5 AND b < 2.0;
WITH cte AS (SELECT * FROM t1 LIMIT 1) DELETE FROM t1 WHERE a IN (SELECT a FROM cte) AND 1=0;
WITH cte AS (SELECT CASE WHEN a IS NULL THEN 0 ELSE a END AS val FROM t1) SELECT * FROM cte;
ALTER TABLE t1 RENAME TO t1_r1583;
WITH cte AS (SELECT CASE WHEN c IS NULL THEN 0 ELSE c END AS val FROM t1) SELECT * FROM cte;
ANALYZE;
INSERT INTO T VALUES (NULL, NULL);
PRAGMA journal_mode = 'TRUNCATE';
DROP VIEW IF EXISTS t1;
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN b;
UPDATE T SET b = b + 1 WHERE rowid = 1;
CREATE  INDEX IF NOT EXISTS idx_T_1879 ON T((a + 1)) WHERE a > 0;
SELECT * FROM t1 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_498 ON t1((a + 1)) WHERE a IS NOT NULL;
SELECT * FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_5177 ON t1(lower(b)) WHERE b > 0;
SELECT LEAD(c, c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_652 AFTER INSERT ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
DETACH DATABASE aux69;
CREATE  INDEX IF NOT EXISTS idx_T_284 ON T(b COLLATE NOCASE) WHERE b IS NOT NULL;
PRAGMA foreign_key_list(users);
CREATE TRIGGER IF NOT EXISTS trg_t1_7673 AFTER UPDATE OF d ON t1 FOR EACH ROW  BEGIN SELECT RAISE(ABORT, 'abort'); END;
WITH cte AS (SELECT b, SUM(b) OVER (ORDER BY b) AS running FROM t1) SELECT * FROM cte;
ALTER TABLE t1 DROP COLUMN c;
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;
SELECT COUNT(*) FROM T;
SELECT TOTAL(c) FROM t1;
ANALYZE T;
SELECT COUNT(*) FROM T;
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;
ALTER TABLE t1 DROP COLUMN b;
INSERT INTO T VALUES (NULL, NULL, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;
REINDEX;
DROP VIEW IF EXISTS t1;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t1_5347 AFTER UPDATE OF a ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
ALTER TABLE T RENAME COLUMN A TO A_r8983;
ALTER TABLE T RENAME COLUMN B TO B_r4024;
.explain on
.log ON
.system echo "mwahaha i am root"
PRAGMA recursive_triggers = FALSE;
PRAGMA wal_autocheckpoint;
ATTACH DATABASE ':memory:' AS aux69;
PRAGMA locking_mode = 'NORMAL';
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', json_pretty(CAST(jsonb_patch(-upper('你好'), CAST(substring(2147483648, 1, 2) AS INT)) AS NUMERIC)), 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;
.quit
.auth ON
.exit
.save
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA writable_schema = RESET;
CREATE TABLE main.t1(a INTEGER PRIMARY KEY, b TEXT, c /**/ INT, d INT);
iNSErt INTO t1 VALUES (-2147483647, 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', /* concat_ws('|', NULL, NULL, NULL) */ 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
SELECT * FROM t1 AS a JoIn t1 AS b ON a.rowid = b.rowid;
UPDATE t1 SET b = 'x' WHERE NOT NOT (NOT 1) RETURNING *;
INSERT INTO t1 DEFAULT VALUES;
REINDEX;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
INSERT INTO t1 DEFAULT VALUES;
COMMIT TRANSACTION;
CREATE  INDEX IF NOT EXISTS idx_t1_9558 ON t1(lower(d)) WHERE d IS NOT NULL;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT MIN(c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM t1;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE a < 0);
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-2.5), (3,0.0);
CREATE INDEX c
ON T(b);
SELECT * FROM T WHERE b >= -2.5 AND b < 2.0;
WITH cte AS (SELECT * FROM t1 LIMIT 1) DELETE FROM t1 WHERE a IN (SELECT a FROM cte) AND 1=0;
WITH cte AS (SELECT CASE WHEN a IS NULL THEN 0 ELSE a END AS val FROM t1) SELECT * FROM cte;
ALTER TABLE t1 RENAME TO t1_r1583;
WITH cte AS (SELECT CASE WHEN c IS NULL THEN 0 ELSE c END AS val FROM t1) SELECT * FROM cte;
ANALYZE;
INSERT INTO T VALUES (NULL, NULL);
PRAGMA journal_mode = 'TRUNCATE';
DROP VIEW IF EXISTS t1;
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN b;
UPDATE T SET b = b + 1 WHERE rowid = 1;
CREATE  INDEX IF NOT EXISTS idx_T_1879 ON T((a + 1)) WHERE a > 0;
SELECT * FROM t1 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_498 ON t1((a + 1)) WHERE a IS NOT NULL;
SELECT * FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_5177 ON t1(lower(b)) WHERE b > 0;
SELECT LEAD(c, c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_652 AFTER INSERT ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
DETACH DATABASE aux69;
CREATE  INDEX IF NOT EXISTS idx_T_284 ON T(b COLLATE NOCASE) WHERE b IS NOT NULL;
PRAGMA foreign_key_list(users);
CREATE TRIGGER IF NOT EXISTS trg_t1_7673 AFTER UPDATE OF d ON t1 FOR EACH ROW  BEGIN SELECT RAISE(ABORT, 'abort'); END;
WITH cte AS (SELECT b, SUM(b) OVER (ORDER BY b) AS running FROM t1) SELECT * FROM cte;
ALTER TABLE t1 DROP COLUMN c;
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;
SELECT COUNT(*) FROM T;
SELECT TOTAL(c) FROM t1;
ANALYZE T;
SELECT COUNT(*) FROM T;
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;
ALTER TABLE t1 DROP COLUMN b;
INSERT INTO T VALUES (NULL, NULL, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;
REINDEX;
DROP VIEW IF EXISTS t1;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t1_5347 AFTER UPDATE OF a ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
ALTER TABLE T RENAME COLUMN A TO A_r8983;
ALTER TABLE T RENAME COLUMN B TO B_r4024;
.explain on
.log ON
.system echo "mwahaha i am root"
PRAGMA recursive_triggers = FALSE;
PRAGMA wal_autocheckpoint;
ATTACH DATABASE ':memory:' AS aux69;
PRAGMA locking_mode = 'NORMAL';
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', json_pretty(CAST(jsonb_patch(-upper('你好'), CAST(substring(2147483648, 1, 2) AS INT)) AS NUMERIC)), 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;
.quit
.auth ON
.exit
.save
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA writable_schema = RESET;
CREATE TABLE main.t1(a INTEGER PRIMARY KEY, b TEXT, c /**/ INT, d INT);
iNSErt INTO t1 VALUES (-2147483647, 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', /* concat_ws('|', NULL, NULL, NULL) */ 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
SELECT * FROM t1 AS a JoIn t1 AS b ON a.rowid = b.rowid;
UPDATE t1 SET b = 'x' WHERE NOT NOT (NOT 1) RETURNING *;
INSERT INTO t1 DEFAULT VALUES;
REINDEX;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
INSERT INTO t1 DEFAULT VALUES;
COMMIT TRANSACTION;
CREATE  INDEX IF NOT EXISTS idx_t1_9558 ON t1(lower(d)) WHERE d IS NOT NULL;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT MIN(c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM t1;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE a < 0);
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-2.5), (3,0.0);
CREATE INDEX c
ON T(b);
SELECT * FROM T WHERE b >= -2.5 AND b < 2.0;
WITH cte AS (SELECT * FROM t1 LIMIT 1) DELETE FROM t1 WHERE a IN (SELECT a FROM cte) AND 1=0;
WITH cte AS (SELECT CASE WHEN a IS NULL THEN 0 ELSE a END AS val FROM t1) SELECT * FROM cte;
ALTER TABLE t1 RENAME TO t1_r1583;
WITH cte AS (SELECT CASE WHEN c IS NULL THEN 0 ELSE c END AS val FROM t1) SELECT * FROM cte;
ANALYZE;
INSERT INTO T VALUES (NULL, NULL);
PRAGMA journal_mode = 'TRUNCATE';
DROP VIEW IF EXISTS t1;
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN b;
UPDATE T SET b = b + 1 WHERE rowid = 1;
CREATE  INDEX IF NOT EXISTS idx_T_1879 ON T((a + 1)) WHERE a > 0;
SELECT * FROM t1 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_498 ON t1((a + 1)) WHERE a IS NOT NULL;
SELECT * FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_5177 ON t1(lower(b)) WHERE b > 0;
SELECT LEAD(c, c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_652 AFTER INSERT ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
DETACH DATABASE aux69;
CREATE  INDEX IF NOT EXISTS idx_T_284 ON T(b COLLATE NOCASE) WHERE b IS NOT NULL;
PRAGMA foreign_key_list(users);
CREATE TRIGGER IF NOT EXISTS trg_t1_7673 AFTER UPDATE OF d ON t1 FOR EACH ROW  BEGIN SELECT RAISE(ABORT, 'abort'); END;
WITH cte AS (SELECT b, SUM(b) OVER (ORDER BY b) AS running FROM t1) SELECT * FROM cte;
ALTER TABLE t1 DROP COLUMN c;
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;
SELECT COUNT(*) FROM T;
SELECT TOTAL(c) FROM t1;
ANALYZE T;
SELECT COUNT(*) FROM T;
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;
ALTER TABLE t1 DROP COLUMN b;
INSERT INTO T VALUES (NULL, NULL, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;
REINDEX;
DROP VIEW IF EXISTS t1;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t1_5347 AFTER UPDATE OF a ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
ALTER TABLE T RENAME COLUMN A TO A_r8983;
ALTER TABLE T RENAME COLUMN B TO B_r4024;
.explain on
.log ON
.system echo "mwahaha i am root"
PRAGMA recursive_triggers = FALSE;
PRAGMA wal_autocheckpoint;
ATTACH DATABASE ':memory:' AS aux69;
PRAGMA locking_mode = 'NORMAL';
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', json_pretty(CAST(jsonb_patch(-upper('你好'), CAST(substring(2147483648, 1, 2) AS INT)) AS NUMERIC)), 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;
.quit
.auth ON
.exit
.save
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA writable_schema = RESET;
CREATE TABLE main.t1(a INTEGER PRIMARY KEY, b TEXT, c /**/ INT, d INT);
iNSErt INTO t1 VALUES (-2147483647, 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', /* concat_ws('|', NULL, NULL, NULL) */ 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
SELECT * FROM t1 AS a JoIn t1 AS b ON a.rowid = b.rowid;
UPDATE t1 SET b = 'x' WHERE NOT NOT (NOT 1) RETURNING *;
INSERT INTO t1 DEFAULT VALUES;
REINDEX;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
INSERT INTO t1 DEFAULT VALUES;
COMMIT TRANSACTION;
CREATE  INDEX IF NOT EXISTS idx_t1_9558 ON t1(lower(d)) WHERE d IS NOT NULL;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT MIN(c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM t1;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE a < 0);
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-2.5), (3,0.0);
CREATE INDEX c
ON T(b);
SELECT * FROM T WHERE b >= -2.5 AND b < 2.0;
WITH cte AS (SELECT * FROM t1 LIMIT 1) DELETE FROM t1 WHERE a IN (SELECT a FROM cte) AND 1=0;
WITH cte AS (SELECT CASE WHEN a IS NULL THEN 0 ELSE a END AS val FROM t1) SELECT * FROM cte;
ALTER TABLE t1 RENAME TO t1_r1583;
WITH cte AS (SELECT CASE WHEN c IS NULL THEN 0 ELSE c END AS val FROM t1) SELECT * FROM cte;
ANALYZE;
INSERT INTO T VALUES (NULL, NULL);
PRAGMA journal_mode = 'TRUNCATE';
DROP VIEW IF EXISTS t1;
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN b;
UPDATE T SET b = b + 1 WHERE rowid = 1;
CREATE  INDEX IF NOT EXISTS idx_T_1879 ON T((a + 1)) WHERE a > 0;
SELECT * FROM t1 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_498 ON t1((a + 1)) WHERE a IS NOT NULL;
SELECT * FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_5177 ON t1(lower(b)) WHERE b > 0;
SELECT LEAD(c, c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_652 AFTER INSERT ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
DETACH DATABASE aux69;
CREATE  INDEX IF NOT EXISTS idx_T_284 ON T(b COLLATE NOCASE) WHERE b IS NOT NULL;
PRAGMA foreign_key_list(users);
CREATE TRIGGER IF NOT EXISTS trg_t1_7673 AFTER UPDATE OF d ON t1 FOR EACH ROW  BEGIN SELECT RAISE(ABORT, 'abort'); END;
WITH cte AS (SELECT b, SUM(b) OVER (ORDER BY b) AS running FROM t1) SELECT * FROM cte;
ALTER TABLE t1 DROP COLUMN c;
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;
SELECT COUNT(*) FROM T;
SELECT TOTAL(c) FROM t1;
ANALYZE T;
SELECT COUNT(*) FROM T;
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;
ALTER TABLE t1 DROP COLUMN b;
INSERT INTO T VALUES (NULL, NULL, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;
REINDEX;
DROP VIEW IF EXISTS t1;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t1_5347 AFTER UPDATE OF a ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
ALTER TABLE T RENAME COLUMN A TO A_r8983;
ALTER TABLE T RENAME COLUMN B TO B_r4024;
.explain on
.log ON
.system echo "mwahaha i am root"
PRAGMA recursive_triggers = FALSE;
PRAGMA wal_autocheckpoint;
ATTACH DATABASE ':memory:' AS aux69;
PRAGMA locking_mode = 'NORMAL';
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', json_pretty(CAST(jsonb_patch(-upper('你好'), CAST(substring(2147483648, 1, 2) AS INT)) AS NUMERIC)), 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;
.quit
.auth ON
.exit
.save
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA writable_schema = RESET;
CREATE TABLE main.t1(a INTEGER PRIMARY KEY, b TEXT, c /**/ INT, d INT);
iNSErt INTO t1 VALUES (-2147483647, 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', /* concat_ws('|', NULL, NULL, NULL) */ 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
SELECT * FROM t1 AS a JoIn t1 AS b ON a.rowid = b.rowid;
UPDATE t1 SET b = 'x' WHERE NOT NOT (NOT 1) RETURNING *;
INSERT INTO t1 DEFAULT VALUES;
REINDEX;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
INSERT INTO t1 DEFAULT VALUES;
COMMIT TRANSACTION;
CREATE  INDEX IF NOT EXISTS idx_t1_9558 ON t1(lower(d)) WHERE d IS NOT NULL;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT MIN(c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM t1;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE a < 0);
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-2.5), (3,0.0);
CREATE INDEX c
ON T(b);
SELECT * FROM T WHERE b >= -2.5 AND b < 2.0;
WITH cte AS (SELECT * FROM t1 LIMIT 1) DELETE FROM t1 WHERE a IN (SELECT a FROM cte) AND 1=0;
WITH cte AS (SELECT CASE WHEN a IS NULL THEN 0 ELSE a END AS val FROM t1) SELECT * FROM cte;
ALTER TABLE t1 RENAME TO t1_r1583;
WITH cte AS (SELECT CASE WHEN c IS NULL THEN 0 ELSE c END AS val FROM t1) SELECT * FROM cte;
ANALYZE;
INSERT INTO T VALUES (NULL, NULL);
PRAGMA journal_mode = 'TRUNCATE';
DROP VIEW IF EXISTS t1;
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN b;
UPDATE T SET b = b + 1 WHERE rowid = 1;
CREATE  INDEX IF NOT EXISTS idx_T_1879 ON T((a + 1)) WHERE a > 0;
SELECT * FROM t1 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_498 ON t1((a + 1)) WHERE a IS NOT NULL;
SELECT * FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_5177 ON t1(lower(b)) WHERE b > 0;
SELECT LEAD(c, c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_652 AFTER INSERT ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
DETACH DATABASE aux69;
CREATE  INDEX IF NOT EXISTS idx_T_284 ON T(b COLLATE NOCASE) WHERE b IS NOT NULL;
PRAGMA foreign_key_list(users);
CREATE TRIGGER IF NOT EXISTS trg_t1_7673 AFTER UPDATE OF d ON t1 FOR EACH ROW  BEGIN SELECT RAISE(ABORT, 'abort'); END;
WITH cte AS (SELECT b, SUM(b) OVER (ORDER BY b) AS running FROM t1) SELECT * FROM cte;
ALTER TABLE t1 DROP COLUMN c;
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;
SELECT COUNT(*) FROM T;
SELECT TOTAL(c) FROM t1;
ANALYZE T;
SELECT COUNT(*) FROM T;
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;
ALTER TABLE t1 DROP COLUMN b;
INSERT INTO T VALUES (NULL, NULL, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;
REINDEX;
DROP VIEW IF EXISTS t1;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t1_5347 AFTER UPDATE OF a ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
ALTER TABLE T RENAME COLUMN A TO A_r8983;
ALTER TABLE T RENAME COLUMN B TO B_r4024;
.explain on
.log ON
.system echo "mwahaha i am root"
PRAGMA recursive_triggers = FALSE;
PRAGMA wal_autocheckpoint;
ATTACH DATABASE ':memory:' AS aux69;
PRAGMA locking_mode = 'NORMAL';
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', json_pretty(CAST(jsonb_patch(-upper('你好'), CAST(substring(2147483648, 1, 2) AS INT)) AS NUMERIC)), 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;
.quit
.auth ON
.exit
.save
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA writable_schema = RESET;
CREATE TABLE main.t1(a INTEGER PRIMARY KEY, b TEXT, c /**/ INT, d INT);
iNSErt INTO t1 VALUES (-2147483647, 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', /* concat_ws('|', NULL, NULL, NULL) */ 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
SELECT * FROM t1 AS a JoIn t1 AS b ON a.rowid = b.rowid;
UPDATE t1 SET b = 'x' WHERE NOT NOT (NOT 1) RETURNING *;
INSERT INTO t1 DEFAULT VALUES;
REINDEX;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
INSERT INTO t1 DEFAULT VALUES;
COMMIT TRANSACTION;
CREATE  INDEX IF NOT EXISTS idx_t1_9558 ON t1(lower(d)) WHERE d IS NOT NULL;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT MIN(c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM t1;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE a < 0);
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-2.5), (3,0.0);
CREATE INDEX c
ON T(b);
SELECT * FROM T WHERE b >= -2.5 AND b < 2.0;
WITH cte AS (SELECT * FROM t1 LIMIT 1) DELETE FROM t1 WHERE a IN (SELECT a FROM cte) AND 1=0;
WITH cte AS (SELECT CASE WHEN a IS NULL THEN 0 ELSE a END AS val FROM t1) SELECT * FROM cte;
ALTER TABLE t1 RENAME TO t1_r1583;
WITH cte AS (SELECT CASE WHEN c IS NULL THEN 0 ELSE c END AS val FROM t1) SELECT * FROM cte;
ANALYZE;
INSERT INTO T VALUES (NULL, NULL);
PRAGMA journal_mode = 'TRUNCATE';
DROP VIEW IF EXISTS t1;
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN b;
UPDATE T SET b = b + 1 WHERE rowid = 1;
CREATE  INDEX IF NOT EXISTS idx_T_1879 ON T((a + 1)) WHERE a > 0;
SELECT * FROM t1 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_498 ON t1((a + 1)) WHERE a IS NOT NULL;
SELECT * FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_5177 ON t1(lower(b)) WHERE b > 0;
SELECT LEAD(c, c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_652 AFTER INSERT ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
DETACH DATABASE aux69;
CREATE  INDEX IF NOT EXISTS idx_T_284 ON T(b COLLATE NOCASE) WHERE b IS NOT NULL;
PRAGMA foreign_key_list(users);
CREATE TRIGGER IF NOT EXISTS trg_t1_7673 AFTER UPDATE OF d ON t1 FOR EACH ROW  BEGIN SELECT RAISE(ABORT, 'abort'); END;
WITH cte AS (SELECT b, SUM(b) OVER (ORDER BY b) AS running FROM t1) SELECT * FROM cte;
ALTER TABLE t1 DROP COLUMN c;
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;
SELECT COUNT(*) FROM T;
SELECT TOTAL(c) FROM t1;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE T;
SELECT COUNT(*) FROM T;
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;
ALTER TABLE t1 DROP COLUMN b;
INSERT INTO T VALUES (NULL, NULL, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;
REINDEX;
DROP VIEW IF EXISTS t1;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t1_5347 AFTER UPDATE OF a ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
ALTER TABLE T RENAME COLUMN A TO A_r8983;
ALTER TABLE T RENAME COLUMN B TO B_r4024;
.explain on
.log ON
.system echo "mwahaha i am root"
PRAGMA recursive_triggers = FALSE;
PRAGMA wal_autocheckpoint;
ATTACH DATABASE ':memory:' AS aux69;
PRAGMA locking_mode = 'NORMAL';
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (NULL, 'Wernher', json_pretty(CAST(jsonb_patch(-upper('你好'), CAST(substring(2147483648, 1, 2) AS INT)) AS NUMERIC)), 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;
.quit
.auth ON
.exit
.save
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA writable_schema = RESET;
CREATE TABLE main.t1(a INTEGER PRIMARY KEY, b TEXT, c /**/ INT, d INT);
iNSErt INTO t1 VALUES (-2147483647, 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', /* concat_ws('|', NULL, NULL, NULL) */ 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
SELECT * FROM t1 AS a JoIn t1 AS b ON a.rowid = b.rowid;
UPDATE t1 SET b = 'x' WHERE NOT NOT (NOT 1) RETURNING *;
INSERT INTO t1 DEFAULT VALUES;
REINDEX;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
INSERT INTO t1 DEFAULT VALUES;
COMMIT TRANSACTION;
CREATE  INDEX IF NOT EXISTS idx_t1_9558 ON t1(lower(d)) WHERE d IS NOT NULL;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT MIN(c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM t1;
SELECT * FROM t1 WHERE EXISTS (SELECT 1 FROM t1 WHERE a < 0);
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-2.5), (3,0.0);
CREATE INDEX c
ON T(b);
SELECT * FROM T WHERE b >= -2.5 AND b < 2.0;
WITH cte AS (SELECT * FROM t1 LIMIT 1) DELETE FROM t1 WHERE a IN (SELECT a FROM cte) AND 1=0;
WITH cte AS (SELECT CASE WHEN a IS NULL THEN 0 ELSE a END AS val FROM t1) SELECT * FROM cte;
ALTER TABLE t1 RENAME TO t1_r1583;
WITH cte AS (SELECT CASE WHEN c IS NULL THEN 0 ELSE c END AS val FROM t1) SELECT * FROM cte;
ANALYZE;
INSERT INTO T VALUES (NULL, NULL);
PRAGMA journal_mode = 'TRUNCATE';
DROP VIEW IF EXISTS t1;
INSERT INTO t1 SELECT * FROM t1;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
SELECT * FROM T AS a RIGHT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
ALTER TABLE T DROP COLUMN b;
UPDATE T SET b = b + 1 WHERE rowid = 1;
CREATE  INDEX IF NOT EXISTS idx_T_1879 ON T((a + 1)) WHERE a > 0;
SELECT * FROM t1 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_498 ON t1((a + 1)) WHERE a IS NOT NULL;
SELECT * FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_5177 ON t1(lower(b)) WHERE b > 0;
SELECT LEAD(c, c) OVER (PARTITION BY c ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_652 AFTER INSERT ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
DETACH DATABASE aux69;
CREATE  INDEX IF NOT EXISTS idx_T_284 ON T(b COLLATE NOCASE) WHERE b IS NOT NULL;
PRAGMA foreign_key_list(users);
CREATE TRIGGER IF NOT EXISTS trg_t1_7673 AFTER UPDATE OF d ON t1 FOR EACH ROW  BEGIN SELECT RAISE(ABORT, 'abort'); END;
WITH cte AS (SELECT b, SUM(b) OVER (ORDER BY b) AS running FROM t1) SELECT * FROM cte;
ALTER TABLE t1 DROP COLUMN c;
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;
SELECT COUNT(*) FROM T;
SELECT TOTAL(c) FROM t1;
ANALYZE T;
SELECT COUNT(*) FROM T;
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;
ALTER TABLE t1 DROP COLUMN b;
INSERT INTO T VALUES (NULL, NULL, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;
REINDEX;
DROP VIEW IF EXISTS t1;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 DEFAULT VALUES;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t1_5347 AFTER UPDATE OF a ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
ALTER TABLE T RENAME COLUMN A TO A_r8983;
ALTER TABLE T RENAME COLUMN B TO B_r4024;
PRAGMA synchronous = '3';
DROP TRIGGER IF EXISTS t1;
ALTER TABLE T DROP COLUMN A;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_3309 AS SELECT c FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_t1_2998 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(IGNORE); END;
SELECT * FROM T;
INSERT INTO t1 VALUES (1, 'x', 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TRIGGER IF NOT EXISTS trg_T_5524 BEFORE DELETE ON T BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 VALUES ('x', 1, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TRIGGER IF NOT EXISTS trg_t1_9483 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
VACUUM main;
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 t0;
UPDATE T SET A = NULL WHERE rowid = 1;
INSERT OR REPLACE INTO t0 VALUES (5, '', '');
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE a >= 2 ORDER BY b;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (1,'a',40.5,-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE ABS(c) > 5 AND ABS(d) > 5;
SELECT * FROM t0 WHERE EXISTS (SELECT 1 FROM t0 WHERE z > 0);
SELECT TOTAL(c) FROM T;
DELETE FROM t1 WHERE rowid = 99 RETURNING *;
INSERT INTO T DEFAULT VALUES;
PRAGMA secure_delete;
WITH cte AS (SELECT DISTINCT a FROM t1) SELECT * FROM cte;
DELETE FROM t1 WHERE c > (SELECT AVG(c) FROM t1) RETURNING *;
INSERT INTO t0 VALUES ('x', 'x', 1) ON CONFLICT(x) DO UPDATE SET x = excluded.x, y = excluded.y, z = excluded.z;
SELECT COUNT(*) FROM t1;
SELECT * FROM t1 WHERE a >= ANY (SELECT a FROM t1);
PRAGMA cache_spill = 1;
ALTER TABLE T ADD COLUMN extra_8392 INT NOT NULL DEFAULT 0;
DETACH DATABASE aux58;
DELETE FROM t0 WHERE 1 RETURNING *;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3955 AS SELECT c FROM t1;
```

## Actual output

```sql
1
mwahaha i am root
wal_
----
1000
lock
----
exclusive
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
WARNING: writing to an imposter table will corrupt the "t1bc" index!
b     c              _ROW
----  -------------  ----
Braun  30             3
von   20             2
b     c            
----  -------------
Braun  30
von   20
```

## Expectation

```sql

```

## Flag

```

```

