Commit Graph

24 Commits

Author SHA1 Message Date
7f442079ac *: Minimize file and directory permissions (#31740)
ref pingcap/tidb#31310
2022-01-22 10:27:46 +08:00
eb4bc5dc89 parser: update cznic/parser&y to new 1.0.2/1.0.1 (#29846) 2021-11-23 12:07:51 +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
a34970d9da [parser] goyacc: add a config option to skip text position recording (#1300) 2021-10-09 14:53:23 +08:00
xhe
bc860cdd5e [parser] *: fix static check report (#1195)
* ast: base.go

Signed-off-by: xhe <xw897002528@gmail.com>

* ast: expressions.go

Signed-off-by: xhe <xw897002528@gmail.com>

* ast: misc_test.go

Signed-off-by: xhe <xw897002528@gmail.com>

* *: digester.go

Signed-off-by: xhe <xw897002528@gmail.com>

* goyacc: format_yacc.go

Signed-off-by: xhe <xw897002528@gmail.com>

* *: lexer_test.go

Signed-off-by: xhe <xw897002528@gmail.com>

* *: misc.go

Signed-off-by: xhe <xw897002528@gmail.com>

* model: model.go

Signed-off-by: xhe <xw897002528@gmail.com>

* model: model_test.go

Signed-off-by: xhe <xw897002528@gmail.com>

* *: parser_test.go

Signed-off-by: xhe <xw897002528@gmail.com>

* test_driver: test_driver_datum.go

Signed-off-by: xhe <xw897002528@gmail.com>

* test_driver: test_driver_mydecimal.go

Signed-off-by: xhe <xw897002528@gmail.com>

* ast: ddl.go, bugfix

Signed-off-by: xhe <xw897002528@gmail.com>

* mysql: errcode.go

charset/charset.go is passing errcode to NewStd, which requires int. But
here codes are uint16. To get rid of the error, uint16 is removed.

Signed-off-by: xhe <xw897002528@gmail.com>

* model: better test

Signed-off-by: xhe <xw897002528@gmail.com>

* *: fix timezone

Signed-off-by: xhe <xw897002528@gmail.com>

Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2021-10-09 14:53:23 +08:00
c7f93089c6 [parser] goyacc: record the original text position in AST (#984) 2021-10-09 14:53:23 +08:00
f1d610f394 [parser] fix type conversion panic from NUM to int64 (#809)
* fix conversion panic from NUM to int64

* catch teardown error

* polish int64num description

Co-authored-by: kennytm <kennytm@gmail.com>
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
ba3ed9535b [parser] add yacc file formatter (#701) 2021-10-09 14:53:23 +08:00
06a9eb80fa [parser] parser: optimize performance (#562) 2021-10-09 14:53:23 +08:00
c938f62ea5 [parser] parser: add charset validation (TiDB #4436) (#220)
* Add charset validation in pattern `CharsetName`, and use it in syntax `CONVERT(expr USING transcoding_name)` and `CHAR(N USING charset_name)`.
* Modify `yyLexer` interface to return different types of error.
2021-10-09 14:53:23 +08:00
8862bb53b1 [parser] ignore hint when meet unknow token in hint (#80) 2021-10-09 14:53:23 +08:00
2095376b3b [parser] goyacc: fix unstability of generated parser.go (#9) 2021-10-09 14:53:23 +08:00
c270f55405 [parser] *: move github.com/pingcap/tidb/parser here (#1) 2021-10-09 14:53:23 +08:00
89dda9d9a8 *: move parser to a separate repository (#8036) 2018-10-25 11:12:10 +08:00
9c2ea17722 *: enforce errcheck in Makefile (#4724)
checks all errors and enable errcheck in Makefile

Fixes https://github.com/pingcap/tidb/issues/4668
2017-10-09 17:16:10 +08:00
eabb62968f meta/autoid: fix ID allocator when transaction failed to commit. (#4585)
* meta/autoid: fix ID allocator when transaction failed to commit.
2017-09-20 20:03:50 +08:00
4c0e106152 *: goyacc generated code tiny change (#1574) 2016-08-10 10:32:10 +08:00
3545493808 parser: cache variable in parser to avoid allocation (#1565) 2016-08-08 23:17:44 +08:00
a5db620286 parser: rewrite lex (#1514)
introduce a handwriten lexer, which should be better in performance and support UTF8.
it's still not used as default one, a switch is provided by specifying -newlexer=true in tidb-server.
2016-08-06 16:29:21 +08:00
8ad34f0ad9 parser: use yyLex.Error instead of (*lex).err (#1492) 2016-07-27 14:42:40 +08:00
128af2e92a parser: store sql string in parser and move offset related method (#1493) 2016-07-27 10:50:06 +08:00
c2831f6290 *: put goyacc tool into vendor (#1499) 2016-07-27 10:30:10 +08:00