mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-03-25 03:54:16 +03:00
over some tests for serialisation and deadlock errors, demonstrating that TransactionRollbackError is generated. (QueryCancelationTests): add a test to show that QueryCanceledError is raised on statement timeouts. * psycopg2da/adapter.py (_handle_psycopg_exception): rather than checking exception messages, check for TransactionRollbackError. * psycopg/pqpath.c (exception_from_sqlstate): return TransactionRollbackError for 40xxx errors, and QueryCanceledError for 57014 errors. (pq_raise): If we are using an old server, use TransactionRollbackError if the error message contains "could not serialize" or "deadlock detected". * psycopg/psycopgmodule.c (_psyco_connect_fill_exc): remove function, since we no longer need to store pointers to the exceptions in the connection. This also fixes a reference leak. (psyco_connect): remove _psyco_connect_fill_exc() function call. * psycopg/connection.h (connectionObject): remove exception members from struct. * psycopg/connection_type.c (connectionObject_getsets): modify the exception attributes on the connection object from members to getsets. This reduces the size of the struct. * lib/extensions.py: import the two new extensions. * psycopg/psycopgmodule.c (exctable): add new QueryCanceledError and TransactionRollbackError exceptions. |
||
---|---|---|
.. | ||
adapter_asis.c | ||
adapter_asis.h | ||
adapter_binary.c | ||
adapter_binary.h | ||
adapter_datetime.c | ||
adapter_datetime.h | ||
adapter_list.c | ||
adapter_list.h | ||
adapter_mxdatetime.c | ||
adapter_mxdatetime.h | ||
adapter_pboolean.c | ||
adapter_pboolean.h | ||
adapter_qstring.c | ||
adapter_qstring.h | ||
config.h | ||
connection_int.c | ||
connection_type.c | ||
connection.h | ||
cursor_int.c | ||
cursor_type.c | ||
cursor.h | ||
microprotocols_proto.c | ||
microprotocols_proto.h | ||
microprotocols.c | ||
microprotocols.h | ||
pgtypes.h | ||
pgversion.h | ||
pqpath.c | ||
pqpath.h | ||
psycopg.h | ||
psycopgmodule.c | ||
python.h | ||
typecast_array.c | ||
typecast_basic.c | ||
typecast_basic.c.old | ||
typecast_binary.c | ||
typecast_binary.h | ||
typecast_builtins.c | ||
typecast_datetime.c | ||
typecast_mxdatetime.c | ||
typecast.c | ||
typecast.h |