Skip to content

fix: Do not use Unicode functions on lower and upper functions because of type incompatibility with string#210

Open
inoorinoor wants to merge 1 commit intoydb-platform:mainfrom
inoorinoor:fix-lower-upper-functions
Open

fix: Do not use Unicode functions on lower and upper functions because of type incompatibility with string#210
inoorinoor wants to merge 1 commit intoydb-platform:mainfrom
inoorinoor:fix-lower-upper-functions

Conversation

@inoorinoor
Copy link
Contributor

@inoorinoor inoorinoor commented Mar 19, 2026

Query like this select e from StringEntity e where lower(e.name) like lower(concat('%', :search, '%')) fails with type incompatibility with Utf8 and String
This happens because lower and upper function are implemented by Unicode functions.

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Query like this select e from StringEntity e where lower(e.name) like lower(concat('%', :search, '%')) fails with
120:2 - 120:2: Mismatch type argument #1, type diff: Utf8!=String (S_ERROR)] error because in lower and upper functions are used Unicode::ToLower and Unicode::ToUpper.

Issue Number: N/A

What is the new behavior?

  • Implementation of lower is changed from Unicode::ToLower to String::AsciiToLower
  • Implementation of lower is changed from Unicode::ToUpper to String::AsciiToUpper

Other information

Added test that produces bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant