sqlite/sqlite-3.31.1-modify-tests-BE.patch
Ondrej Dubaj 236dd0f14c - Updated to version 3.31.1 (https://sqlite.org/releaselog/3_31_1.html)
- updated spec file, deleted useless patches
- Resolved s390 arch incompatibility
- Modified FTS tests to support big endian platforms
2020-02-05 08:48:04 +01:00

70 lines
2.7 KiB
Diff

From 9048693a09416ead7c8df98234c4ab82e7748d33 Mon Sep 17 00:00:00 2001
From: Ondrej Dubaj <odubaj@redhat.com>
Date: Wed, 5 Feb 2020 07:33:00 +0100
Subject: [PATCH] Modify a couple of FTS test cases so that they work on
big-endian platforms.
---
ext/fts5/test/fts5matchinfo.test | 11 +++++++----
test/fts4aa.test | 7 ++++++-
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/ext/fts5/test/fts5matchinfo.test b/ext/fts5/test/fts5matchinfo.test
index d8d8d84..5706933 100644
--- a/ext/fts5/test/fts5matchinfo.test
+++ b/ext/fts5/test/fts5matchinfo.test
@@ -500,14 +500,18 @@ do_execsql_test 15.0 {
INSERT INTO t1 VALUES('c', 'd');
}
+if {$tcl_platform(byteOrder)=="littleEndian"} {
+ set res {X'02000000'}
+} else {
+ set res {X'00000002'}
+}
do_execsql_test 15.1 {
SELECT quote(matchinfo(t1, 'n')) FROM t1 LIMIT 1;
-} {X'02000000'}
-
+} $res
do_execsql_test 15.2 {
DELETE FROM t1_content WHERE rowid=1;
SELECT quote(matchinfo(t1, 'n')) FROM t1 LIMIT 1;
-} {X'02000000'}
+} $res
fts5_aux_test_functions db
do_execsql_test 15.3 {
@@ -517,4 +521,3 @@ do_execsql_test 15.3 {
}
finish_test
-
diff --git a/test/fts4aa.test b/test/fts4aa.test
index 7349841..112d60a 100644
--- a/test/fts4aa.test
+++ b/test/fts4aa.test
@@ -229,13 +229,18 @@ do_catchsql_test fts4aa-5.70 {
# 2019-11-18 https://bugs.chromium.org/p/chromium/issues/detail?id=1025467
db close
sqlite3 db :memory:
+if {$tcl_platform(byteOrder)=="littleEndian"} {
+ set res {X'0200000000000000000000000E0000000E00000001000000010000000100000001000000'}
+} else {
+ set res {X'0000000200000000000000000000000E0000000E00000001000000010000000100000001'}
+}
do_execsql_test fts4aa-6.10 {
CREATE VIRTUAL TABLE f USING fts4();
INSERT INTO f_segdir VALUES (77,91,0,0,'255 77',x'0001308000004d5c4ddddddd4d4d7b4d4d4d614d8019ff4d05000001204d4d2e4d6e4d4d4d4b4d6c4d004d4d4d4d4d4d3d000000004d5d4d4d645d4d004d4d4d4d4d4d4d4d4d454d6910004d05ffff054d646c4d004d5d4d4d4d4d3d000000004d4d4d4d4d4d4d4d4d4d4d69624d4d4d04004d4d4d4d4d604d4ce1404d554d45');
INSERT INTO f_segdir VALUES (77,108,0,0,'255 77',x'0001310000fa64004d4d4d3c5d4d654d4d4d614d8000ff4d05000001204d4d2e4d6e4d4d4dff4d4d4d4d4d4d00104d4d4d4d000000004d4d4d0400311d4d4d4d4d4d4d4d4d4d684d6910004d05ffff054d4d6c4d004d4d4d4d4d4d3d000000004d4d4d4d644d4d4d4d4d4d69624d4d4d03ed4d4d4d4d4d604d4ce1404d550080');
INSERT INTO f_stat VALUES (0,x'80808080100000000064004d4d4d3c4d4d654d4d4d614d8000ff4df6ff1a00204d4d2e4d6e4d4d4d104d4d4d4d4d4d00104d4d4d4d4d4d69574d4d4d000031044d4d4d3e4d4d4c4d05004d6910');
SELECT quote(matchinfo(f,'pnax')) from f where f match '0 1';
-} {X'0200000000000000000000000E0000000E00000001000000010000000100000001000000'}
+} $res
# 2019-11-18 Detect infinite loop in fts3SelectLeaf()
db close
--
2.19.1