Issue 34052: sqlite's create_function() raises exception on unhashable callback, but creates function
Created on 2018-07-05 10:34 by sir-sigurd, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 8113 | merged | sir-sigurd, 2018-07-05 10:39 | |
| PR 10946 | merged | serhiy.storchaka, 2018-12-05 20:27 | |
| PR 10952 | merged | miss-islington, 2018-12-05 21:10 | |
| PR 10955 | merged | serhiy.storchaka, 2018-12-05 21:33 | |
| Messages (5) | |||
|---|---|---|---|
| msg321094 - (view) | Author: Sergey Fedoseev (sir-sigurd) * | Date: 2018-07-05 10:34 | |
In [1]: import sqlite3
In [2]: con = sqlite3.connect(':memory:')
In [3]: con.execute('SELECT f()')
---------------------------------------------------------------------------
OperationalError Traceback (most recent call last)
<ipython-input-3-e3bab2096896> in <module>()
----> 1 con.execute('SELECT f()')
OperationalError: no such function: f
In [4]: con.create_function('f', 0, [])
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-4-452e7d2028ac> in <module>()
----> 1 con.create_function('f', 0, [])
TypeError: unhashable type: 'list'
In [5]: con.execute('SELECT f()')
---------------------------------------------------------------------------
OperationalError Traceback (most recent call last)
<ipython-input-5-e3bab2096896> in <module>()
----> 1 con.execute('SELECT f()')
OperationalError: user-defined function raised exception
It seems that something like this cause segmentation fault, but I can't reproduce it.
Some other similar sqlite functions also affected. They can be easily modified to accept unhashable objects, but probably it should be done in another issue.
|
|||
| msg331138 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-12-05 17:50 | |
New changeset 5b25f1d03100e2283c1b129d461ba68ac0169a14 by Serhiy Storchaka (Sergey Fedoseev) in branch 'master': bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113) https://github.com/python/cpython/commit/5b25f1d03100e2283c1b129d461ba68ac0169a14 |
|||
| msg331166 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-12-05 21:09 | |
New changeset 1de91a0032fed500ddd3d8c4fb7a38c0b8719f67 by Serhiy Storchaka in branch '3.7': bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113). (GH-10946) https://github.com/python/cpython/commit/1de91a0032fed500ddd3d8c4fb7a38c0b8719f67 |
|||
| msg331180 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-12-05 22:03 | |
New changeset fdf505000f135df3bdae08697b2a324d8f046768 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113). (GH-10946) (GH-10952) https://github.com/python/cpython/commit/fdf505000f135df3bdae08697b2a324d8f046768 |
|||
| msg331184 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2018-12-05 22:21 | |
New changeset fff8fab1ce4af208cd9c6cd84a8be626a1b744d8 by Serhiy Storchaka in branch '2.7': [2.7] bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113). (GH-10946) (GH-10955) https://github.com/python/cpython/commit/fff8fab1ce4af208cd9c6cd84a8be626a1b744d8 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:02 | admin | set | github: 78233 |
| 2018-12-05 22:22:06 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2018-12-05 22:21:43 | serhiy.storchaka | set | messages: + msg331184 |
| 2018-12-05 22:03:17 | serhiy.storchaka | set | messages: + msg331180 |
| 2018-12-05 21:33:27 | serhiy.storchaka | set | pull_requests: + pull_request10204 |
| 2018-12-05 21:10:09 | miss-islington | set | pull_requests: + pull_request10202 |
| 2018-12-05 21:09:59 | serhiy.storchaka | set | messages: + msg331166 |
| 2018-12-05 20:27:29 | serhiy.storchaka | set | pull_requests: + pull_request10196 |
| 2018-12-05 17:50:29 | serhiy.storchaka | set | messages: + msg331138 |
| 2018-07-05 10:53:58 | serhiy.storchaka | set | assignee: serhiy.storchaka nosy:
+ ghaering, serhiy.storchaka |
| 2018-07-05 10:39:17 | sir-sigurd | set | keywords:
+ patch stage: patch review pull_requests: + pull_request7702 |
| 2018-07-05 10:34:47 | sir-sigurd | create | |
