* parser: regard NULL as literal when normalizing queries
Currently, Normalize() converts "SELECT NULL" to "select null", while NULL is
regarded as a literal in MySQL, as described in the documentation.
https://dev.mysql.com/doc/refman/8.0/en/literals.html
It seems natural that Normalize() would convert "SELECT NULL" to "select ?"
from the consistency viewpoint.
* Handle case of 'select `null`'
* Fix quotation
Co-authored-by: Arenatlx <ailinsilence4@gmail.com>
Co-authored-by: kennytm <kennytm@gmail.com>
* 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()