Commit Graph

44 Commits

Author SHA1 Message Date
xhe
94e30df8e2 parser: fix compiling, add unit tests (#28700) 2021-10-11 23:15:25 +08:00
7af2a2410e [parser] introduce a new Restore Flag RestoreBracketAroundBinaryOperation (#1332) 2021-10-09 14:53:23 +08:00
434ae88964 [parser] ast: add resultSetNode() to ResultSetNode (#1216)
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2021-10-09 14:53:23 +08:00
81fcae6419 [parser] ast: fix testPlanSuite.TestNameResolver failed in tidb repo (#1212)
* fix-name-resolver

* add comments
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
5276047602 [parser] ast: Change the implementation of Accept for DefaultExpr (#1027) 2021-10-09 14:53:23 +08:00
d4fd96dd1f [parser] Revert "ast: Change the implementation of Accept for DefaultExpr (#1007)" (#1013) 2021-10-09 14:53:23 +08:00
75aea7b059 [parser] ast: Change the implementation of Accept for DefaultExpr (#1007)
Co-authored-by: Yuanjia Zhang <zhangyuanjia@pingcap.com>
Co-authored-by: Arenatlx <ailinsilence4@gmail.com>
2021-10-09 14:53:23 +08:00
xhe
2dbf28d553 [parser] fix: correct file permission (#918)
Commit 334dfef16055ffaf9c704b7ad25ce7540cb6ce38 changed several files into
executables. Commit f6e17887c998e7c7d460bfabb198ed5f53dd22a2 reverted the
permission of parser_test.go from 755 to 644, but missed all other
files. Later go.mod1/go.sum1 are removed. This commit fixed the
permission of remaining affected files.
2021-10-09 14:53:23 +08:00
096d4fad21 [parser] opcode,ast: fix invalid restore of '4 DIV 2' (became '4DIV2') (#792) 2021-10-09 14:53:23 +08:00
b255e058e5 [parser] *: set charset and collate for string literals correctly (#761)
* done

* address comment

* fix

* revert
2021-10-09 14:53:23 +08:00
46600d4798 [parser] parser, ast: add SetCollatorExpr (#749)
This ExprNode is equivalent to the `Item_func_set_collation` in MySQL,
it is used to specify the collation for the result of another
expression.

Co-authored-by: tangenta <tangenta@126.com>
2021-10-09 14:53:23 +08:00
6eb2909901 [parser] change all dot import, according to staticcheck (#730)
* change all dot import, according to staticcheck

* make staticcheck happy
2021-10-09 14:53:23 +08:00
313a0d13e4 [parser] parser: support sequence function & next value for (#713) 2021-10-09 14:53:23 +08:00
99d1a794b6 [parser] Add Cloud Spanner style read only transaction (#610)
* Add Cloud Spanner style read only transaction

* Put non keywords to the right place

Signed-off-by: Xiaoguang Sun <sunxiaoguang@zhihu.com>
2021-10-09 14:53:23 +08:00
cc817e1324 [parser] *: Support full-text search (#592)
add MATCH(col1,col2,...) AGAINST(expr [search_modifier]) syntax support
2021-10-09 14:53:23 +08:00
b68ad8a55e [parser] ast: fix case expression format bug (#338) 2021-10-09 14:53:23 +08:00
568898c8d7 [parser] type/compatibility: fix show create table output of generated column (#235) 2021-10-09 14:53:23 +08:00
08b3170dd6 [parser] parser: implement Restore for ExistsSubqueryExpr (#126) 2021-10-09 14:53:23 +08:00
258a637aed [parser] parser: fix subquery in PatternInExpr.Restore and add tests (#174) 2021-10-09 14:53:23 +08:00
0e6164a43e [parser] parser: implement Restore for SelectStmt (#153) 2021-10-09 14:53:23 +08:00
d057e9ebaf [parser] parser: implement Restore for ColumnOption, FieldType and ColumnDef (#160) 2021-10-09 14:53:23 +08:00
779495f792 [parser] parser: change the location of RestoreCtx (#157) 2021-10-09 14:53:23 +08:00
1368c22730 [parser] parser: implement Restore for VariableExpr (#87)
* ast, opcode: implement Restore for VariableExpr and fix literal string of operator `EQ`

* address comment but still has some problem

* fix test

* add test case
2021-10-09 14:53:23 +08:00
b7a6c6492a [parser] parser: implement Restore for PositionExpr, ByItem and GroupByClause (#125) 2021-10-09 14:53:23 +08:00
3036851718 [parser] parser: implement Restore for PatternInExpr (#92) 2021-10-09 14:53:23 +08:00
78dddf17c8 [parser] parser: implement Restore for RowExpr (#113) 2021-10-09 14:53:23 +08:00
c3c7944671 [parser] parser: implement Restore for MaxValueExpr (#108) 2021-10-09 14:53:23 +08:00
3828d529b4 [parser] parser: implement Restore for PatternRegexpExpr (#96) 2021-10-09 14:53:23 +08:00
958c8edf12 [parser] parser: implement Restore for ValuesExpr (#99) 2021-10-09 14:53:23 +08:00
bb7f83d165 [parser] parser: Implement Restore for IsTruthExpr (#90) 2021-10-09 14:53:23 +08:00
58e5251368 [parser] parser: implement Restore for PatternLikeExpr (#89) 2021-10-09 14:53:23 +08:00
b3b3fd19eb [parser] parser: implement Restore for DefaultExpr (#84) 2021-10-09 14:53:23 +08:00
6451bd93ea [parser] parser: implement Restore for BinaryOperation, WhenClause, CaseExpr and ParenthesesExpr (#81) 2021-10-09 14:53:23 +08:00
a75b586a76 [parser] parser: implement Restore for BetweenExpr (#71) 2021-10-09 14:53:23 +08:00
3d7841959f [parser] parser: add RestoreCtx and change the Node interface (#78) 2021-10-09 14:53:23 +08:00
46040af3a2 [parser] parser: ast/expressions.go: IsNullExpr (#72) 2021-10-09 14:53:23 +08:00
b3f1c03819 [parser] ast: impl Restore of ColunmNameExpr (#63)
* impl Restore of ColunmNameExpr
2021-10-09 14:53:23 +08:00
8a205ccc0a [parser] *: support AST to SQL text (#56)
* ast2sql demo

* add SQLSentence

* mock func Restore

* change copyright

* add comment

* add test

* change tidb dependentment

* fix error comment

* use strings.Builder

* fix test

* add error return value for Recoverable

* add error return value for Recoverable

* add error return value for Recoverable

* impl Restore of UnaryOperationExpr

* integrate utils

* switch tidb dependency

* add comment

* add comment

* update unit test

* fix Restore of DatabaseOption

* fix Restore of DatabaseOption

* fix Restore of DatabaseOption

* update unit test

* use errorf
2021-10-09 14:53:23 +08:00
c94a71f1fd [parser] parser,ast: fix the TiDB issue #8153 (#27) 2021-10-09 14:53:23 +08:00
9cf30372a0 [parser] Revert "parser,ast: fix the TiDB issue #8153 (#20)" (#24) 2021-10-09 14:53:23 +08:00
4924685876 [parser] parser,ast: fix the TiDB issue #8153 (#20) 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