Correct Rtrim

This commit is contained in:
pedrocarlo
2025-04-20 04:28:56 -03:00
parent 6d7a73fd60
commit cc86c789d6
2 changed files with 11 additions and 3 deletions

View File

@@ -48,6 +48,6 @@ impl CollationSeq {
}
fn rtrim_cmp(lhs: &str, rhs: &str) -> Ordering {
lhs.trim().cmp(rhs.trim())
lhs.trim_end().cmp(rhs.trim_end())
}
}

View File

@@ -18,13 +18,21 @@ do_execsql_test collate-binary-2 {
} {1}
do_execsql_test collate-rtrim-1 {
SELECT 'hat' == ' hAt ' COLLATE RTRIM;
SELECT 'hat' == 'hAt ' COLLATE RTRIM;
} {0}
do_execsql_test collate-rtrim-2 {
SELECT 'hat' == ' hat ' COLLATE RTRIM;
SELECT 'hat' == 'hat ' COLLATE RTRIM;
} {1}
do_execsql_test collate-rtrim-3 {
SELECT 'hat' == ' hAt ' COLLATE RTRIM;
} {0}
do_execsql_test collate-rtrim-4 {
SELECT 'hat' == ' hat ' COLLATE RTRIM;
} {0}
do_execsql_test collate-left-precedence {
SELECT 'hat' COLLATE BINARY == 'hAt' COLLATE NOCASE;
} {0}