Commit 64468b7
authored
Fixes `SELECT` queries that have string literals with `NULL` bytes in
them and no column alias.
E.g.:
```sql
SELECT `a<null-byte>b`;
-- result column name should be: 'a'
```
This is because in MySQL:
- There can’t be `\0` bytes in identifiers (like column names). The
lexer will reject that.
- But string literals can have them.
- And there is a way to make a string literal “identifier-like”
(implicit alias = the result “column name”): `SELECT 'abc\0xyz'` The
result column name will be: `abc`
1 parent c087051 commit 64468b7
2 files changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6138 | 6138 | | |
6139 | 6139 | | |
6140 | 6140 | | |
| 6141 | + | |
| 6142 | + | |
| 6143 | + | |
| 6144 | + | |
| 6145 | + | |
| 6146 | + | |
| 6147 | + | |
| 6148 | + | |
6141 | 6149 | | |
6142 | 6150 | | |
6143 | 6151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4566 | 4566 | | |
4567 | 4567 | | |
4568 | 4568 | | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
| 4572 | + | |
| 4573 | + | |
| 4574 | + | |
| 4575 | + | |
4569 | 4576 | | |
4570 | 4577 | | |
4571 | 4578 | | |
| |||
0 commit comments