parser icon indicating copy to clipboard operation
parser copied to clipboard

Add builtin function prototype `get_mvcc_info` in parser

Open imtbkcat opened this issue 4 years ago • 4 comments

Feature Request

This is sub issue of https://github.com/pingcap/tidb/issues/15938

Is your feature request related to a problem? Please describe:

To implement getting mvcc info through SQL, TiDB need to support 4 builtin function. get_mvcc_info is one of them.

Describe the feature you'd like:

add get_mvcc_info into parser.

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

  • Add function name in to functions.go
  • Add test case.

imtbkcat avatar Apr 07 '20 08:04 imtbkcat

Screen Shot 2020-04-07 at 16 20 21

Can we only add one builtin function like get_mvcc_info(method string, param... string) to handle all these scenarios?

The only valid methods are "hex"/"rowid"/"snapshot"/"index". For different methods, we can specify different numbers of parameters.

zz-jason avatar Apr 07 '20 08:04 zz-jason

@zz-jason yes, it will be much clean. so we could close other three issue, and keep one issue for UCP contributor.

imtbkcat avatar Apr 07 '20 08:04 imtbkcat

@zz-jason @imtbkcat If we using the single method get_mvcc_info, it means the parameters passed in have to be in order and have different meanings depends on the first method name? Is it a little bit complicated?

hsqlu avatar Apr 07 '20 08:04 hsqlu

Actually, there are some MySQL builtin functions like this. I think the complication can be accepted.

zz-jason avatar Apr 07 '20 08:04 zz-jason