## 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
.dbconfig
ATTACH DATABASE ':memory:' AS aux3;
CREATE TABLE main.T (
  a MEDIUMINT,
  b TEXT,
  c REAL
);
INSERT
INTO T VALUES (datetime((0 + 1)),'a',1.25), (2,'b',-3.5), (3,'c',0.0);
SELECT * FROM T WHERE NOT NOT (+c < 2.0) ORDER BY c;
ALTER TABLE T RENAME COLUMN a TO a_r5474;
SELECT * FROM T AS a RIGHT OUTER JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T VALUES (NULL, NULL, NULL);
CREATE TABLE T1 (
  A VARCHAR(15) PRIMARY KEY,
  B VARCHAR(30) NOT NULL UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(10) PRIMARY KEY,
  X VARCHAR(15) NOT NULL,
  C BIGINT,
  FOREIGN KEY (X) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('p', 'x');
INSERT INTO T1 VALUES ('q', 'y');
INSERT INTO T2 VALUES ('a', 'p', 9223372036854775807);
INSERT INTO T2 VALUES ('b', 'q', -9223372036854775808);
SELECT X, SUM(C) AS D, COUNT(*) AS E FROM T2 GROUP BY X;
DETACH DATABASE aux3;
SELECT c FROM T WHERE c = (SELECT MAX(c) FROM T);
SELECT COUNT(*) FROM T;
ANALYZE;
INSERT INTO T2 VALUES (NULL, 1, 'x') ON CONFLICT(A) DO UPDATE SET A = excluded.A, X = excluded.X, C = excluded.C;
SELECT AVG(B) FROM T1;
ALTER TABLE T DROP COLUMN b;
SELECT * FROM T;

SELECT COUNT(*) FROM T2;
DELETE FROM T2 WHERE 0;
```

## Actual output

```sql
defensive off
            dqs_ddl on
            dqs_dml on
        enable_fkey off
        enable_qpsg off
     enable_trigger on
        enable_view on
     fts3_tokenizer off
 legacy_alter_table off
 legacy_file_format off
     load_extension on
   no_ckpt_on_close off
     reset_database off
        trigger_eqp off
     trusted_schema on
    writable_schema off
2|b|-3.5
3|c|0.0
-4713-11-25 12:00:00|a|1.25
-4713-11-25 12:00:00|a|1.25|-4713-11-25 12:00:00|a|1.25
2|b|-3.5|2|b|-3.5
3|c|0.0|3|c|0.0
p|9223372036854775807|1
q|-9223372036854775808|1
1.25
4
0.0
-4713-11-25 12:00:00|1.25
2|-3.5
3|0.0
|
3
```

## Expectation

```sql
attach_create on
       attach_write on
           comments on
          defensive on
            dqs_ddl off
            dqs_dml off
        enable_fkey off
        enable_qpsg off
     enable_trigger on
        enable_view on
     fts3_tokenizer off
 legacy_alter_table off
 legacy_file_format off
     load_extension on
   no_ckpt_on_close off
     reset_database off
  reverse_scanorder off
    stmt_scanstatus off
        trigger_eqp off
     trusted_schema off
    writable_schema off
2|b|-3.5
3|c|0.0
-4713-11-25 12:00:00|a|1.25
-4713-11-25 12:00:00|a|1.25|-4713-11-25 12:00:00|a|1.25
2|b|-3.5|2|b|-3.5
3|c|0.0|3|c|0.0
p|9223372036854775807|1
q|-9223372036854775808|1
1.25
4
0.0
-4713-11-25 12:00:00|1.25
2|-3.5
3|0.0
|
3
```

## Flag

```

```

