There could be useful info there, if the user asks for it. Now this
doesn't slow down the happy execute path, because the default of
returning is False.
results = yield from self._maybe_prepare_gen(pgq, prepare=True)
assert results is not None
self._check_results(results)
- if returning and results[0].status == ExecStatus.TUPLES_OK:
+ if returning:
self._results.extend(results)
for res in results:
else:
# Received from executemany()
- if self._execmany_returning and results[0].status == ExecStatus.TUPLES_OK:
+ if self._execmany_returning:
self._results.extend(results)
if first_batch:
self._set_current_result(0)
returning=True,
)
assert cur.rowcount == 2
+ assert cur.statusmessage.startswith("INSERT")
with pytest.raises(psycopg.ProgrammingError):
cur.fetchone()
+ pgresult = cur.pgresult
+ assert cur.nextset()
+ assert cur.statusmessage.startswith("INSERT")
+ assert pgresult is not cur.pgresult
assert cur.nextset() is None
returning=True,
)
assert cur.rowcount == 2
+ assert cur.statusmessage.startswith("INSERT")
with pytest.raises(psycopg.ProgrammingError):
await cur.fetchone()
+ pgresult = cur.pgresult
+ assert cur.nextset()
+ assert cur.statusmessage.startswith("INSERT")
+ assert pgresult is not cur.pgresult
assert cur.nextset() is None