## 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 aux92;
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;
.trace
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE main.t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (CAST(substr(NULL, if(strftime((('%Y-%m-%d' || '') || ''), json_quote(json_object())), 9223372036854775808, 1/0), 1) AS TEXT), 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
SELECT COUNT(*) FILTER (WHERE NOT NOT (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) ;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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 /* PRAGMA vdbe_listing = TRUE; */ b, c FROM t1 ORDER BY b, c;

.quit
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM t1;

INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT LAG(c, 0) OVER (ORDER BY c ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;
ANALYZE t1;
UPDATE t1 SET c = CURRENT_TIMESTAMP WHERE 1;
ANALYZE t1;
SELECT * FROM t1 AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS t1;
REINDEX;
DROP TRIGGER IF EXISTS t1;
DROP TRIGGER IF EXISTS t1;
VACUUM;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE 1;
ALTER TABLE t1 RENAME TO t1_r9484;
CREATE  INDEX IF NOT EXISTS idx_t1_6117 ON t1((b + 1)) WHERE b > 0;
CREATE  INDEX IF NOT EXISTS idx_t1_2229 ON t1(c) WHERE c IS NOT NULL;
INSERT INTO t1 DEFAULT VALUES;
DROP TABLE IF EXISTS t1;
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','b'), ('c','d');
SELECT * FROM T WHERE a = REPLACE('a;',';','') AND b = 'b';
SELECT * FROM t1 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
WITH RECURSIVE r AS (SELECT b FROM T WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 0 LIMIT 10) SELECT * FROM r;
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;
ALTER TABLE t1 RENAME TO t1_r4048;
SELECT * FROM T AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE main.t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (CAST(substr(NULL, if(strftime((('%Y-%m-%d' || '') || ''), json_quote(1)), 9223372036854775808, 1/0), 1) AS TEXT), 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM t1;

INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT LAG(c, 0) OVER (ORDER BY c ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;
ANALYZE t1;
UPDATE t1 SET c = CURRENT_TIMESTAMP WHERE 1;
ANALYZE t1;
SELECT * FROM t1 AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS t1;
REINDEX;
DROP TRIGGER IF EXISTS t1;
DROP TRIGGER IF EXISTS t1;
VACUUM;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE 1;
ALTER TABLE t1 RENAME TO t1_r9484;
CREATE  INDEX IF NOT EXISTS idx_t1_6117 ON t1((b + 1)) WHERE b > 0;
CREATE  INDEX IF NOT EXISTS idx_t1_2229 ON t1(c) WHERE c IS NOT NULL;
INSERT INTO t1 DEFAULT VALUES;
DROP TABLE IF EXISTS t1;
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','b'), ('c','d');
SELECT * FROM T WHERE a = REPLACE('a;',';','') AND b = 'b';
SELECT * FROM t1 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
WITH RECURSIVE r AS (SELECT b FROM T WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 0 LIMIT 10) SELECT * FROM r;
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;
ALTER TABLE t1 RENAME TO t1_r4048;
SELECT * FROM T AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE main.t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (CAST(substr(NULL, if(strftime((('%Y-%m-%d' || '') || ''), json_quote(1)), 9223372036854775808, 1/0), 1) AS TEXT), 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM t1;

INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT LAG(c, 0) OVER (ORDER BY c ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;
ANALYZE t1;
UPDATE t1 SET c = CURRENT_TIMESTAMP WHERE 1;
ANALYZE t1;
SELECT * FROM t1 AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS t1;
REINDEX;
DROP TRIGGER IF EXISTS t1;
DROP TRIGGER IF EXISTS t1;
VACUUM;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE 1;
ALTER TABLE t1 RENAME TO t1_r9484;
CREATE  INDEX IF NOT EXISTS idx_t1_6117 ON t1((b + 1)) WHERE b > 0;
CREATE  INDEX IF NOT EXISTS idx_t1_2229 ON t1(c) WHERE c IS NOT NULL;
INSERT INTO t1 DEFAULT VALUES;
DROP TABLE IF EXISTS t1;
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','b'), ('c','d');
SELECT * FROM T WHERE a = REPLACE('a;',';','') AND b = 'b';
SELECT * FROM t1 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
WITH RECURSIVE r AS (SELECT b FROM T WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 0 LIMIT 10) SELECT * FROM r;
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;
ALTER TABLE t1 RENAME TO t1_r4048;
SELECT * FROM T AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE main.t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (CAST(substr(NULL, if(strftime((('%Y-%m-%d' || '') || ''), json_quote(1)), 9223372036854775808, 1/0), 1) AS TEXT), 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM t1;

INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT LAG(c, 0) OVER (ORDER BY c ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;
ANALYZE t1;
UPDATE t1 SET c = CURRENT_TIMESTAMP WHERE 1;
ANALYZE t1;
SELECT * FROM t1 AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS t1;
REINDEX;
DROP TRIGGER IF EXISTS t1;
DROP TRIGGER IF EXISTS t1;
VACUUM;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE 1;
ALTER TABLE t1 RENAME TO t1_r9484;
CREATE  INDEX IF NOT EXISTS idx_t1_6117 ON t1((b + 1)) WHERE b > 0;
CREATE  INDEX IF NOT EXISTS idx_t1_2229 ON t1(c) WHERE c IS NOT NULL;
INSERT INTO t1 DEFAULT VALUES;
DROP TABLE IF EXISTS t1;
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','b'), ('c','d');
SELECT * FROM T WHERE a = REPLACE('a;',';','') AND b = 'b';
SELECT * FROM t1 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
WITH RECURSIVE r AS (SELECT b FROM T WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 0 LIMIT 10) SELECT * FROM r;
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;
ALTER TABLE t1 RENAME TO t1_r4048;
SELECT * FROM T AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE main.t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (CAST(substr(NULL, if(strftime((('%Y-%m-%d' || '') || ''), json_quote(1)), 9223372036854775808, 1/0), 1) AS TEXT), 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM t1;

INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT LAG(c, 0) OVER (ORDER BY c ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;
ANALYZE t1;
UPDATE t1 SET c = CURRENT_TIMESTAMP WHERE 1;
ANALYZE t1;
SELECT * FROM t1 AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS t1;
REINDEX;
DROP TRIGGER IF EXISTS t1;
DROP TRIGGER IF EXISTS t1;
VACUUM;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE 1;
ALTER TABLE t1 RENAME TO t1_r9484;
CREATE  INDEX IF NOT EXISTS idx_t1_6117 ON t1((b + 1)) WHERE b > 0;
CREATE  INDEX IF NOT EXISTS idx_t1_2229 ON t1(c) WHERE c IS NOT NULL;
INSERT INTO t1 DEFAULT VALUES;
DROP TABLE IF EXISTS t1;
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','b'), ('c','d');
SELECT * FROM T WHERE a = REPLACE('a;',';','') AND b = 'b';
SELECT * FROM t1 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
WITH RECURSIVE r AS (SELECT b FROM T WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 0 LIMIT 10) SELECT * FROM r;
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;
ALTER TABLE t1 RENAME TO t1_r4048;
SELECT * FROM T AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE main.t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (CAST(substr(NULL, if(strftime((('%Y-%m-%d' || '') || ''), json_quote(1)), 9223372036854775808, 1/0), 1) AS TEXT), 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
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;
SAVEPOINT sp2029;
-- PRAGMA foreign_key_check;

CREATE TABLE t1(a TEXT PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (1, 'Wernher', 10, 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
ROLLBACK TRANSACTION TO SAVEPOINT sp2029;
RELEASE SAVEPOINT sp2029;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM t1;

INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT LAG(c, 0) OVER (ORDER BY c ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;
ANALYZE t1;
UPDATE t1 SET c = CURRENT_TIMESTAMP WHERE 1;
ANALYZE t1;
SELECT * FROM t1 AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS t1;
REINDEX;
DROP TRIGGER IF EXISTS t1;
DROP TRIGGER IF EXISTS t1;
VACUUM;
UPDATE t1 SET d = CURRENT_TIMESTAMP WHERE 1;
ALTER TABLE t1 RENAME TO t1_r9484;
CREATE  INDEX IF NOT EXISTS idx_t1_6117 ON t1((b + 1)) WHERE b > 0;
CREATE  INDEX IF NOT EXISTS idx_t1_2229 ON t1(c) WHERE c IS NOT NULL;
INSERT INTO t1 DEFAULT VALUES;
DROP TABLE IF EXISTS t1;
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','b'), ('c','d');
SELECT * FROM T WHERE a = REPLACE('a;',';','') AND b = 'b';
SELECT * FROM t1 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
WITH RECURSIVE r AS (SELECT b FROM T WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 0 LIMIT 10) SELECT * FROM r;
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;
ALTER TABLE t1 RENAME TO t1_r4048;
SELECT * FROM T AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;

ALTER TABLE T RENAME TO T_r3768;
SELECT b FROM t1 INTERSECT SELECT b FROM (SELECT * FROM t1) AS sub;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte a, cte b WHERE a.b = b.b;
SELECT * FROM t1 AS a FULL JOIN t1 AS b ON a.rowid = b.rowid;
INSERT INTO T VALUES (NULL, NULL);
INSERT INTO T SELECT * FROM T;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (PARTITION BY a ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;

SELECT COUNT(*) FROM T;
UPDATE t1 SET a = NULL WHERE rowid = 1 RETURNING *;
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT NTH_VALUE(a, 2) OVER (PARTITION BY a ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM T;
DETACH DATABASE aux92;
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;
DELETE FROM T WHERE 0;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
ALTER TABLE t1 RENAME TO t1_r4235;
```

## Actual output

```sql
âââââ¬ââââ
â B â D â
âââââ¼ââââ¤
â q â 2 â
â r â 2 â
â p â 1 â
â t â 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!
âââââââââ¬âââââ¬ââââââââââ
â   b   â c  â _ROWID_ â
âââââââââ¼âââââ¼ââââââââââ¤
â Braun â 30 â 2       â
â von   â 20 â 1       â
âââââââââ´âââââ´ââââââââââ
âââââââââ¬âââââ
â   b   â c  â
âââââââââ¼âââââ¤
â Braun â 30 â
â von   â 20 â
âââââââââ´âââââ
```

## Expectation

```sql

```

## Flag

```
-box
```

