## 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
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (round(NULL, 2),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;
.expert
BEGIN IMMEDIATE TRANSACTION;
CREATE TABLE t1(a INT2 PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (floor(sinh(1.0)), '' || ('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
.log stdout
ATTACH DATABASE ('' || ('') || (':memory:') || '') AS aux2;
ATTACH DATABASE (':memory:' || '') AS aux16;
PRAGMA parser_trace = NO;
BEGIN DEFERRED;
.exit -CAST(-soundex('') AS DECIMAL(json(CAST(json_patch((((time('.') + 0.0) - 0) * 1), '{"key": null}') AS BLOB)),5))
BEGIN DEFERRED TRANSACTION;
BEGIN;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT NOT (NOT NOT NOT (NOT ABS(c) > 5 AND ABS(d) > 5)) ;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE main.t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE +x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 FULL OUTER JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT ABS(c) > 5 AND ABS(d) > 5;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','2020-01-01'), ('b','2026-01-01');
SELECT a,
CAST(
  (julianday('now')-julianday(b))/365.25
  AS INTEGER
) AS c
FROM T;
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
END TRANSACTION;
COMMIT TRANSACTION;
SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT d FROM t1 UNION SELECT d FROM t1) SELECT * FROM cte;
UPDATE T SET d = '' WHERE 1 RETURNING *;
ROLLBACK;
SELECT * FROM t1 WHERE c NOT IN (SELECT c FROM t1 WHERE c IS NULL);
CREATE  INDEX IF NOT EXISTS idx_t1_4644 ON t1((c + 1)) WHERE c IS NOT NULL;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
ALTER TABLE T RENAME COLUMN d TO d_r6340;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_5035 AS SELECT a FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_6261 BEFORE DELETE ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
ALTER TABLE t1 RENAME COLUMN d TO d_r3285;
SELECT AVG(c) FILTER (WHERE c != 0) OVER (ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM T;
SELECT PERCENT_RANK() OVER (ORDER BY b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T;
REINDEX;
INSERT INTO T SELECT * FROM T;
DROP INDEX IF EXISTS t1;
PRAGMA empty_result_callbacks = FALSE;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
INSERT INTO t1 VALUES (1, 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
ALTER TABLE T DROP COLUMN d;
SELECT * FROM T WHERE d > (SELECT AVG(d) FROM T);
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT c, SUM(c) AS total FROM t1 GROUP BY c) SELECT * FROM cte ORDER BY total DESC;
DETACH DATABASE aux16;
ALTER TABLE t1 DROP COLUMN c;
INSERT INTO T SELECT * FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5482 AS SELECT c FROM t1;
INSERT INTO T SELECT * FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_4883 ON T(lower(a)) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_T_7245 AFTER UPDATE ON T BEGIN SELECT RAISE(IGNORE); END;
INSERT INTO T VALUES (NULL, NULL);
SELECT * FROM T CROSS JOIN T;
DETACH DATABASE aux2;

SELECT COUNT(*) FROM T;
SELECT COUNT(a) FROM t1;
DROP VIEW IF EXISTS t1;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T);
DROP VIEW IF EXISTS T;
PRAGMA checkpoint_fullsync = NO;
ALTER TABLE t1 RENAME COLUMN c TO c_r5230;
DELETE FROM T WHERE 0;
INSERT OR IGNORE INTO T VALUES (NULL, '');
ALTER TABLE t1 DROP COLUMN a;
DROP VIEW IF EXISTS t1;
SELECT TOTAL(b) FROM t1;
.log stdout
ATTACH DATABASE ('' || (':memory:') || '') AS aux2;
ATTACH DATABASE (':memory:' || '') AS aux16;
PRAGMA parser_trace = NO;
BEGIN DEFERRED;
.exit -CAST(-soundex('') AS DECIMAL(json(CAST(json_patch((3.141592653589793 * 1), '{"key": null}') AS BLOB)),5))
BEGIN DEFERRED TRANSACTION;
BEGIN;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT NOT (NOT ABS(c) > 5 OR ABS(d) > 5) ;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 NATURAL JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT ABS(c) > 5 AND ABS(d) > 5;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','2020-01-01'), ('b','2026-01-01');
SELECT a,
CAST(
  (julianday('now')-julianday(b))/365.25
  AS INTEGER
) AS c
FROM T;
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
END TRANSACTION;
COMMIT TRANSACTION;
SELECT *
FROM t1;
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT d FROM t1 UNION SELECT d FROM t1) SELECT * FROM cte;
UPDATE T SET d = '' WHERE 1 RETURNING *;
ROLLBACK;
SELECT * FROM t1 WHERE c NOT IN (SELECT c FROM t1 WHERE c IS NULL);
CREATE  INDEX IF NOT EXISTS idx_t1_4644 ON t1((c + 1)) WHERE c IS NOT NULL;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
ALTER TABLE T RENAME COLUMN d TO d_r6340;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_5035 AS SELECT a FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_6261 BEFORE DELETE ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
ALTER TABLE t1 RENAME COLUMN d TO d_r3285;
SELECT AVG(c) FILTER (WHERE c != 0) OVER (ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM T;
SELECT PERCENT_RANK() OVER (ORDER BY b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T;
REINDEX;
INSERT INTO T SELECT * FROM T;
DROP INDEX IF EXISTS t1;
PRAGMA empty_result_callbacks = FALSE;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
INSERT INTO t1 VALUES (1, 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
ALTER TABLE T DROP COLUMN d;
SELECT * FROM T WHERE d > (SELECT AVG(d) FROM T);
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT c, SUM(c) AS total FROM t1 GROUP BY c) SELECT * FROM cte ORDER BY total DESC;
DETACH DATABASE aux16;
ALTER TABLE t1 DROP COLUMN c;
INSERT INTO T SELECT * FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5482 AS SELECT c FROM t1;
INSERT INTO T SELECT * FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_4883 ON T(lower(a)) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_T_7245 AFTER UPDATE ON T BEGIN SELECT RAISE(IGNORE); END;
INSERT INTO T VALUES (NULL, NULL);
SELECT * FROM T CROSS JOIN T;
DETACH DATABASE aux2;

SELECT COUNT(*) FROM T;
SELECT COUNT(a) FROM t1;
DROP VIEW IF EXISTS t1;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T);
DROP VIEW IF EXISTS T;
PRAGMA checkpoint_fullsync = NO;
ALTER TABLE t1 RENAME COLUMN c TO c_r5230;
DELETE FROM T WHERE 0;
INSERT OR IGNORE INTO T VALUES (NULL, '');
ALTER TABLE t1 DROP COLUMN a;
DROP VIEW IF EXISTS t1;
SELECT TOTAL(b) FROM t1;
.log stdout
ATTACH DATABASE ('' || (':memory:') || '') AS aux2;
ATTACH DATABASE (':memory:' || '') AS aux16;
PRAGMA parser_trace = NO;
BEGIN DEFERRED;
.exit -CAST(-soundex('') AS DECIMAL(json(CAST(json_patch((3.141592653589793 * 1), '{"key": null}') AS BLOB)),5))
BEGIN DEFERRED TRANSACTION;
BEGIN;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT NOT (NOT ABS(c) > 5 OR ABS(d) > 5) ;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 NATURAL JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT ABS(c) > 5 AND ABS(d) > 5;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','2020-01-01'), ('b','2026-01-01');
SELECT a,
CAST(
  (julianday('now')-julianday(b))/365.25
  AS INTEGER
) AS c
FROM T;
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
END TRANSACTION;
COMMIT TRANSACTION;
SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT d FROM t1 UNION SELECT d FROM t1) SELECT * FROM cte;
UPDATE T SET d = '' WHERE 1 RETURNING *;
ROLLBACK;
SELECT * FROM t1 WHERE c NOT IN (SELECT c FROM t1 WHERE c IS NULL);
CREATE  INDEX IF NOT EXISTS idx_t1_4644 ON t1((c + 1)) WHERE c IS NOT NULL;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
ALTER TABLE T RENAME COLUMN d TO d_r6340;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_5035 AS SELECT a FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_6261 BEFORE DELETE ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
ALTER TABLE t1 RENAME COLUMN d TO d_r3285;
SELECT AVG(c) FILTER (WHERE c != 0) OVER (ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM T;
SELECT PERCENT_RANK() OVER (ORDER BY b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T;
REINDEX;
INSERT INTO T SELECT * FROM T;
DROP INDEX IF EXISTS t1;
PRAGMA empty_result_callbacks = FALSE;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
INSERT INTO t1 VALUES (1, 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
ALTER TABLE T DROP COLUMN d;
SELECT * FROM T WHERE d > (SELECT AVG(d) FROM T);
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT c, SUM(c) AS total FROM t1 GROUP BY c) SELECT * FROM cte ORDER BY total DESC;
DETACH DATABASE aux16;
ALTER TABLE t1 DROP COLUMN c;
INSERT INTO T SELECT * FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5482 AS SELECT c FROM t1;
INSERT INTO T SELECT * FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_4883 ON T(lower(a)) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_T_7245 AFTER UPDATE ON T BEGIN SELECT RAISE(IGNORE); END;
INSERT INTO T VALUES (NULL, NULL);
SELECT * FROM T CROSS JOIN T;
DETACH DATABASE aux2;

SELECT COUNT(*) FROM T;
SELECT COUNT(a) FROM t1;
DROP VIEW IF EXISTS t1;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T);
DROP VIEW IF EXISTS T;
PRAGMA checkpoint_fullsync = NO;
ALTER TABLE t1 RENAME COLUMN c TO c_r5230;
DELETE FROM T WHERE 0;
INSERT OR IGNORE INTO T VALUES (NULL, '');
ALTER TABLE t1 DROP COLUMN a;
DROP VIEW IF EXISTS t1;
SELECT TOTAL(b) FROM t1;
.log stdout
ATTACH DATABASE ('' || (':memory:') || '') AS aux2;
ATTACH DATABASE (':memory:' || '') AS aux16;
PRAGMA parser_trace = NO;
BEGIN DEFERRED;
.exit -CAST(-soundex('') AS DECIMAL(json(CAST(json_patch((3.141592653589793 * 1), '{"key": null}') AS BLOB)),5))
BEGIN DEFERRED TRANSACTION;
BEGIN;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT NOT (NOT ABS(c) > 5 OR ABS(d) > 5) ;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 NATURAL JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT ABS(c) > 5 AND ABS(d) > 5;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','2020-01-01'), ('b','2026-01-01');
SELECT a,
CAST(
  (julianday('now')-julianday(b))/365.25
  AS INTEGER
) AS c
FROM T;
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
END TRANSACTION;
COMMIT TRANSACTION;
SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT d FROM t1 UNION SELECT d FROM t1) SELECT * FROM cte;
UPDATE T SET d = '' WHERE 1 RETURNING *;
ROLLBACK;
SELECT * FROM t1 WHERE c NOT IN (SELECT c FROM t1 WHERE c IS NULL);
CREATE  INDEX IF NOT EXISTS idx_t1_4644 ON t1((c + 1)) WHERE c IS NOT NULL;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
ALTER TABLE T RENAME COLUMN d TO d_r6340;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_5035 AS SELECT a FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_6261 BEFORE DELETE ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
ALTER TABLE t1 RENAME COLUMN d TO d_r3285;
SELECT AVG(c) FILTER (WHERE c != 0) OVER (ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM T;
SELECT PERCENT_RANK() OVER (ORDER BY b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T;
REINDEX;
INSERT INTO T SELECT * FROM T;
DROP INDEX IF EXISTS t1;
PRAGMA empty_result_callbacks = FALSE;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
INSERT INTO t1 VALUES (1, 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
ALTER TABLE T DROP COLUMN d;
SELECT * FROM T WHERE d > (SELECT AVG(d) FROM T);
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT c, SUM(c) AS total FROM t1 GROUP BY c) SELECT * FROM cte ORDER BY total DESC;
DETACH DATABASE aux16;
ALTER TABLE t1 DROP COLUMN c;
INSERT INTO T SELECT * FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5482 AS SELECT c FROM t1;
INSERT INTO T SELECT * FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_4883 ON T(lower(a)) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_T_7245 AFTER UPDATE ON T BEGIN SELECT RAISE(IGNORE); END;
INSERT INTO T VALUES (NULL, NULL);
SELECT * FROM T CROSS JOIN T;
DETACH DATABASE aux2;

SELECT COUNT(*) FROM T;
SELECT COUNT(a) FROM t1;
DROP VIEW IF EXISTS t1;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T);
DROP VIEW IF EXISTS T;
PRAGMA checkpoint_fullsync = NO;
ALTER TABLE t1 RENAME COLUMN c TO c_r5230;
DELETE FROM T WHERE 0;
INSERT OR IGNORE INTO T VALUES (NULL, '');
ALTER TABLE t1 DROP COLUMN a;
DROP VIEW IF EXISTS t1;
SELECT TOTAL(b) FROM t1;
.log stdout
ATTACH DATABASE ('' || (':memory:') || '') AS aux2;
ATTACH DATABASE (':memory:' || '') AS aux16;
PRAGMA parser_trace = NO;
BEGIN DEFERRED;
.exit -CAST(-soundex('') AS DECIMAL(json(CAST(json_patch((3.141592653589793 * 1), '{"key": null}') AS BLOB)),5))
BEGIN DEFERRED TRANSACTION;
BEGIN;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT NOT (NOT ABS(c) > 5 OR ABS(d) > 5) ;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 NATURAL JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT ABS(c) > 5 AND ABS(d) > 5;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','2020-01-01'), ('b','2026-01-01');
SELECT a,
CAST(
  (julianday('now')-julianday(b))/365.25
  AS INTEGER
) AS c
FROM T;
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
END TRANSACTION;
COMMIT TRANSACTION;
SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT d FROM t1 UNION SELECT d FROM t1) SELECT * FROM cte;
UPDATE T SET d = '' WHERE 1 RETURNING *;
ROLLBACK;
SELECT * FROM t1 WHERE c NOT IN (SELECT c FROM t1 WHERE c IS NULL);
CREATE  INDEX IF NOT EXISTS idx_t1_4644 ON t1((c + 1)) WHERE c IS NOT NULL;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
ALTER TABLE T RENAME COLUMN d TO d_r6340;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_5035 AS SELECT a FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_6261 BEFORE DELETE ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
ALTER TABLE t1 RENAME COLUMN d TO d_r3285;
SELECT AVG(c) FILTER (WHERE c != 0) OVER (ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM T;
SELECT PERCENT_RANK() OVER (ORDER BY b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T;
REINDEX;
INSERT INTO T SELECT * FROM T;
DROP INDEX IF EXISTS t1;
PRAGMA empty_result_callbacks = FALSE;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
INSERT INTO t1 VALUES (1, 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
ALTER TABLE T DROP COLUMN d;
SELECT * FROM T WHERE d > (SELECT AVG(d) FROM T);
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT c, SUM(c) AS total FROM t1 GROUP BY c) SELECT * FROM cte ORDER BY total DESC;
DETACH DATABASE aux16;
ALTER TABLE t1 DROP COLUMN c;
INSERT INTO T SELECT * FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5482 AS SELECT c FROM t1;
INSERT INTO T SELECT * FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_4883 ON T(lower(a)) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_T_7245 AFTER UPDATE ON T BEGIN SELECT RAISE(IGNORE); END;
INSERT INTO T VALUES (NULL, NULL);
SELECT * FROM T CROSS JOIN T;
DETACH DATABASE aux2;

SELECT COUNT(*) FROM T;
SELECT COUNT(a) FROM t1;
DROP VIEW IF EXISTS t1;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T);
DROP VIEW IF EXISTS T;
PRAGMA checkpoint_fullsync = NO;
ALTER TABLE t1 RENAME COLUMN c TO c_r5230;
DELETE FROM T WHERE 0;
INSERT OR IGNORE INTO T VALUES (NULL, '');
ALTER TABLE t1 DROP COLUMN a;
DROP VIEW IF EXISTS t1;
SELECT TOTAL(b) FROM t1;
.log stdout
ATTACH DATABASE ('' || (':memory:') || '') AS aux2;
ATTACH DATABASE (':memory:' || '') AS aux16;
PRAGMA parser_trace = NO;
BEGIN DEFERRED;
.exit -CAST(-soundex('') AS DECIMAL(json(CAST(json_patch((3.141592653589793 * 1), '{"key": null}') AS BLOB)),5))
BEGIN DEFERRED TRANSACTION;
BEGIN;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT NOT (NOT ABS(c) > 5 OR ABS(d) > 5) ;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 NATURAL JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT ABS(c) > 5 AND ABS(d) > 5;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','2020-01-01'), ('b','2026-01-01');
SELECT a,
CAST(
  (julianday('now')-julianday(b))/365.25
  AS INTEGER
) AS c
FROM T;
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
END TRANSACTION;
COMMIT TRANSACTION;
SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT d FROM t1 UNION SELECT d FROM t1) SELECT * FROM cte;
UPDATE T SET d = '' WHERE 1 RETURNING *;
ROLLBACK;
SELECT * FROM t1 WHERE c NOT IN (SELECT c FROM t1 WHERE c IS NULL);
CREATE  INDEX IF NOT EXISTS idx_t1_4644 ON t1((c + 1)) WHERE c IS NOT NULL;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
ALTER TABLE T RENAME COLUMN d TO d_r6340;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_5035 AS SELECT a FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_6261 BEFORE DELETE ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
ALTER TABLE t1 RENAME COLUMN d TO d_r3285;
SELECT AVG(c) FILTER (WHERE c != 0) OVER (ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM T;
SELECT PERCENT_RANK() OVER (ORDER BY b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T;
REINDEX;
INSERT INTO T SELECT * FROM T;
DROP INDEX IF EXISTS t1;
PRAGMA empty_result_callbacks = FALSE;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
INSERT INTO t1 VALUES (1, 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
ALTER TABLE T DROP COLUMN d;
SELECT * FROM T WHERE d > (SELECT AVG(d) FROM T);
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT c, SUM(c) AS total FROM t1 GROUP BY c) SELECT * FROM cte ORDER BY total DESC;
DETACH DATABASE aux16;
ALTER TABLE t1 DROP COLUMN c;
INSERT INTO T SELECT * FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5482 AS SELECT c FROM t1;
INSERT INTO T SELECT * FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_4883 ON T(lower(a)) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_T_7245 AFTER UPDATE ON T BEGIN SELECT RAISE(IGNORE); END;
INSERT INTO T VALUES (NULL, NULL);
SELECT * FROM T CROSS JOIN T;
DETACH DATABASE aux2;

SELECT COUNT(*) FROM T;
SELECT COUNT(a) FROM t1;
DROP VIEW IF EXISTS t1;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T);
DROP VIEW IF EXISTS T;
PRAGMA checkpoint_fullsync = NO;
ALTER TABLE t1 RENAME COLUMN c TO c_r5230;
DELETE FROM T WHERE 0;
INSERT OR IGNORE INTO T VALUES (NULL, '');
ALTER TABLE t1 DROP COLUMN a;
DROP VIEW IF EXISTS t1;
SELECT TOTAL(b) FROM t1;
.log stdout
ATTACH DATABASE ('' || (':memory:') || '') AS aux2;
ATTACH DATABASE (':memory:' || '') AS aux16;
PRAGMA parser_trace = NO;
BEGIN DEFERRED;
.exit -CAST(-soundex('') AS DECIMAL(json(CAST(json_patch((3.141592653589793 * 1), '{"key": null}') AS BLOB)),5))
BEGIN DEFERRED TRANSACTION;
BEGIN;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT NOT (NOT ABS(c) > 5 OR ABS(d) > 5) ;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 NATURAL JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
SAVEPOINT sp845;
ATTACH DATABASE ':memory:' AS aux86;
CREATE TABLE T (
  a SMALLINT,
  b TEXT,
  c REAL,
  d REAL
);
INSERT INTO T VALUES (NULL,'a',ceil((40.5 - 0)),-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
SELECT b FROM T WHERE NOT ABS(c) > 5 AND ABS(d) > 5;
ATTACH DATABASE ':memory:' AS aux65;
SAVEPOINT sp7910;
PRAGMA table_xinfo(users);
PRAGMA writable_schema = RESET;
.progress CAST(1.7976931348623157e+308 AS BIGINT)
PRAGMA cache_size;
PRAGMA schema_version = 6.283185307179586;
PRAGMA temp_store = '1';
.width
CREATE TABLE t1(a BIGINT 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
ALTER TABLE t1 RENAME TO t1_r4605;
ALTER TABLE t1 DROP COLUMN a;
CREATE TRIGGER  IF NOT EXISTS trg_t1_259 AFTER INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
INSERT INTO t1 SELECT * FROM t1;
UPDATE t1 SET b = '' WHERE NOT b BETWEEN 0 AND 100;
INSERT INTO t1 VALUES ('x', NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_3309 AS SELECT d FROM t1;
SELECT NTH_VALUE(d, 0) OVER (ORDER BY d) FROM t1;
ROLLBACK TO sp7910;
RELEASE sp7910;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO t1 VALUES (1, 'x', 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux65;
INSERT OR ABORT INTO t1 VALUES (0, 0, 0, '');
INSERT INTO t1 VALUES ('x', 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_7139 AS SELECT a FROM t1;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1291 AS SELECT c FROM t1;
VACUUM main;
ALTER TABLE t1 DROP COLUMN a;
SELECT COUNT(c) FILTER (WHERE NULL) OVER (PARTITION BY c ORDER BY c GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ANALYZE t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION	ALL SELECT x+1 FROM cnt WHERE x<7) SELECT * FROM cnt;
ALTER TABLE t1 RENAME TO t1_r6169;
REINDEX;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_6573 ON t1((b + 1)) WHERE b > 0;
SELECT AVG(c) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_7809 ON t1(b COLLATE NOCASE) WHERE b > 0;
DETACH DATABASE aux86;
INSERT OR ROLLBACK INTO T VALUES (0, -8, 8, 'x');
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','2020-01-01'), ('b','2026-01-01');
SELECT a,
CAST(
  (julianday('now')-julianday(b))/365.25
  AS INTEGER
) AS c
FROM T;
SELECT a FROM t1 INTERSECT SELECT a FROM (SELECT * FROM t1) AS sub;
SELECT COUNT(*) FROM T;
SELECT * FROM T;
CREATE  VIEW IF NOT EXISTS v_t1_687 AS SELECT a FROM t1;
WITH RECURSIVE r AS (SELECT d FROM t1 UNION ALL SELECT d FROM t1 LIMIT 5) SELECT * FROM r;
CREATE TRIGGER IF NOT EXISTS trg_t1_6 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR IGNORE INTO T VALUES ('x', 0, '', NULL);
ALTER TABLE t1 DROP COLUMN d;
DELETE FROM T WHERE c > (SELECT AVG(c) FROM T) RETURNING *;
RELEASE sp845;
WITH cte AS (SELECT * FROM t1) SELECT * FROM cte c1 JOIN cte c2 ON c1.b = c2.b;
PRAGMA reverse_unordered_selects = 1;
INSERT INTO t1 VALUES (NULL, 1, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
WITH cte AS (SELECT CASE WHEN d IS NULL THEN 0 ELSE d END AS val FROM t1) SELECT * FROM cte;
END TRANSACTION;
COMMIT TRANSACTION;
SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT d FROM t1 UNION SELECT d FROM t1) SELECT * FROM cte;
UPDATE T SET d = '' WHERE 1 RETURNING *;
ROLLBACK;
SELECT * FROM t1 WHERE c NOT IN (SELECT c FROM t1 WHERE c IS NULL);
CREATE  INDEX IF NOT EXISTS idx_t1_4644 ON t1((c + 1)) WHERE c IS NOT NULL;
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL);
ALTER TABLE T RENAME COLUMN d TO d_r6340;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_5035 AS SELECT a FROM t1;
CREATE TRIGGER IF NOT EXISTS trg_T_6261 BEFORE DELETE ON T FOR EACH ROW BEGIN INSERT INTO T(b) VALUES (NULL); END;
ALTER TABLE t1 RENAME COLUMN d TO d_r3285;
SELECT AVG(c) FILTER (WHERE c != 0) OVER (ORDER BY c ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM T;
SELECT PERCENT_RANK() OVER (ORDER BY b GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T;
REINDEX;
INSERT INTO T SELECT * FROM T;
DROP INDEX IF EXISTS t1;
PRAGMA empty_result_callbacks = FALSE;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
INSERT INTO t1 VALUES (1, 'x', NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
ALTER TABLE T DROP COLUMN d;
SELECT * FROM T WHERE d > (SELECT AVG(d) FROM T);
INSERT INTO t1 SELECT * FROM t1;
WITH cte AS (SELECT c, SUM(c) AS total FROM t1 GROUP BY c) SELECT * FROM cte ORDER BY total DESC;
DETACH DATABASE aux16;
ALTER TABLE t1 DROP COLUMN c;
INSERT INTO T SELECT * FROM T;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_5482 AS SELECT c FROM t1;
INSERT INTO T SELECT * FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_4883 ON T(lower(a)) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_T_7245 AFTER UPDATE ON T BEGIN SELECT RAISE(IGNORE); END;
INSERT INTO T VALUES (NULL, NULL);
SELECT * FROM T CROSS JOIN T;
DETACH DATABASE aux2;

SELECT COUNT(*) FROM T;
SELECT COUNT(a) FROM t1;
DROP VIEW IF EXISTS t1;
DELETE FROM T WHERE b > (SELECT AVG(b) FROM T);
DROP VIEW IF EXISTS T;
PRAGMA checkpoint_fullsync = NO;
ALTER TABLE t1 RENAME COLUMN c TO c_r5230;
DELETE FROM T WHERE 0;
INSERT OR IGNORE INTO T VALUES (NULL, '');
ALTER TABLE t1 DROP COLUMN a;
DROP VIEW IF EXISTS t1;
SELECT TOTAL(b) FROM t1;

CREATE TABLE T (
  A VARCHAR(20),
  B VARCHAR(30),
  C VARCHAR(30),
  PRIMARY KEY (A, B),
  UNIQUE (A, C)
);
INSERT INTO T VALUES ('a', 'p', 'x');
INSERT INTO T VALUES ('a', 'q', 'y');
INSERT INTO T VALUES ('b', 'p', 'z');
INSERT INTO T VALUES ('c', 'r', 'w');
INSERT INTO T VALUES ('d', 's', 'v');
SELECT A, COUNT(DISTINCT B) AS D FROM T GROUP BY A HAVING COUNT(DISTINCT B) >= 1;
SELECT * FROM T AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DELETE FROM T WHERE 0;
ALTER TABLE T RENAME TO T_r825;
WITH RECURSIVE empty(x) AS (SELECT 1 WHERE 1=0 UNION ALL SELECT x+1 FROM empty WHERE x<10) SELECT * FROM empty;
SELECT * FROM t1;
INSERT INTO t1 VALUES ('x', NULL, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 SELECT * FROM t1;

SELECT COUNT(*) FROM T;

SELECT COUNT(*) FROM t1;
ALTER TABLE t1 DROP COLUMN a;
SELECT AVG(A) FROM T;
SELECT * FROM T WHERE A > ALL (SELECT A FROM T);
END;
CREATE TRIGGER IF NOT EXISTS trg_t1_9592 AFTER UPDATE ON t1 BEGIN INSERT INTO t1(b) VALUES (NULL); END;
DELETE FROM t1 WHERE rowid = 67;
SELECT * FROM t1;
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;
VACUUM;
ALTER TABLE T RENAME TO T_r6992;
INSERT OR ROLLBACK INTO t1 VALUES (NULL, 2, 0, 'x');
CREATE TEMP  VIEW IF NOT EXISTS v_T_8311 AS SELECT a FROM T;
CREATE TRIGGER IF NOT EXISTS trg_T_3565 AFTER UPDATE OF b ON T BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT OR FAIL INTO T VALUES (0, '');
CREATE  INDEX IF NOT EXISTS idx_T_7462 ON T(b) WHERE b > 0;
```

## Actual output

```sql
2|-2.5
3|0.0
|1.5
(no new indexes)

(null)
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
WARNING: writing to an imposter table will corrupt the "t1bc" index!
Braun|30|3
Wernher|10|1
von|20|2
Braun|30
Wernher|10
von|20
```

## Expectation

```sql
2|-2.5
3|0.0
|1.5
(no new indexes)

(null)
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
Braun|30|3
Wernher|10|1
von|20|2
Braun|30
Wernher|10
von|20
```

## Flag

```

```

