Commit Graph

35 Commits

Author SHA1 Message Date
1d20bbfeb4 *: Annotations to fix gosec warnings of CWE-798 (#31311)
ref pingcap/tidb#31310
2022-01-11 00:21:42 +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
a68e007548 [parser] mysql: fix MaxDurationWidthWithFsp (#1345)
Signed-off-by: wjhuang2016 <huangwenjun1997@gmail.com>
2021-10-09 14:53:23 +08:00
726409a242 [parser] Add 'auth_socket' (#1323) 2021-10-09 14:53:23 +08:00
8d23ad21c9 [parser] auth: add the caching sha2 algorithm for authentication (#1232)
This allows validating passwords against the `authentication_string`
data that MySQL stores for caching_sha2 passwords.

Related:
- https://github.com/pingcap/tidb/issues/9411
2021-10-09 14:53:23 +08:00
xhe
0b7ab92e3a [parser] mysql: small privileges refactor (#1198)
* mysql: extract privs out

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

* mysql: add priv.String()

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

* mysql: add privs.Has()

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

* mysql: add p.SetString() and p.ColumnString()

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

* mysql: add NewPrivFromSetEnum/Column

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

* *: add license

Co-authored-by: kennytm <kennytm@gmail.com>

* *: complete the license

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

Co-authored-by: kennytm <kennytm@gmail.com>
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2021-10-09 14:53:23 +08:00
xhe
8112420b91 [parser] mysql: add create_view to tables_priv (#1201)
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
4bc38d9c99 [parser] privileges: show create view privilege should in AllTablePrivs (#1182)
Co-authored-by: jwxiong <xiongjiwei1996@outlook.com>
2021-10-09 14:53:23 +08:00
8950ad0f44 [parser] *: support dynamic privileges and more extended privileges (#1144)
* *: support dynamic privileges and more extended privileges

* address comment

* address comment
2021-10-09 14:53:23 +08:00
207955cf69 [parser] *: change privilege type to uint64 and support REPLICATION CLIENT, etc (#1121) 2021-10-09 14:53:23 +08:00
79fbb96097 [parser] mysql: add consts for auth switch request (#1088) 2021-10-09 14:53:23 +08:00
6789b2118a [parser] fix CreateTablespacePriv order in const (#1032)
* Add support GRANT CREATE TABLESPACE syntax

* recompilation parser.go

* adjust CreateTablespacePriv constant

* fix CreateTablespacePriv order in const

* add comment
2021-10-09 14:53:23 +08:00
7f3ab46241 [parser] Add support GRANT CREATE TABLESPACE syntax (#1029)
* Add support GRANT CREATE TABLESPACE syntax

* recompilation parser.go

* adjust CreateTablespacePriv constant
2021-10-09 14:53:23 +08:00
305020c36d [parser] const: fix wrong SQL mode const (#1008)
* const: fix wrong SQL mode const

* add test

* remove some change

* trigger CI
2021-10-09 14:53:23 +08:00
3a347a826b [parser] parser: introduce a new privilege for the set config statement (#835) 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
f41adcde4c [parser] parser: add Reload and File privileges (#708) 2021-10-09 14:53:23 +08:00
9de1af2c4e [parser] add GlobalDBVisible to represent global privilege which can see all database (#697)
* add const GlobalDBVisible

* allowed grant priv to see all database
2021-10-09 14:53:23 +08:00
c6a316f63f [parser] support require clauses in grant stmt (#666) 2021-10-09 14:53:23 +08:00
f26c3e85f4 [parser] parser: add support for SHUTDOWN syntax (#580)
* add support for SHUTDOWN syntax

* add SHUTDOWN privilege syntax
2021-10-09 14:53:23 +08:00
0e24ec224b [parser] remove GrantPriv from AllGlobalPrivs/AllDBPrivs/AllTablePrivs (#581)
* remove GrantPriv from AllGlobalPrivs/AllDBPrivs/AllTablePrivs

* handle testcase error
2021-10-09 14:53:23 +08:00
29110a1670 [parser] parser: replace magic numbers with meaningful names (#531) 2021-10-09 14:53:23 +08:00
481f4cb981 [parser] *: make 'grant all privileges' work right (#400) 2021-10-09 14:53:23 +08:00
155441d5b7 [parser] parser: add DROP ROLE support (#237) 2021-10-09 14:53:23 +08:00
538e99277a [parser] mysql: change MySQL version from 5.7.10 to 5.7.25 (#231) 2021-10-09 14:53:23 +08:00
cb0ee3bb8d [parser] parser: fix stored option in generated column restore (#221)
* parser: fix stored option in generated column restore

* parser: replace pkg/errors with pingcap/errors

* parser: address comment
2021-10-09 14:53:23 +08:00
bc337931e8 [parser] parser: add CreateRolePriv and DropRolePriv (#216) 2021-10-09 14:53:23 +08:00
84f9b45d16 [parser] parser: finish the restore function of all ast node (#206)
* add test

* restore bindings

* restore bindings

* restore ddl

* charset info

* charset info

* fix fmt

* use keyword write charset

* gomod

* gosum
2021-10-09 14:53:23 +08:00
426ab7545c [parser] parser: add CreateViewPriv privilege (#138)
Part of View feature implement, add `CreateViewPriv` privilege to parser and related const.
2021-10-09 14:53:23 +08:00
65596c7eaa [parser] mysql: add sql mode ALLOW_INVALID_DATES (#171)
* mysql: add sql mode ALLOW_INVALID_DATES

* add HasAllowInvalidDatesMode
2021-10-09 14:53:23 +08:00
8a1ddc4029 [parser] mysql: update sql-mode default (#45)
Change TiDB to use same default as MySQL 5.7
2021-10-09 14:53:23 +08:00
eb6d7e1783 [parser] mysql: Update sql mode default (#11)
* mysql: Add NO_AUTO_CREATE_USER detection
* mysql: Update Default SQL Mode
* Include No_auto_create_user and only_full_group_by
2021-10-09 14:53:23 +08:00
ad9281aa85 [parser] mysql: NO_AUTO_CREATE_USER detect helper function (#10)
* mysql: Add NO_AUTO_CREATE_USER detection
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