Repository navigation
Commit fd4a1bf
committed
Treat END_OF_INPUT as an identifier and report syntax errors with SQLSTATE 42000
In MySQL, "END_OF_INPUT" is the name of an internal grammar terminal, not a
keyword: typed input is tokenized as an identifier and can be used as an
alias, with or without a trailing semicolon. The lexer mapped it to the EOF
token instead, so "SELECT 1 END_OF_INPUT;" was rejected as a syntax error,
and without the semicolon the alias was silently lost. Remove the keyword
mapping, so the typed word tokenizes as an identifier and the EOF token is
only emitted at the end of the input.
Lexer and parser failures now also report SQLSTATE "42000" with error 1064,
like MySQL reports syntax errors, instead of the generic "HY000" with 1105.
Internal assertions keep the generic codes.
Follows up on the PR review.1 parent 581e896 commit fd4a1bf
4 files changed
Lines changed: 67 additions & 13 deletions
File tree
- packages/mysql-on-sqlite
- src
- mysql
- sqlite
- tests
- mysql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1137 | 1137 | | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | | - | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
1141 | 1146 | | |
1142 | 1147 | | |
1143 | 1148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1118 | 1118 | | |
1119 | 1119 | | |
1120 | 1120 | | |
1121 | | - | |
| 1121 | + | |
1122 | 1122 | | |
1123 | 1123 | | |
1124 | 1124 | | |
| |||
1639 | 1639 | | |
1640 | 1640 | | |
1641 | 1641 | | |
1642 | | - | |
| 1642 | + | |
1643 | 1643 | | |
1644 | 1644 | | |
1645 | 1645 | | |
| |||
8191 | 8191 | | |
8192 | 8192 | | |
8193 | 8193 | | |
| 8194 | + | |
| 8195 | + | |
| 8196 | + | |
| 8197 | + | |
| 8198 | + | |
| 8199 | + | |
| 8200 | + | |
| 8201 | + | |
| 8202 | + | |
| 8203 | + | |
| 8204 | + | |
| 8205 | + | |
| 8206 | + | |
| 8207 | + | |
| 8208 | + | |
| 8209 | + | |
| 8210 | + | |
| 8211 | + | |
| 8212 | + | |
| 8213 | + | |
| 8214 | + | |
8194 | 8215 | | |
8195 | 8216 | | |
8196 | 8217 | | |
8197 | | - | |
8198 | | - | |
8199 | | - | |
8200 | | - | |
| 8218 | + | |
| 8219 | + | |
8201 | 8220 | | |
8202 | 8221 | | |
8203 | 8222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12002 | 12002 | | |
12003 | 12003 | | |
12004 | 12004 | | |
12005 | | - | |
12006 | | - | |
12007 | | - | |
| 12005 | + | |
| 12006 | + | |
| 12007 | + | |
| 12008 | + | |
| 12009 | + | |
| 12010 | + | |
| 12011 | + | |
| 12012 | + | |
| 12013 | + | |
12008 | 12014 | | |
12009 | 12015 | | |
12010 | 12016 | | |
12011 | 12017 | | |
12012 | | - | |
12013 | | - | |
12014 | | - | |
| 12018 | + | |
| 12019 | + | |
12015 | 12020 | | |
12016 | 12021 | | |
12017 | 12022 | | |
| 12023 | + | |
| 12024 | + | |
| 12025 | + | |
| 12026 | + | |
| 12027 | + | |
| 12028 | + | |
| 12029 | + | |
| 12030 | + | |
| 12031 | + | |
| 12032 | + | |
| 12033 | + | |
| 12034 | + | |
| 12035 | + | |
| 12036 | + | |
| 12037 | + | |
| 12038 | + | |
| 12039 | + | |
| 12040 | + | |
| 12041 | + | |
| 12042 | + | |
| 12043 | + | |
| 12044 | + | |
| 12045 | + | |
| 12046 | + | |
12018 | 12047 | | |
12019 | 12048 | | |
12020 | 12049 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| |||
0 commit comments