[MDEV-23359] Lex_input_stream: buggy code duplication in scan_ident_start() and scan_ident_sysvar() Created: 2020-07-31 Updated: 2020-08-01 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Parser |
| Affects Version/s: | 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
There is a huge code duplication in:
The latter seems to be buggy, as it does not handle bad bytes correctly.
The former error message is wrong. The 0xC2 is errorneously scanned as a part of identifier, although it is not followed by a valid multi-byte tail. The latter error message is correct. 0xFF cannot be a part of an UTF8 sequence, so the tokenizer scans 'session' as expected, then fails to get a token during the next lex_one_token() call. The wrong method scan_ident_sysvar() should be removed, and scan_ident_start() should be used instead. |