Fixed issue with some walro2 tests failing on ppc64

This commit is contained in:
Petr Kubat 2018-02-06 09:01:50 +01:00
parent 3bf8338e67
commit 356bcdfff8
2 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,68 @@
Index: test/walro2.test
==================================================================
--- test/walro2.test
+++ test/walro2.test
@@ -37,10 +37,22 @@
} else {
forcecopy test.db-shm test.db2-shm
}
}
+# Most systems allocate the *-shm file in 32KB trunks. But on UNIX systems
+# for which the getpagesize() call returns greater than 32K, the *-shm
+# file is allocated in page-sized units (since you cannot mmap part of
+# a page). The following code sets variable $MINSHMSZ to the smallest
+# possible *-shm file (i.e. the greater of 32KB and the system page-size).
+#
+do_execsql_test 0.0 {
+ PRAGMA journal_mode = wal;
+ CREATE TABLE t1(x);
+} {wal}
+set MINSHMSZ [file size test.db-shm]
+
foreach bZeroShm {0 1} {
set TN [expr $bZeroShm+1]
do_multiclient_test tn {
# Close all connections and delete the database.
@@ -167,11 +179,11 @@
code2 { db2 close }
sql1 { SELECT * FROM t1 }
} {a b c d e f g h 1 2}
do_test $TN.3.2.2 {
list [file size test.db-wal] [file size test.db-shm]
- } {0 32768}
+ } [list 0 $MINSHMSZ]
do_test $TN.3.3.0 {
code2 { sqlite3 db2 test.db }
sql2 {
INSERT INTO t1 VALUES(3, 4);
@@ -180,11 +192,11 @@
INSERT INTO t1 VALUES(9, 10);
}
code2 { db2 close }
code1 { db close }
list [file size test.db-wal] [file size test.db-shm]
- } [list [wal_file_size 4 1024] 32768]
+ } [list [wal_file_size 4 1024] $MINSHMSZ]
do_test $TN.3.3.1 {
code1 { sqlite3 db file:test.db?readonly_shm=1 }
sql1 { SELECT * FROM t1 }
} {a b c d e f g h 1 2 3 4 5 6 7 8 9 10}
do_test $TN.3.3.2 {
@@ -194,11 +206,11 @@
DELETE FROM t1;
INSERT INTO t1 VALUES('i', 'ii');
}
code2 { db2 close }
list [file size test.db-wal] [file size test.db-shm]
- } [list [wal_file_size 4 1024] 32768]
+ } [list [wal_file_size 4 1024] $MINSHMSZ]
do_test $TN.3.3.3 {
sql1 { SELECT * FROM t1 }
} {i ii}
#-----------------------------------------------------------------------

View File

@ -38,6 +38,9 @@ Patch8: sqlite-3.18.0-sync2-dirsync.patch
Patch9: sqlite-3.22.0-int-float-compare.patch
# Upstream: https://www.sqlite.org/src/info/e4766cabdf64d8e9
Patch10: sqlite-3.22.0-fts3rank-big-endian.patch
# Upstream pt1: https://www.sqlite.org/src/info/d9e59cfb8476e1ec
# Upstream pt2: https://www.sqlite.org/src/info/ba0631de60ca38bf
Patch11: sqlite-3.22.0-walro2-filesize.patch
BuildRequires: ncurses-devel readline-devel glibc-devel
BuildRequires: autoconf
@ -143,6 +146,7 @@ This package contains the analysis program for %{name}.
%patch8 -p1
%patch9 -p0
%patch10 -p0
%patch11 -p0
autoconf # Rerun with new autoconf to add support for aarm64
@ -244,6 +248,9 @@ make test
%endif
%changelog
* Mon Feb 05 2018 Petr Kubat <pkubat@redhat.com> - 3.22.0-2
- Fixed issue with some walro2 tests failing on ppc64
* Sat Feb 03 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.22.0-2
- Switch to %%ldconfig_scriptlets