You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you built asyncpg locally, which version of Cython did you use?: N/A
Can the issue be reproduced under both asyncio and uvloop?: Yes
When sending queries with more than 32768 arguments, the execute fails with this error:
File "asyncpg\protocol\protocol.pyx", line 162, in bind_execute (asyncpg/protocol/protocol.c:57595)
File "asyncpg\protocol\prepared_stmt.pyx", line 100, in asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg (asyncpg/protocol/protocol.c:53533)
ValueError: number of arguments (90000) does not match number of parameters (24464)
Note that 90000 % 32768 is 24464.
EDIT: This is actually caused by overflow on 32768, not 65536.
The text was updated successfully, but these errors were encountered:
Fuyukai
changed the title
Fails with queries with more than 65536 arguments
Fails with queries with more than 32768 arguments
Apr 29, 2017
From the Postgres documentation of its binary protocol, here's a description of the Bind message:
Bind (F)
...
Int16
The number of parameter format codes that follow (denoted C below).
This can be zero to indicate that there are no parameters or that the
parameters all use the default format (text); or one, in which case the
specified format code is applied to all parameters; or it can equal the
actual number of parameters.
...
Int16 is a signed 16 bit integer, so 32768 is how many arguments Postgres can accept.
We do need to handle this case and raise a proper exception in asyncpg.
uvloop?: Yes
When sending queries with more than 32768 arguments, the execute fails with this error:
Note that 90000 % 32768 is 24464.
EDIT: This is actually caused by overflow on 32768, not 65536.
The text was updated successfully, but these errors were encountered: