Skip to content
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

[fix] fix ltrim result may incorrect in some case #7963

Merged
merged 1 commit into from
Feb 9, 2022

Conversation

yangzhg
Copy link
Member

@yangzhg yangzhg commented Feb 7, 2022

Problem Summary:

fix ltrim result may incorrect in some case
according to https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
Built-in Function: int __builtin_cl/tz (unsigned int x)
If x is 0, the result is undefined.
So we handle the case of 0 separately

this function return different between gcc and clang when x is 0

Checklist(Required)

  1. Does it affect the original behavior: (Yes)
  2. Has unit tests been added: (Yes)
  3. Has document been added or modified: (No Need)
  4. Does it need to update dependencies: (No)
  5. Are there any changes that cannot be rolled back: (No)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@xinghuayu007
Copy link
Contributor

please add some unit tests for case: __builtin_cl/tz (0)

@amosbird
Copy link
Contributor

amosbird commented Feb 7, 2022

Similar fixes has been done in #7712 , which was caught by current unit tests. It's an indication that test coverage should be improved.

@yangzhg
Copy link
Member Author

yangzhg commented Feb 7, 2022

please add some unit tests for case: __builtin_cl/tz (0)

Unit test has already contained this situation

@yangzhg
Copy link
Member Author

yangzhg commented Feb 7, 2022

Similar fixes has been done in #7712 , which was caught by current unit tests. It's an indication that test coverage should be improved.

I see, this is in another function, we may merge the those implements together

@xinghuayu007
Copy link
Contributor

LGTM

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Feb 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2022

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2022

PR approved by anyone and no changes requested.

@morningman morningman merged commit 5029ef4 into apache:master Feb 9, 2022
@yangzhg yangzhg deleted the fix_trim branch February 14, 2022 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants