diff --git a/core/translate/collate.rs b/core/translate/collate.rs index 425de8a8b0..ad0fdc8b0c 100644 --- a/core/translate/collate.rs +++ b/core/translate/collate.rs @@ -59,7 +59,7 @@ impl CollationSeq { #[inline(always)] fn rtrim_cmp(lhs: &str, rhs: &str) -> Ordering { - lhs.trim_end().cmp(rhs.trim_end()) + lhs.trim_end_matches(' ').cmp(rhs.trim_end_matches(' ')) } } diff --git a/testing/select.test b/testing/select.test index a2d1c93aea..21e8c5201f 100755 --- a/testing/select.test +++ b/testing/select.test @@ -1117,4 +1117,9 @@ do_execsql_test_on_specific_db {:memory:} group-by-limit-0 { do_execsql_test_in_memory_any_error duplicate-with-cte-name { CREATE TABLE t2(x INTEGER); WITH t as (SELECT 1), t as (SELECT 2) SELECT * FROM t2; -} \ No newline at end of file +} + +do_execsql_test_on_specific_db {:memory:} collation-rtrim-1 { + SELECT 'x' || CHAR(9) = 'x' COLLATE RTRIM; +} {0} +