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
In a transaction, if I set client_encoding to something, and then the transaction has an error and is rolled back, the client_encoding that get_settings() returns is never reverted.
If the transaction is rolled back without an error occuring, the right thing happens.
Output:
Orig
UTF8
UTF_8
In transaction:
LATIN1
LATIN1
After rollback:
UTF8
LATIN1
Traceback (most recent call last):
File "asyncpg/protocol/prepared_stmt.pyx", line 175, in asyncpg.protocol.protocol.PreparedStatementState._encode_bind_msg
File "asyncpg/protocol/codecs/base.pyx", line 227, in asyncpg.protocol.protocol.Codec.encode
File "asyncpg/protocol/codecs/base.pyx", line 129, in asyncpg.protocol.protocol.Codec.encode_scalar
File "asyncpg/pgproto/./codecs/text.pyx", line 29, in asyncpg.pgproto.pgproto.text_encode
File "asyncpg/pgproto/./codecs/text.pyx", line 17, in asyncpg.pgproto.pgproto.as_pg_string_and_size
UnicodeEncodeError: 'latin-1' codec can't encode character '\U0001f4a9' in position 0: ordinal not in range(256)
I would expect
After rollback:
UTF8
UTF8
and no encoding error.
The text was updated successfully, but these errors were encountered:
The asyncpg client-side understanding of client_encoding was getting
out of sync, causing encoding errors. See MagicStack/asyncpg#1215.
This shows up when test_sql_query_client_encoding_2 and
test_sql_query_client_encoding_3 are run on the same connection, so
could be deterministically produced with
`edb test -v -j 1 -k test_sql_query_client_encoding`
The asyncpg client-side understanding of client_encoding was getting
out of sync, causing encoding errors. See MagicStack/asyncpg#1215.
This shows up when test_sql_query_client_encoding_2 and
test_sql_query_client_encoding_3 are run on the same connection, so
could be deterministically produced with
`edb test -v -j 1 -k test_sql_query_client_encoding`
the issue with a local PostgreSQL install?: No
uvloop?: Only checked asyncio but it doesn't seem likely to matter
In a transaction, if I set
client_encoding
to something, and then the transaction has an error and is rolled back, theclient_encoding
thatget_settings()
returns is never reverted.If the transaction is rolled back without an error occuring, the right thing happens.
Output:
I would expect
and no encoding error.
The text was updated successfully, but these errors were encountered: