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 bug for LIKE pattern with multiple-byte characters #21578

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

hantangwangd
Copy link
Member

@hantangwangd hantangwangd commented Dec 20, 2023

Description

Fixes #21577 .

In UTF8, many characters like Chinese characters are represented by more than one bytes, so we shouldn't simply use the characters length of a string to handle it's corresponding slice. This PR fix the problem.

Test Plan

  • Enhanced test case TestConditions.testLike()

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

== NO RELEASE NOTE ==

@hantangwangd hantangwangd requested a review from a team as a code owner December 20, 2023 08:58
@hantangwangd hantangwangd linked an issue Dec 20, 2023 that may be closed by this pull request
@tdcmeehan tdcmeehan self-assigned this Dec 20, 2023
@tdcmeehan
Copy link
Contributor

Looks like this is a bug since 0.284, introduced by #20436. Thank you for fixing this @hantangwangd

@tdcmeehan
Copy link
Contributor

We should probably patch this in 0.285, as this is a correctness problem. CC: @majetideepak @wanglinsong

@tdcmeehan tdcmeehan merged commit f7dc538 into prestodb:master Dec 20, 2023
56 checks passed
@hantangwangd hantangwangd deleted the little_fix branch December 20, 2023 15:19
@wanglinsong
Copy link
Member

We should probably patch this in 0.285, as this is a correctness problem. CC: @majetideepak @wanglinsong

You mean 0.285.1 patch release?

@tdcmeehan
Copy link
Contributor

@wanglinsong yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does LIKE clause support unicode?
3 participants