1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix the implementation of the built-in RTRIM collating sequence so that

it works for control characters at the end of the string.
Ticket [f1580ba1b574e9e9]

FossilOrigin-Name: 86fa0087cd1f5c79ed51b99a226ec2eef5b0fa0a23981d469bec0e02fadf2a68
This commit is contained in:
drh
2019-06-14 13:24:46 +00:00
parent 060b7fa974
commit 821afa44c1
4 changed files with 46 additions and 37 deletions

View File

@@ -400,5 +400,21 @@ do_execsql_test 7.2 {
ORDER BY 1 COLLATE binary COLLATE binary COLLATE binary COLLATE nocase;
} {abc DEF}
# 2019-06-14
# https://sqlite.org/src/info/f1580ba1b574e9e9
#
do_execsql_test 8.0 {
SELECT ' ' > char(20) COLLATE rtrim;
} 0
do_execsql_test 8.1 {
SELECT '' < char(20) COLLATE rtrim;
} 1
do_execsql_test 8.2 {
DROP TABLE IF EXISTS t0;
CREATE TABLE t0(c0 COLLATE RTRIM, c1 BLOB UNIQUE,
PRIMARY KEY (c0, c1)) WITHOUT ROWID;
INSERT INTO t0 VALUES (123, 3), (' ', 1), (' ', 2), ('', 4);
SELECT * FROM t0 WHERE c1 = 1;
} {{ } 1}
finish_test