Re: Snapshot warning

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Snapshot warning
Date: 2008-11-24 13:52:13
Message-ID: 20081124135213.GD3861@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavan Deolasee escribió:
> Following test case gives a warning of snapshot not destroyed at commit
> time.
>
> CREATE TABLE test (a int);
> INSERT INTO test VALUES (1);
> BEGIN;
> DECLARE c CURSOR FOR SELECT * FROM test FOR update;
> SAVEPOINT A;
> FETCH -2 FROM c;
> ROLLBACK TO SAVEPOINT A;
> COMMIT;
>
> Should we call FreeQueryDesc() even for failed portals in PortalCleanup() ?
> Or PortalDrop() is a better(right) place to do that ?

That doesn't work; doing it causes a crash:

TRAP: FailedAssertion(«!(qdesc->estate == ((void *)0))», Archivo: «/pgsql/source/00head/src/backend/tcop/pquery.c», Línea: 126)

which is here:

void
FreeQueryDesc(QueryDesc *qdesc)
{
/* Can't be a live query */
Assert(qdesc->estate == NULL);

BTW I noticed that AtSubAbort_Portals() is neglecting to set
portal->cleanup to NULL after calling it.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-11-24 13:53:00 Re: blatantly a bug in the documentation
Previous Message Tom Lane 2008-11-24 13:49:55 Re: pgsql: Add support for matching wildcard server certificates to the new