-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
index problem of substring function and charset support #1098
Comments
@zyguan Thanks for your report! |
Thanks for your reply, @shenli . I see, buitin functions only accept an array of However, the charset/collation info is stored in the |
@zyguan Yes, we have a plan to add collation info into datum. |
* evaluator: fix the incorrect behavior of `substring` function, multi-byte charset still hasn't been supported.
This issue has been resolved in TiDB. Confirming with a recent version:
I am going to close this issue for now, but please feel free to re-open if you have any followup questions. Thanks! |
* domain: add repository worker Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx, domain: add function gate Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine context usage Signed-off-by: xhe <xw897002528@gmail.com> * repository: add recover and session getter Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx: hide variable Signed-off-by: xhe <xw897002528@gmail.com> * fix bazel Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine owner management Signed-off-by: xhe <xw897002528@gmail.com> * repository: free memref Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> --------- Signed-off-by: xhe <xw897002528@gmail.com>
* domain: add repository worker Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx, domain: add function gate Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine context usage Signed-off-by: xhe <xw897002528@gmail.com> * repository: add recover and session getter Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx: hide variable Signed-off-by: xhe <xw897002528@gmail.com> * fix bazel Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine owner management Signed-off-by: xhe <xw897002528@gmail.com> * repository: free memref Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> --------- Signed-off-by: xhe <xw897002528@gmail.com>
* domain: add repository worker Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx, domain: add function gate Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine context usage Signed-off-by: xhe <xw897002528@gmail.com> * repository: add recover and session getter Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx: hide variable Signed-off-by: xhe <xw897002528@gmail.com> * fix bazel Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine owner management Signed-off-by: xhe <xw897002528@gmail.com> * repository: free memref Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> --------- Signed-off-by: xhe <xw897002528@gmail.com>
* domain: add repository worker Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx, domain: add function gate Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine context usage Signed-off-by: xhe <xw897002528@gmail.com> * repository: add recover and session getter Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx: hide variable Signed-off-by: xhe <xw897002528@gmail.com> * fix bazel Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine owner management Signed-off-by: xhe <xw897002528@gmail.com> * repository: free memref Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> --------- Signed-off-by: xhe <xw897002528@gmail.com>
* domain: add repository worker Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx, domain: add function gate Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine context usage Signed-off-by: xhe <xw897002528@gmail.com> * repository: add recover and session getter Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx: hide variable Signed-off-by: xhe <xw897002528@gmail.com> * fix bazel Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine owner management Signed-off-by: xhe <xw897002528@gmail.com> * repository: free memref Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> --------- Signed-off-by: xhe <xw897002528@gmail.com>
* domain: add repository worker Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx, domain: add function gate Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine context usage Signed-off-by: xhe <xw897002528@gmail.com> * repository: add recover and session getter Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx: hide variable Signed-off-by: xhe <xw897002528@gmail.com> * fix bazel Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine owner management Signed-off-by: xhe <xw897002528@gmail.com> * repository: free memref Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> --------- Signed-off-by: xhe <xw897002528@gmail.com>
* domain: add repository worker Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx, domain: add function gate Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine context usage Signed-off-by: xhe <xw897002528@gmail.com> * repository: add recover and session getter Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx: hide variable Signed-off-by: xhe <xw897002528@gmail.com> * fix bazel Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine owner management Signed-off-by: xhe <xw897002528@gmail.com> * repository: free memref Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> --------- Signed-off-by: xhe <xw897002528@gmail.com>
* domain: add repository worker Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx, domain: add function gate Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine context usage Signed-off-by: xhe <xw897002528@gmail.com> * repository: add recover and session getter Signed-off-by: xhe <xw897002528@gmail.com> * sessionctx: hide variable Signed-off-by: xhe <xw897002528@gmail.com> * fix bazel Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> * repository: refine owner management Signed-off-by: xhe <xw897002528@gmail.com> * repository: free memref Signed-off-by: xhe <xw897002528@gmail.com> * fix check Signed-off-by: xhe <xw897002528@gmail.com> --------- Signed-off-by: xhe <xw897002528@gmail.com>
It should be
if pos > int64(len(str)) || pos < int64(0) {
here, otherwisesubstring(s, 1)
always return an empty string. Beside, I see that the code doesn't handle the charset of the string for now, which leads to following result:I'm willing to help, however, I'm not sure how to get the charset info from the context of such a builtin function call.
go version
)?go1.6
go env
)?GOHOSTARCH="amd64"
GOHOSTOS="linux"
exec
select substring("hello", 1, 5);
The text was updated successfully, but these errors were encountered: