diff --git a/sqlite3-django.patch b/sqlite3-django.patch new file mode 100644 index 0000000..556b249 --- /dev/null +++ b/sqlite3-django.patch @@ -0,0 +1,147 @@ +Index: sqlite-src-3300100/ext/fts5/test/fts5misc.test +=================================================================== +--- sqlite-src-3300100.orig/ext/fts5/test/fts5misc.test ++++ sqlite-src-3300100/ext/fts5/test/fts5misc.test +@@ -106,6 +106,31 @@ do_execsql_test 2.2.5 { + INSERT INTO vt0(vt0) VALUES('integrity-check'); + } + ++#------------------------------------------------------------------------- ++# ++reset_db ++do_execsql_test 7.0 { ++ CREATE VIRTUAL TABLE t1 USING fts5(x); ++ INSERT INTO t1(rowid, x) VALUES(1, 'hello world'); ++ INSERT INTO t1(rowid, x) VALUES(2, 'well said'); ++ INSERT INTO t1(rowid, x) VALUES(3, 'hello said'); ++ INSERT INTO t1(rowid, x) VALUES(4, 'well world'); ++ ++ CREATE TABLE t2 (a, b); ++ INSERT INTO t2 VALUES(1, 'hello'); ++ INSERT INTO t2 VALUES(2, 'world'); ++ INSERT INTO t2 VALUES(3, 'said'); ++ INSERT INTO t2 VALUES(4, 'hello'); ++} ++ ++do_execsql_test 7.1 { ++ SELECT rowid FROM t1 WHERE (rowid, x) IN (SELECT a, b FROM t2); ++} ++ ++do_execsql_test 7.2 { ++ SELECT rowid FROM t1 WHERE rowid=2 AND t1 = 'hello'; ++} ++ + + finish_test + +Index: sqlite-src-3300100/src/wherecode.c +=================================================================== +--- sqlite-src-3300100.orig/src/wherecode.c ++++ sqlite-src-3300100/src/wherecode.c +@@ -1307,7 +1307,9 @@ Bitmask sqlite3WhereCodeOneLoopStart( + pTerm = pLoop->aLTerm[j]; + if( j<16 && (pLoop->u.vtab.omitMask>>j)&1 ){ + disableTerm(pLevel, pTerm); +- }else if( (pTerm->eOperator & WO_IN)!=0 ){ ++ }else if( (pTerm->eOperator & WO_IN)!=0 && ++ sqlite3ExprVectorSize(pTerm->pExpr->pLeft)==1 ++ ){ + Expr *pCompare; /* The comparison operator */ + Expr *pRight; /* RHS of the comparison */ + VdbeOp *pOp; /* Opcode to access the value of the IN constraint */ +Index: sqlite-src-3300100/test/rowvaluevtab.test +=================================================================== +--- /dev/null ++++ sqlite-src-3300100/test/rowvaluevtab.test +@@ -0,0 +1,91 @@ ++# 2018 October 14 ++# ++# The author disclaims copyright to this source code. In place of ++# a legal notice, here is a blessing: ++# ++# May you do good and not evil. ++# May you find forgiveness for yourself and forgive others. ++# May you share freely, never taking more than you give. ++# ++#*********************************************************************** ++# ++ ++ ++set testdir [file dirname $argv0] ++source $testdir/tester.tcl ++set ::testprefix rowvaluevtab ++ ++register_echo_module db ++ ++do_execsql_test 1.0 { ++ CREATE TABLE t1(a, b, c); ++ CREATE INDEX t1b ON t1(b); ++ INSERT INTO t1 VALUES('one', 1, 1); ++ INSERT INTO t1 VALUES('two', 1, 2); ++ INSERT INTO t1 VALUES('three', 1, 3); ++ INSERT INTO t1 VALUES('four', 2, 1); ++ INSERT INTO t1 VALUES('five', 2, 2); ++ INSERT INTO t1 VALUES('six', 2, 3); ++ INSERT INTO t1 VALUES('seven', 3, 1); ++ INSERT INTO t1 VALUES('eight', 3, 2); ++ INSERT INTO t1 VALUES('nine', 3, 3); ++ ++ WITH s(i) AS ( ++ SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<10000 ++ ) INSERT INTO t1 SELECT NULL, NULL, NULL FROM s; ++ CREATE VIRTUAL TABLE e1 USING echo(t1); ++} ++ ++proc do_vfilter4_test {tn sql expected} { ++ set res [list] ++ db eval "explain $sql" { ++ if {$opcode=="VFilter"} { ++ lappend res $p4 ++ } ++ } ++ uplevel [list do_test $tn [list set {} $res] [list {*}$expected]] ++} ++ ++do_execsql_test 1.1 { ++ SELECT a FROM e1 WHERE (b, c) = (2, 2) ++} {five} ++do_vfilter4_test 1.1f { ++ SELECT a FROM e1 WHERE (b, c) = (?, ?) ++} {{SELECT rowid, a, b, c FROM 't1' WHERE b = ?}} ++ ++do_execsql_test 1.2 { ++ SELECT a FROM e1 WHERE (b, c) > (2, 2) ++} {six seven eight nine} ++do_vfilter4_test 1.2f { ++ SELECT a FROM e1 WHERE (b, c) > (2, 2) ++} { ++ {SELECT rowid, a, b, c FROM 't1' WHERE b >= ?} ++} ++ ++do_execsql_test 1.3 { ++ SELECT a FROM e1 WHERE (b, c) >= (2, 2) ++} {five six seven eight nine} ++do_vfilter4_test 1.3f { ++ SELECT a FROM e1 WHERE (b, c) >= (2, 2) ++} { ++ {SELECT rowid, a, b, c FROM 't1' WHERE b >= ?} ++} ++ ++do_execsql_test 1.3 { ++ SELECT a FROM e1 WHERE (b, c) BETWEEN (1, 2) AND (2, 3) ++} {two three four five six} ++do_vfilter4_test 1.3f { ++ SELECT a FROM e1 WHERE (b, c) BETWEEN (1, 2) AND (2, 3) ++} { ++ {SELECT rowid, a, b, c FROM 't1' WHERE b >= ? AND b <= ?} ++} ++ ++do_execsql_test 1.4 { ++ SELECT a FROM e1 WHERE (b, c) IN ( VALUES(2, 2) ) ++} {five} ++do_vfilter4_test 1.4f { ++ SELECT a FROM e1 WHERE (b, c) IN ( VALUES(2, 2) ) ++} {{SELECT rowid, a, b, c FROM 't1' WHERE b = ?}} ++ ++finish_test ++ diff --git a/sqlite3.changes b/sqlite3.changes index 4328ca6..0a39447 100644 --- a/sqlite3.changes +++ b/sqlite3.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Dec 10 11:30:35 UTC 2019 - Martin Pluskal + +- Add sqlite3-django.patch to fix builds of django + ------------------------------------------------------------------- Fri Oct 11 15:05:00 UTC 2019 - Andreas Stieger diff --git a/sqlite3.spec b/sqlite3.spec index 6dc58f8..a4c0d22 100644 --- a/sqlite3.spec +++ b/sqlite3.spec @@ -1,7 +1,7 @@ # # spec file for package sqlite3 # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,6 +28,7 @@ URL: http://www.sqlite.org/ Source0: http://www.sqlite.org/2019/sqlite-src-%{tarversion}.zip Source1: baselibs.conf Source2: http://www.sqlite.org/2019/sqlite-doc-%{tarversion}.zip +Patch0: sqlite3-django.patch BuildRequires: automake BuildRequires: libtool BuildRequires: pkgconfig @@ -103,6 +104,7 @@ other documentation found on sqlite.org. The files can be found in %prep %setup -q -n sqlite-src-%{tarversion} -a2 +%patch0 -p1 rm -v sqlite-doc-%{tarversion}/releaselog/current.html ln -sv `echo %{version} | sed "s/\./_/g"`.html sqlite-doc-%{tarversion}/releaselog/current.html find -type f -name sqlite.css~ -delete