9a780a2138
parser: migrate test-infra to testify ( #29087 )
2021-10-27 19:28:49 +08:00
94e30df8e2
parser: fix compiling, add unit tests ( #28700 )
2021-10-11 23:15:25 +08:00
6b60fb9717
[parser] *: Add Digest struct to get bytes of digest ( #1231 )
2021-10-09 14:53:23 +08:00
7515d165a3
[parser] parser: regard NULL as literal when normalizing query ( #1166 )
...
* 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 >
2021-10-09 14:53:23 +08:00
b3efddbbec
[parser] digest: add missed backquote when getting digest ( #1176 )
...
* fix test
* add test
2021-10-09 14:53:23 +08:00
9c4959a061
[parser] lexer: quote identifier when get sql digest ( #1151 )
...
* fix
* fix
* Update digester.go
Co-authored-by: kennytm <kennytm@gmail.com >
Co-authored-by: kennytm <kennytm@gmail.com >
2021-10-09 14:53:23 +08:00
5d55a9dd61
[parser] digester: keep the singleAtIdentifier in normalize ( #1128 )
2021-10-09 14:53:23 +08:00
8d06dff8f2
[parser] digester: consider paramMarker as literal when normalizing SQL ( #1040 )
...
* digester: consider paramMarker when normalizing SQL
* add tests
* delete unnecessary changes
Co-authored-by: Kenan Yao <cauchy1992@gmail.com >
2021-10-09 14:53:23 +08:00
02e3e4fb03
[parser] fix / in normalize ( #790 )
2021-10-09 14:53:23 +08:00
a7ac29bd99
[parser] parser: introduce DigestNormalized and deprecate DigestHash ( #656 )
2021-10-09 14:53:23 +08:00
824bc91f46
[parser] digester: avoid infinite loop when an invalid token is seen ( #313 )
2021-10-09 14:53:23 +08:00
f6cb990bb0
[parser] normalize and generate digest at same time ( #215 )
2021-10-09 14:53:23 +08:00
fee9359019
[parser] support sql digest ( #32 )
2021-10-09 14:53:23 +08:00