-
Notifications
You must be signed in to change notification settings - Fork 3.7k
branch-3.0: [fix](function) fix error result when input utf8 in url_encode, strright, append_trailing_char_if_absent #49127 #50659
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ght, append_trailing_char_if_absent (apache#49127) ### What problem does this PR solve? The url_encode function previously performed a modulus operation on a signed number. Converting it to an unsigned number will fix the issue. ``` before mysql> select url_encode('编码'); +----------------------+ | url_encode('编码') | +----------------------+ | %5.%23%0-%5.%10%/( | +----------------------+ now mysql> select url_encode('编码'); +----------------------+ | url_encode('编码') | +----------------------+ | %E7%BC%96%E7%A0%81 | +----------------------+ ``` The strright function did not calculate the length according to the number of UTF-8 characters. ``` before mysql> select strright("你好世界",5); +----------------------------+ | strright("你好世界",5) | +----------------------------+ | | +----------------------------+ now mysql> select strright("你好世界",5); +----------------------------+ | strright("你好世界",5) | +----------------------------+ | 你好世界 | +----------------------------+ ``` he case of inputting a UTF-8 character was not considered. ``` mysql> select append_trailing_char_if_absent('中文', '文'); +-------------------------------------------------+ | append_trailing_char_if_absent('中文', '文') | +-------------------------------------------------+ | NULL | +-------------------------------------------------+ now mysql> select append_trailing_char_if_absent('中文', '文'); +-------------------------------------------------+ | append_trailing_char_if_absent('中文', '文') | +-------------------------------------------------+ | 中文 | +-------------------------------------------------+ ``` Problem Summary: ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
dataroaring
approved these changes
May 8, 2025
Contributor
dataroaring
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
8 tasks
zclllyybb
pushed a commit
to apache/doris-website
that referenced
this pull request
Dec 1, 2025
The behavior of APPEND_TRAILING_CHAR_IF_ABSENT has been updated in the 3.x branch. Documentation needs to be updated accordingly to reflect the new behavior. ## Related Doris PRs [#50659](apache/doris#50659) [#49346](apache/doris#49346)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
#49127
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)