MagicStack / MagicStack/asyncpg
"Cannot insert multiple commands into prepared statement" issue while executing query with params
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 8.1k
- Forks
- 468
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
(python 3.5.1, asyncpg 0.5.4)
Consider the next code
```
import asyncpg
import asyncio
async def run():
con = await asyncpg.connect(user="coldmind", database="test")
await con.execute('SELECT ($1); SELECT 2;', 1)
asyncio.get_event_loop().run_until_complete(run())
```
The executing fails with `asyncpg.exceptions.PostgresSyntaxError: cannot insert multiple commands into a prepared statement` error, while the another example (without passing params to the query) works well with multiple commands:
```
import asyncpg
import asyncio
async def run():
con = await asyncpg.connect(user="coldmind", database="test")
await con.execute('SELECT 1; SELECT 2;')
asyncio.get_event_loop().run_until_complete(run())
```
Why is the first example using a prepared statement instead of executing it?
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Start with the con.execute entry point and run the two Python examples from the issue to compare parameterized and non-parameterized queries. Trace how parameters affect execution, then establish the expected behavior for multiple commands and document or test the resulting decision.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- postgresql, python
- Domínio
- databases
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Precisa de esclarecimento
- Facilidade para iniciantes
- 35/100