Skip to content

regress: add test for string ordering with mixed-case values - #2610

Open
Almaryj1 wants to merge 1 commit into
apache:masterfrom
Almaryj1:fix/regress-string-ordering-test
Open

Almaryj1 wants to merge 1 commit into
apache:masterfrom
Almaryj1:fix/regress-string-ordering-test

Conversation

@Almaryj1

Copy link
Copy Markdown

Summary

Fixes #2604.

String comparisons between uppercase and lowercase characters return incorrect results in AGE. 'D' < 'a' returns false but D (U+0044) has a lower Unicode code point than a (U+0061), so the expected result is true.

Regression tests added

Added tests to regress/sql/expr.sql and regress/expected/expr.out covering:

  • Single character comparison: 'D' < 'a' → expected true
  • Doubled string comparison: 'DD' < 'a' → expected true
  • Greater-than-or-equal: 'DD' >= 'a' → expected false
  • All three in a single query
  • Concatenated string comparison with UNWIND to verify NOT ((value + value) >= 'a') returns correct per-row results

Expected output

The .out file records the correct expected values based on Unicode code point ordering, so the regression test will fail until the underlying comparison bug is fixed.

String comparison with mixed-case values returned incorrect results.
'D' < 'a' returned false, but D (U+0044) has a lower Unicode code
point than a (U+0061) so the expected result is true.

Adds regression tests to expr.sql covering single character, doubled
character, combined query, and concatenated string comparison cases.

Fixes apache#2604
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.

String ordering returns unexpected results for uppercase and lowercase values

1 participant