summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-02-19 11:20:32 (GMT)
committerGitHub <noreply@github.com>2021-02-19 11:20:32 (GMT)
commit979b23cbe44071b056ff524c0aa20e5d9794b5b0 (patch)
tree8535885fd31257d7e8269d3e5c7777a96e899c5c /Lib/sqlite3
parente92d67dfbb4790df37aa6a0961fb6dc7e8d2fbbf (diff)
downloadcpython-979b23cbe44071b056ff524c0aa20e5d9794b5b0.zip
cpython-979b23cbe44071b056ff524c0aa20e5d9794b5b0.tar.gz
cpython-979b23cbe44071b056ff524c0aa20e5d9794b5b0.tar.bz2
bpo-43258: Don't allocate sqlite3 aggregate context for empty queries (GH-24569)
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r--Lib/sqlite3/test/userfunctions.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/userfunctions.py b/Lib/sqlite3/test/userfunctions.py
index 2285abd..749ea04 100644
--- a/Lib/sqlite3/test/userfunctions.py
+++ b/Lib/sqlite3/test/userfunctions.py
@@ -429,6 +429,11 @@ class AggregateTests(unittest.TestCase):
val = cur.fetchone()[0]
self.assertEqual(val, 60)
+ def test_aggr_no_match(self):
+ cur = self.con.execute("select mysum(i) from (select 1 as i) where i == 0")
+ val = cur.fetchone()[0]
+ self.assertIsNone(val)
+
class AuthorizerTests(unittest.TestCase):
@staticmethod
def authorizer_cb(action, arg1, arg2, dbname, source):