Skip to content

Commit d2e710f

Browse files
authored
Do not try to cleanup statements (#981)
This supports a case where we prepare an unnamed statement to inspect the return types. The statement should not be cleaned up afterwards because it is automatically cleaned up by Postgres
1 parent 43bd82c commit d2e710f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

asyncpg/connection.py

+1
Original file line numberDiff line numberDiff line change
@@ -1416,6 +1416,7 @@ def _mark_stmts_as_closed(self):
14161416
def _maybe_gc_stmt(self, stmt):
14171417
if (
14181418
stmt.refs == 0
1419+
and stmt.name
14191420
and not self._stmt_cache.has(
14201421
(stmt.query, stmt.record_class, stmt.ignore_custom_codec)
14211422
)

0 commit comments

Comments
 (0)