## 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 aux49;
CREATE TABLE T1 (
  A VARCHAR(julianday(10 -> '$[0]')) PRIMARY KEY,
  B VARCHAR(15) UNIQUE,
  C INTEGER
);
CREATE TABLE T2 (
  X VARCHAR(20) PRIMARY KEY,
  A VARCHAR(10) NOT NULL UNIQUE,
  FOREIGN KEY (A) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('a', 'p', -2147483648);
INSERT INTO T1 VALUES ('b', 'q', 2147483647);
INSERT INTO T2 VALUES ('m', 'a');
INSERT INTO T2 VALUES ('n', 'b');
SELECT T2.X, T1.B, T1.C FROM T2, T1 WHERE NOT NOT T2.A = T1.A AND T1.C >= 0;
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA optimize(0x00002);
.connection
ATTACH DATABASE ':memory:' AS aux10;
PRAGMA secure_delete = FALSE;
.check
PRAGMA freelist_count;
ATTACH DATABASE ':memory:' AS aux47; /* hex('hello') */ PRAGMA index_list(users);
PRAGMA table_info(users);
PRAGMA application_id;
PRAGMA optimize;
.stats on
CREATE TABLE [t1](n ANY, log int);
BEGIN;
INSERT INTO t1 VALUES(((log10(round(-format(NULL, CAST(NULL AS MEDIUMINT)), jsonb_extract(length(randomblob(inf)), '$.key'))) + -(-(NULL))) - CAST(pi() AS BIGINT)), 1);
INSERT INTO t1 VALUES(3, 1);
INSERT INTO t1 VALUES(4, 1);
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;
INSERT INTO t1 VALUES(4, 3);
WITH _m AS MATERIALIZED (SELECT * FROM t1) SELECT min(n),min(log),max(n),max(log),sum(n),sum(log),avg(n),avg(log) FROM _m;
SELECT log, avg(n)+1 FROM t1 GROUP BY log ORDER BY log;
SELECT log*2+1 AS x, count(*) AS y FROM t1 GROUP BY x ORDER BY 10-(x+y);
SELECT log, count(*) FROM t1 GROUP BY log HAVING count(*)>=4 ORDER BY log;
SELECT log, count(*), avg(n), max(n+log*2) FROM t1 GROUP BY log ORDER BY max(n+log*2)+0, min(log,avg(n))+0;
DETACH DATABASE aux47;
INSERT INTO t1 VALUES (NULL, NULL);
SELECT COUNT(*) FROM t1;
ALTER TABLE t1 ADD COLUMN extra_5120 DATETIME;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE NOT NOT +log > (SELECT AVG(log) FROM t1) RETURNING *;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_3311 AS SELECT log FROM t1;
PRAGMA vdbe_trace = /* PRAGMA checkpoint_fullsync = NO; */ 1;
SELECT * FROM t1;
ALTER TABLE t1 RENAME COLUMN n TO n_r4471;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1086 AS /* COUNT({c}) FILTER (WHERE NULL) */ SELECT log FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_9719 ON t1(lower(log)) WHERE log IS NOT NULL;
ALTER TABLE t1 RENAME COLUMN log TO log_r6203;
DROP INDEX IF EXISTS t1;
SELECT COUNT(n) FROM t1;
PRAGMA query_only = FALSE;
SELECT * FROM t1 CROSS JOIN t1;
DELETE FROM t1 WHERE 0;
DETACH DATABASE aux10;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_7740 ON T(a) WHERE a IS NOT NULL;
CREATE TEMP  VIEW IF NOT EXISTS v_T_342 AS SELECT b FROM T;
INSERT INTO T SELECT * FROM T;
INSERT INTO T VALUES (NULL, NULL);
COMMIT;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_149 ON T(lower(a)) WHERE a IS NOT NULL;
INSERT INTO T VALUES (NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
ALTER TABLE T DROP COLUMN b;
ANALYZE T;
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA optimize(0x00002);
.connection
ATTACH DATABASE ':memory:' AS aux10;
PRAGMA secure_delete = FALSE;
.check
PRAGMA freelist_count;
ATTACH DATABASE ':memory:' AS aux47; /* hex('hello') */ PRAGMA index_list(users);
PRAGMA table_info(users);
PRAGMA application_id;
PRAGMA optimize;
.stats on
CREATE TABLE [t1](n ANY, log int);
BEGIN;
INSERT INTO t1 VALUES(((log10(round(-format(NULL, CAST(NULL AS MEDIUMINT)), jsonb_extract(length(randomblob(inf)), '$.key'))) + -(-(NULL))) - CAST(pi() AS BIGINT)), 1);
INSERT INTO t1 VALUES(3, 1);
INSERT INTO t1 VALUES(4, 1);
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;
INSERT INTO t1 VALUES(4, 3);
WITH _m AS MATERIALIZED (SELECT * FROM t1) SELECT min(n),min(log),max(n),max(log),sum(n),sum(log),avg(n),avg(log) FROM _m;
SELECT log, avg(n)+1 FROM t1 GROUP BY log ORDER BY log;
SELECT log*2+1 AS x, count(*) AS y FROM t1 GROUP BY x ORDER BY 10-(x+y);
SELECT log, count(*) FROM t1 GROUP BY log HAVING count(*)>=4 ORDER BY log;
SELECT log, count(*), avg(n), max(n+log*2) FROM t1 GROUP BY log ORDER BY max(n+log*2)+0, min(log,avg(n))+0;
DETACH DATABASE aux47;
INSERT INTO t1 VALUES (NULL, NULL);
SELECT COUNT(*) FROM t1;
ALTER TABLE t1 ADD COLUMN extra_5120 DATETIME;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE NOT NOT +log > (SELECT AVG(log) FROM t1) RETURNING *;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_3311 AS SELECT log FROM t1;
PRAGMA vdbe_trace = /* PRAGMA checkpoint_fullsync = NO; */ 1;
SELECT * FROM t1;
ALTER TABLE t1 RENAME COLUMN n TO n_r4471;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1086 AS /* COUNT({c}) FILTER (WHERE NULL) */ SELECT log FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_9719 ON t1(lower(log)) WHERE log IS NOT NULL;
ALTER TABLE t1 RENAME COLUMN log TO log_r6203;
DROP INDEX IF EXISTS t1;
SELECT COUNT(n) FROM t1;
PRAGMA query_only = FALSE;
SELECT * FROM t1 CROSS JOIN t1;
DELETE FROM t1 WHERE 0;
DETACH DATABASE aux10;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_7740 ON T(a) WHERE a IS NOT NULL;
CREATE TEMP  VIEW IF NOT EXISTS v_T_342 AS SELECT b FROM T;
INSERT INTO T SELECT * FROM T;
INSERT INTO T VALUES (NULL, NULL);
COMMIT;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_149 ON T(lower(a)) WHERE a IS NOT NULL;
INSERT INTO T VALUES (NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
ALTER TABLE T DROP COLUMN b;
ANALYZE T;
BEGIN EXCLUSIVE TRANSACTION;
PRAGMA optimize(0x00002);
.connection
ATTACH DATABASE ':memory:' AS aux10;
PRAGMA secure_delete = FALSE;
.check
PRAGMA freelist_count;
ATTACH DATABASE ':memory:' AS aux47; /* hex('hello') */ PRAGMA index_list(users);
PRAGMA table_info(users);
PRAGMA application_id;
PRAGMA optimize;
.stats on
CREATE TABLE [t1](n ANY, log int);
BEGIN;
INSERT INTO t1 VALUES(((log10(round(-format(NULL, CAST(NULL AS MEDIUMINT)), jsonb_extract(length(randomblob(inf)), '$.key'))) + -(-(NULL))) - CAST(pi() AS BIGINT)), 1);
INSERT INTO t1 VALUES(3, 1);
INSERT INTO t1 VALUES(4, 1);
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;
INSERT INTO t1 VALUES(4, 3);
WITH _m AS MATERIALIZED (SELECT * FROM t1) SELECT min(n),min(log),max(n),max(log),sum(n),sum(log),avg(n),avg(log) FROM _m;
SELECT log, avg(n)+1 FROM t1 GROUP BY log ORDER BY log;
SELECT log*2+1 AS x, count(*) AS y FROM t1 GROUP BY x ORDER BY 10-(x+y);
SELECT log, count(*) FROM t1 GROUP BY log HAVING count(*)>=4 ORDER BY log;
SELECT log, count(*), avg(n), max(n+log*2) FROM t1 GROUP BY log ORDER BY max(n+log*2)+0, min(log,avg(n))+0;
DETACH DATABASE aux47;
INSERT INTO t1 VALUES (NULL, NULL);
SELECT COUNT(*) FROM t1;
ALTER TABLE t1 ADD COLUMN extra_5120 DATETIME;
INSERT INTO t1 SELECT * FROM t1;
DELETE FROM t1 WHERE NOT NOT +log > (SELECT AVG(log) FROM t1) RETURNING *;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_3311 AS SELECT log FROM t1;
PRAGMA vdbe_trace = /* PRAGMA checkpoint_fullsync = NO; */ 1;
SELECT * FROM t1;
ALTER TABLE t1 RENAME COLUMN n TO n_r4471;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_1086 AS /* COUNT({c}) FILTER (WHERE NULL) */ SELECT log FROM t1;
CREATE  INDEX IF NOT EXISTS idx_t1_9719 ON t1(lower(log)) WHERE log IS NOT NULL;
ALTER TABLE t1 RENAME COLUMN log TO log_r6203;
DROP INDEX IF EXISTS t1;
SELECT COUNT(n) FROM t1;
PRAGMA query_only = FALSE;
SELECT * FROM t1 CROSS JOIN t1;
DELETE FROM t1 WHERE 0;
DETACH DATABASE aux10;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_7740 ON T(a) WHERE a IS NOT NULL;
CREATE TEMP  VIEW IF NOT EXISTS v_T_342 AS SELECT b FROM T;
INSERT INTO T SELECT * FROM T;
INSERT INTO T VALUES (NULL, NULL);
COMMIT;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_149 ON T(lower(a)) WHERE a IS NOT NULL;
INSERT INTO T VALUES (NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
ALTER TABLE T DROP COLUMN b;
ANALYZE T;

INSERT INTO T1 SELECT * FROM T1;
WITH cte AS (SELECT A FROM T2 WHERE A IS NULL) SELECT * FROM cte;
SELECT LAST_VALUE(X) OVER (ORDER BY X RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM T2;
ANALYZE;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_7338 ON T(a COLLATE NOCASE);
DETACH DATABASE aux49;
```

## Actual output

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

## Expectation

```sql

```

## Flag

```
-help
```

