[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-19 Thread Berker Peksag


Change by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-19 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 2bb0bf4dd8c0bd4d23eb04afce1a58e07982 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43258: Make sqlite3 callback functions static (GH-24574)
https://github.com/python/cpython/commit/2bb0bf4dd8c0bd4d23eb04afce1a58e07982


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-19 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +23353
pull_request: https://github.com/python/cpython/pull/24574

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-19 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 979b23cbe44071b056ff524c0aa20e5d9794b5b0 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43258: Don't allocate sqlite3 aggregate context for empty queries (GH-24569)
https://github.com/python/cpython/commit/979b23cbe44071b056ff524c0aa20e5d9794b5b0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-18 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
keywords: +patch
pull_requests: +23348
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24569

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-18 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

If no rows match an aggregate query, _pysqlite_step_callback() is never called, 
and _pysqlite_final_callback() is called once. In order to prevent needless 
context allocation, we should pass 0 as the second argument to 
sqlite3_aggregate_context().


Quoting from https://sqlite.org/c3ref/aggregate_context.html:

Within the xFinal callback, it is customary to set N=0 in calls to 
sqlite3_aggregate_context(C,N) so that no pointless memory allocations occur.

--
components: Library (Lib)
messages: 387272
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Prevent needless allocation of sqlite3 aggregate function context
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com