MagicStack / MagicStack/asyncpg
Segfault with NULL value in cell
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 8.1k
- Fork
- 468
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
- asyncpg version: 0.23.0
- PostgreSQL version: 13
- Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?: No - Python version: 3.8
- Platform: Ubuntu Xenial
- Did you install asyncpg with pip?: Yes
- Can the issue be reproduced under both asyncio and
uvloop?: Yes
My table looks like this, and is using the citext extension
CREATE TABLE public.items
(
item_id bigint NOT NULL,
tags citext[] default '{}' not null
);
I have a simple query
query = """SELECT tags FROM items WHERE item_id = 304028"""
async with pool.acquire() as c:
result = await c.fetchval(query)
print(result)
val = result[2]
This gives the following output
['debuff', 'buff', <NULL>]
And upon trying to access the second item of the list results a segmentation fault occurs.
Inspecting the database with PyCharm's database tab shows this cell as having the value {debuff,buff,""}
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non sono indicati file sorgente né test. Inizia riproducendo la query asyncpg 0.23.0 segnalata sullo schema PostgreSQL fornito e analizza come viene decodificato il risultato citext[] contenente un elemento NULL; il lavoro è terminato quando lo stesso accesso non causa più un segfault e il valore NULL viene gestito in modo sicuro.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- postgresql, python
- Ambito
- backend, databases
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100