-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #578: lexer wrongly interprets ".e[0-9]" as a number with scienti…
…fic notation. (#579) * Add invalid number on lexer to show it is wrongly detected as a number. * Fix the lexer about parsing invalid numbers with updated unit tests. * Remove forgotten debug function. * Fix forgotten statement on parseNumber to move from state 10 to state 4, causing wrong lexing process. * Fix linters and ignore new psalm issues. * Add test case with parser for issue #578. Fixes #578
- Loading branch information
Showing
7 changed files
with
583 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
SELECT 12, 34, 5.67, 0x89, -10, --11, +12, .15, 0xFFa, 0xfFA, +0xfFA, -0xFFa, -0xfFA, 1e-10, 1e10, .5e10, b'10'; | ||
-- invalid numbers | ||
SELECT 12ex10, b'15', 0XFfA, -0XFfA, +0XFfA; | ||
SELECT 12ex10, b'15', 0XFfA, -0XFfA, +0XFfA, .e4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- Query from https://github.com/phpmyadmin/sql-parser/issues/578 | ||
-- Issue was that Lexer detected ".e1" as number token. | ||
|
||
LOAD DATA LOCAL INFILE '/home/user/myloadfile.csv' | ||
IGNORE INTO TABLE erp.e1_table | ||
FIELDS TERMINATED BY '\t' | ||
LINES TERMINATED BY '\n' | ||
IGNORE 0 LINES; |
Oops, something went wrong.