diff --git a/0001-Improved-test-for-SQLITE_DETERMINISTIC.patch b/0001-Improved-test-for-SQLITE_DETERMINISTIC.patch new file mode 100644 index 0000000..e383b65 --- /dev/null +++ b/0001-Improved-test-for-SQLITE_DETERMINISTIC.patch @@ -0,0 +1,30 @@ +From e19b2f2ac49d5daa7c6e0bde54441d0fa417ec7c Mon Sep 17 00:00:00 2001 +From: Roger Binns +Date: Wed, 27 May 2020 14:50:13 -0700 +Subject: [PATCH] Improved test for SQLITE_DETERMINISTIC + +https://sqlite.org/forum/forumpost/552e8e236a +--- + tests.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests.py b/tests.py +index 46c0da6..374a33c 100644 +--- a/tests.py ++++ b/tests.py +@@ -1322,9 +1322,11 @@ class APSW(unittest.TestCase): + self.db.createscalarfunction("nondeterministic", Counter(), deterministic=False) + self.db.createscalarfunction("unspecdeterministic", Counter()) + +- self.assertEqual(c.execute("select deterministic()=deterministic()").fetchall()[0][0], 1) ++ # only deterministic can be used for indices ++ c.execute("create table td(a,b); create index tda on td(a) where deterministic()") + self.assertEqual(c.execute("select nondeterministic()=nondeterministic()").fetchall()[0][0], 0) + self.assertEqual(c.execute("select unspecdeterministic()=unspecdeterministic()").fetchall()[0][0], 0) ++ self.assertRaises(apsw.SQLError, c.execute, "create index tdb on td(b) where nondeterministic()") + + def testAggregateFunctions(self): + "Verify aggregate functions" +-- +2.26.2 + diff --git a/python-apsw.spec b/python-apsw.spec index b2e7b71..ee6fc7f 100644 --- a/python-apsw.spec +++ b/python-apsw.spec @@ -26,11 +26,14 @@ Name: python-apsw Version: %{real_version} -Release: 2%{?dist} +Release: 3%{?dist} Summary: Another Python SQLite Wrapper License: zlib URL: https://github.com/rogerbinns/apsw Source: https://github.com/rogerbinns/apsw/releases/download/%{pkg_version}/apsw-%{pkg_version}.zip +# https://github.com/rogerbinns/apsw/commit/e19b2f2ac49d5daa7c6e0bde54441d0fa417ec7c +# Fixes build with Python 3.9 +Patch0: 0001-Improved-test-for-SQLITE_DETERMINISTIC.patch BuildRequires: gcc BuildRequires: python%{python3_pkgversion}-devel @@ -74,6 +77,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} setup.py test %changelog +* Fri May 29 2020 Adam Williamson - 3.31.1.r1-3 +- Backport upstream test improvement to fix build with Python 3.9 + * Tue May 26 2020 Miro HronĨok - 3.31.1.r1-2 - Rebuilt for Python 3.9