diff --git a/sources b/sources index d7150ae..147ef88 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ -SHA512 (sqlite-doc-3300100.zip) = 373e843015307071443a0db5fb930f9120718f6118cc2e21b506fdc8535fbe6996e9889e8b5809ffb91257addfe778bdf3412a81e11f6bced2c5e0330337d00d -SHA512 (sqlite-autoconf-3300100.tar.gz) = 9ec0283c417fb0323b0e43550af2a49e9a63988e4212c27ea62cc9da3534caa6faf5bdc7e051b6772c4ce61560a433b3d3288b68e05e9ba8495f61a3bcebda3e -SHA512 (sqlite-src-3300100.zip) = f40236d0bb25f3ea01a1192dace3b6732fb671fbdabb7cfa8d0cc2b99d21aef00ae380999fdee904501cb03304644cddfb2506951f36a2f6a83693f311c3c11d +SHA512 (sqlite-src-3310100.zip) = af92a00877bcd90372d6f83a27fea12b4fe8d1155b223a6bccbccc31bb8e3d2269cd9e68f329bc55f70d1068ccbf220ff5abccea6f593fd7a3a4bdd732d1cdbe +SHA512 (sqlite-doc-3310100.zip) = 5572e2c2dac30c014ef9cd60a620b7a7bb610f91a47e2890c0641540d39b9d5ce0e914ee697583130317633918b7827e2612a7cbc024f5bd6aa22ad28a78b56b +SHA512 (sqlite-autoconf-3310100.tar.gz) = d85250ba5f78f0c918880f663741709aba662192f04888b2324a0df17affdf5b8540e8428c6c7315119806e7adad758ea281c9b403c0ad94ac6a9bd1b93fd617 diff --git a/sqlite-3.30.1-CVE-2019-19926.patch b/sqlite-3.30.1-CVE-2019-19926.patch deleted file mode 100644 index d54f8a0..0000000 --- a/sqlite-3.30.1-CVE-2019-19926.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up sqlite-src-3300100/src/select.c.CVE-2019-19926 sqlite-src-3300100/src/select.c ---- sqlite-src-3300100/src/select.c.CVE-2019-19926 2020-01-09 16:20:12.809275851 -0500 -+++ sqlite-src-3300100/src/select.c 2020-01-09 16:20:55.935523511 -0500 -@@ -2805,6 +2805,7 @@ static int multiSelect( - } - #endif - } -+ if( pParse->nErr ) goto multi_select_end; - - /* Compute collating sequences used by - ** temporary tables needed to implement the compound select. diff --git a/sqlite-3.31.1-modify-tests-BE.patch b/sqlite-3.31.1-modify-tests-BE.patch new file mode 100644 index 0000000..2e76a09 --- /dev/null +++ b/sqlite-3.31.1-modify-tests-BE.patch @@ -0,0 +1,69 @@ +From 9048693a09416ead7c8df98234c4ab82e7748d33 Mon Sep 17 00:00:00 2001 +From: Ondrej Dubaj +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 + diff --git a/sqlite-3.31.1-s390-arch-compatibibility.patch b/sqlite-3.31.1-s390-arch-compatibibility.patch new file mode 100644 index 0000000..d234169 --- /dev/null +++ b/sqlite-3.31.1-s390-arch-compatibibility.patch @@ -0,0 +1,120 @@ +From afbd5f941b1167661ed68077cd075bd8bbce378e Mon Sep 17 00:00:00 2001 +From: Ondrej Dubaj +Date: Wed, 29 Jan 2020 08:15:03 +0100 +Subject: [PATCH] Minor change for compatibility with the s390 architecture. + +--- + src/insert.c | 4 +++- + src/parse.y | 6 ++++++ + src/test_multiplex.c | 2 +- + src/vdbeaux.c | 5 ++++- + test/in.test | 22 ++++++++++++++-------- + 5 files changed, 28 insertions(+), 11 deletions(-) + +diff --git a/src/insert.c b/src/insert.c +index 93f22a8..7a04b98 100644 +--- a/src/insert.c ++++ b/src/insert.c +@@ -2170,12 +2170,14 @@ void sqlite3GenerateConstraintChecks( + x = *sqlite3VdbeGetOp(v, addrConflictCk); + if( x.opcode!=OP_IdxRowid ){ + int p2; /* New P2 value for copied conflict check opcode */ ++ const char *zP4; + if( sqlite3OpcodeProperty[x.opcode]&OPFLG_JUMP ){ + p2 = lblRecheckOk; + }else{ + p2 = x.p2; + } +- sqlite3VdbeAddOp4(v, x.opcode, x.p1, p2, x.p3, x.p4.z, x.p4type); ++ zP4 = x.p4type==P4_INT32 ? SQLITE_INT_TO_PTR(x.p4.i) : x.p4.z; ++ sqlite3VdbeAddOp4(v, x.opcode, x.p1, p2, x.p3, zP4, x.p4type); + sqlite3VdbeChangeP5(v, x.p5); + VdbeCoverageIf(v, p2!=x.p2); + } +diff --git a/src/parse.y b/src/parse.y +index 5876a1a..c783c69 100644 +--- a/src/parse.y ++++ b/src/parse.y +@@ -1193,6 +1193,12 @@ expr(A) ::= expr(A) between_op(N) expr(X) AND expr(Y). [BETWEEN] { + */ + sqlite3ExprUnmapAndDelete(pParse, A); + A = sqlite3Expr(pParse->db, TK_INTEGER, N ? "1" : "0"); ++ }else if( 0 && Y->nExpr==1 && sqlite3ExprIsConstant(Y->a[0].pExpr) ){ ++ Expr *pRHS = Y->a[0].pExpr; ++ Y->a[0].pExpr = 0; ++ sqlite3ExprListDelete(pParse->db, Y); ++ A = sqlite3PExpr(pParse, TK_EQ, A, pRHS); ++ if( N ) A = sqlite3PExpr(pParse, TK_NOT, A, 0); + }else{ + A = sqlite3PExpr(pParse, TK_IN, A, 0); + if( A ){ +diff --git a/src/test_multiplex.c b/src/test_multiplex.c +index ed8c9f7..56e78c3 100644 +--- a/src/test_multiplex.c ++++ b/src/test_multiplex.c +@@ -530,7 +530,7 @@ static int multiplexOpen( + pGroup->szChunk += 65536; + } + } +- pGroup->flags = flags; ++ pGroup->flags = (flags & ~SQLITE_OPEN_URI); + rc = multiplexSubFilename(pGroup, 1); + if( rc==SQLITE_OK ){ + pSubOpen = multiplexSubOpen(pGroup, 0, &rc, pOutFlags, 0); +diff --git a/src/vdbeaux.c b/src/vdbeaux.c +index fab8b70..c38a4f7 100644 +--- a/src/vdbeaux.c ++++ b/src/vdbeaux.c +@@ -4726,7 +4726,10 @@ static int vdbeRecordCompareString( + + assert( pPKey2->aMem[0].flags & MEM_Str ); + vdbeAssertFieldCountWithinLimits(nKey1, pKey1, pPKey2->pKeyInfo); +- getVarint32(&aKey1[1], serial_type); ++ serial_type = (u8)(aKey1[1]); ++ if( serial_type >= 0x80 ){ ++ sqlite3GetVarint32(&aKey1[1], (u32*)&serial_type); ++ } + if( serial_type<12 ){ + res = pPKey2->r1; /* (pKey1/nKey1) is a number or a null */ + }else if( !(serial_type & 0x01) ){ +diff --git a/test/in.test b/test/in.test +index 4595d5f..a1fe1d2 100644 +--- a/test/in.test ++++ b/test/in.test +@@ -765,19 +765,25 @@ do_execsql_test in-18.1 { + # + # Also ticket https://sqlite.org/src/info/29f635e0af71234b + # +-do_execsql_test in-19.1 { ++do_execsql_test in-19.10 { + DROP TABLE IF EXISTS t0; + CREATE TABLE t0(c0 REAL UNIQUE); +- INSERT INTO t0(c0) VALUES(2.07093491255203046E18); +- SELECT 1 FROM t0 WHERE c0 IN ('2070934912552030444'); ++ INSERT INTO t0(c0) VALUES(2.0625E00); ++ SELECT 1 FROM t0 WHERE c0 IN ('2.0625'); + } {1} +-do_execsql_test in-19.2 { +- SELECT c0 IN ('2070934912552030444') FROM t0; ++do_execsql_test in-19.20 { ++ SELECT c0 IN ('2.0625') FROM t0; + } {1} +-do_execsql_test in-19.3 { +- SELECT c0 IN ('2070934912552030444',2,3) FROM t0; ++do_execsql_test in-19.21 { ++ SELECT c0 = ('2.0625') FROM t0; + } {1} +-do_execsql_test in-19.4 { ++do_execsql_test in-19.22 { ++ SELECT c0 = ('0.20625e+01') FROM t0; ++} {1} ++do_execsql_test in-19.30 { ++ SELECT c0 IN ('2.0625',2,3) FROM t0; ++} {1} ++do_execsql_test in-19.40 { + DROP TABLE t0; + CREATE TABLE t0(c0 TEXT, c1 REAL, c2, PRIMARY KEY(c2, c0, c1)); + CREATE INDEX i0 ON t0(c1 IN (c0)); +-- +2.19.1 + diff --git a/sqlite.spec b/sqlite.spec index f179520..b204ff1 100644 --- a/sqlite.spec +++ b/sqlite.spec @@ -4,20 +4,21 @@ %bcond_with static %bcond_without check -%define realver 3300100 -%define docver 3300100 -%define rpmver 3.30.1 +%define realver 3310100 +%define docver 3310100 +%define rpmver 3.31.1 +%define year 2020 Summary: Library that implements an embeddable SQL database engine Name: sqlite Version: %{rpmver} -Release: 4%{?dist} +Release: 1%{?dist} License: Public Domain URL: http://www.sqlite.org/ -Source0: http://www.sqlite.org/2019/sqlite-src-%{realver}.zip -Source1: http://www.sqlite.org/2019/sqlite-doc-%{docver}.zip -Source2: http://www.sqlite.org/2019/sqlite-autoconf-%{realver}.tar.gz +Source0: http://www.sqlite.org/%{year}/sqlite-src-%{realver}.zip +Source1: http://www.sqlite.org/%{year}/sqlite-doc-%{docver}.zip +Source2: http://www.sqlite.org/%{year}/sqlite-autoconf-%{realver}.tar.gz # Support a system-wide lemon template Patch1: sqlite-3.6.23-lemon-system-template.patch # sqlite >= 3.7.10 is buggy if malloc_usable_size() is detected, disable it: @@ -30,9 +31,15 @@ Patch3: sqlite-3.8.0-percentile-test.patch Patch4: sqlite-3.16-datetest-2.2c.patch # Modify sync2.test to pass with DIRSYNC turned off Patch5: sqlite-3.18.0-sync2-dirsync.patch -# Apply upstream fix for CVE-2019-19880 -# https://github.com/sqlite/sqlite/commit/8428b3b437569338a9d1e10c4cd8154acbe33089 -Patch6: sqlite-3.30.1-CVE-2019-19926.patch +# Resolving s390 arch incompatibility +# https://github.com/sqlite/sqlite/commit/b9f2e5f7774cee2282c2b0980bc29233e643200f +# https://github.com/sqlite/sqlite/commit/4b2f45be3426f18efbe251d39352e11e256b93e9 +# https://github.com/sqlite/sqlite/commit/fbfd113365bb001152adb9944e127e9620ec3738 +# https://github.com/sqlite/sqlite/commit/925ab5c17ef1061e2d9086e162e8381c4b2ebb2a +Patch6: sqlite-3.31.1-s390-arch-compatibibility.patch +# Modifying FTS tests to support big endian platforms +# https://github.com/sqlite/sqlite/commit/9ca9a53a421920a412d4fdfd57303593c1ecf723 +Patch7: sqlite-3.31.1-modify-tests-BE.patch BuildRequires: gcc BuildRequires: ncurses-devel readline-devel glibc-devel @@ -141,6 +148,7 @@ This package contains the analysis program for %{name}. %endif %patch5 -p1 %patch6 -p1 +%patch7 -p1 # Remove backup-file rm -f %{name}-doc-%{docver}/sqlite.css~ || : @@ -218,7 +226,7 @@ rm test/fts3conf.test %endif make test -%endif # with check +%endif #with check %ldconfig_scriptlets libs @@ -260,6 +268,12 @@ make test %endif %changelog +* Wed Feb 05 2020 Ondrej Dubaj - 3.31.1-1 +- 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 + * Fri Jan 31 2020 Fedora Release Engineering - 3.30.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild