Commit Graph

6 Commits

Author SHA1 Message Date
7647c2b9b0 parser: parse gbk encoding SQL token by token instead of the whole SQL (#31039)
close pingcap/tidb#30765
2021-12-28 22:07:49 +08:00
5f340b88c9 parser: format error message during parsing when meet a big value. (#28791) 2021-11-18 00:51:47 +08:00
xhe
94e30df8e2 parser: fix compiling, add unit tests (#28700) 2021-10-11 23:15:25 +08:00
ba105bbd10 [parser] support parsing SQL with encodings other than utf8 (#1312) 2021-10-09 14:53:23 +08:00
e3daabacc0 [parser] *: redact arguments for Error (#1051) 2021-10-09 14:53:23 +08:00
5cfb690491 [parser] Rewrite special comment parser (#711)
* lexer: added a function to scan version digits

* lexer: removed special comment scanner

Instead, simply strip off '/*!' and the pairing '*/'.

Temporarily disabled handling of /*+ ... */

* lexer: support collecting the entire /*+ ... */ as a single token

This new token has type `hintComment`. The actual hint will be parsed
lazily.

* lexer,yy_parser: move lastErrorAsWarn() from Parser into Scanner

* goyacc: do not allow conflict, support changing parser type name

change the "DO NOT EDIT" line to fit the Go standard

* parser,hintparser: created a new parser just for parsing optimizer hints

deleted all optimizer hint rules from parser.go

refactor the Makefile to support building both parsers (also deleted some
outdated fixup of *parser.go)

* lexer: fix comment parser

* codecov: don't wait for integration test before showing the coverage

* lexer: fix comment parsing again

* hintparser: TiDB still expects `HASH_JOIN(@qb1 foo@qb2)` to be valid :(

* parser,hintparser: provide the true line/column offset in the warnings

cache the hintparser in the main parser to avoid repeated allocation

* lexer: delete unused sqlOffsetInComment()
2021-10-09 14:53:23 +08:00