classification
Title: sqlite crashes with converters mutating cursor
Type: crash Stage: patch review
Components: Extension Modules Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, ghaering, sir-sigurd
Priority: normal Keywords: patch

Created on 2019-02-22 07:44 by sir-sigurd, last changed 2019-06-22 04:32 by xtreak.

Pull Requests
URL Status Linked Edit
PR 11984 open sir-sigurd, 2019-02-22 07:48
Messages (1)
msg336283 - (view) Author: Sergey Fedoseev (sir-sigurd) * Date: 2019-02-22 07:44
It's somewhat similar to bpo-10811, but for converter function:

In [197]: import sqlite3 as sqlite
     ...: con = sqlite.connect(':memory:', detect_types=sqlite.PARSE_COLNAMES)
     ...: cur = con.cursor()
     ...: sqlite.converters['CURSOR_INIT'] = lambda x: cur.__init__(con)
     ...: 
     ...: cur.execute('create table test(x foo)')
     ...: cur.execute('insert into test(x) values (?)', ('foo',))
     ...: cur.execute('select x as "x [CURSOR_INIT]", x from test')
     ...: 
[1]    25718 segmentation fault  python manage.py shell

Similar to bpo-10811, proposed patch raises ProgrammingError instead of crashing.
History
Date User Action Args
2019-06-22 04:32:19xtreaksetnosy: + berker.peksag
2019-02-22 07:53:44SilentGhostsetnosy: + ghaering

versions: + Python 3.7, Python 3.8
2019-02-22 07:48:13sir-sigurdsetkeywords: + patch
stage: patch review
pull_requests: + pull_request12008
2019-02-22 07:44:47sir-sigurdcreate