summaryrefslogtreecommitdiff
path: root/tests/basic
diff options
context:
space:
mode:
authorFrançois Freitag <mail@franek.fr>2017-01-13 15:21:33 -0800
committerTim Graham <timograham@gmail.com>2017-01-14 07:13:00 -0500
commit6b6be692fcd102436c7abef1d7b3fa1d37ad4bdf (patch)
tree18bf8488ff2bc263e2238f20c60f0389bad38d15 /tests/basic
parent2e55790838a75bf25a11115536dae57880cfccfb (diff)
Refs #16614 -- Prevented database errors from being masked by cursor close.
When an error occurred during the cursor.execute statement, the cursor is closed. This operation did not fail with client-side cursors. Now, with server-side cursors, the close operation might fail (example below). The original error should be raised, not the one raised by cursor.close(), this is only clean-up code. For example, one can attempt to create a named cursor for an invalid query. psycopg will raise an error about the invalid query and the server-side cursor will not be created on PostgreSQL. When the code attempts to cursor.close(), it asks psycopg to close a cursor that was not created. pyscopg raises a new error: psycopg2.OperationalError: cursor "_django_curs_140365867840512_20" does not exist.
Diffstat (limited to 'tests/basic')
0 files changed, 0 insertions, 0 deletions