Commit 3281659
committed
fix: stop 0x hex literal from swallowing trailing whitespace (#2435)
HEX_VALUE included a space character, so the "0x" hex literal form
greedily consumed trailing whitespace and any adjacent hex letters
(e.g. the "F" of FROM). Consequently `SELECT 0xFF FROM t` failed with
"Encountered <S_IDENTIFIER> t", while `SELECT 0xFF,1 FROM t` (comma,
no space) parsed fine.
The space is only required by the X'..' form, which deliberately allows
internal whitespace (e.g. X'01 bc 2a', covered by StringValueTest).
Split the shared token: X'..' keeps HEX_VALUE (with space), while the
0x.. form uses a new space-less HEX_DIGIT token.
Signed-off-by: 付典 <fudianchn@gmail.com>1 parent f0ba123 commit 3281659
2 files changed
Lines changed: 21 additions & 1 deletion
File tree
- src
- main/jjtree/net/sf/jsqlparser/parser
- test/java/net/sf/jsqlparser/expression
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1601 | 1601 | | |
1602 | 1602 | | |
1603 | 1603 | | |
1604 | | - | |
| 1604 | + | |
1605 | 1605 | | |
| 1606 | + | |
1606 | 1607 | | |
1607 | 1608 | | |
1608 | 1609 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
42 | 61 | | |
0 commit comments