## 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 t1(a TEXT COLLATE BINARY);
ALTER TABLE t1 ADD COLUMN b INTEGER COLLATE NOCASE;
INSERT INTO t1 VALUES(x'c714fadb5d678c9f65d584f7a42a737d','-2');
INSERT INTO t1 VALUES(5.4e-08,'5.4e-08');
SELECT typeof(a), a, typeof(b), b FROM t1;
CREATE TABLE t2(a INTEGER);
INSERT INTO t2 VALUES(1);
INSERT INTO t2 VALUES(1);
INSERT INTO t2 VALUES(2);
ALTER TABLE t2 ADD COLUMN b INTEGER DEFAULT 9;
SELECT a, sum(b) FROM t2 GROUP BY a;

PRAGMA parser_trace = FALSE;
SELECT LAG(a, 2, a) OVER (PARTITION BY a ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t2;
```

## Actual output

```sql
blob|ÇúÛ]geÕ÷¤*s}|integer|-2
text|5.4e-08|real|5.4e-08
1|18
2|9
1
1
2
```

## Expectation

```sql
blob|Ç^TúÛ]geÕ÷¤*s}|integer|-2
text|5.4e-08|real|5.4e-08
1|18
2|9
1
1
2
```

## Flag

```

```

