Re: Cursor on an INTERSECT query assertion fails

Lists: pgsql-bugs
From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "PostgreSQL Bugs" <pgsql-bugs(at)postgresql(dot)org>
Subject: Cursor on an INTERSECT query assertion fails
Date: 2007-10-22 14:11:10
Message-ID: 471CAF7E.6060206@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

On CVS HEAD:

postgres=# SELECT a INTO foo1 from generate_series(1,100) a;
SELECT
postgres=# SELECT a INTO foo2 from generate_series(51,150) a;
SELECT
postgres=# DECLARE setopcur SCROLL CURSOR FOR SELECT * FROM foo1
intersect SELECT * FROM foo2;
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

From the log:

TRAP: FailedAssertion("!(parse->utilityStmt == ((void *)0))", File:
"prepunion.c", Line: 114)

(the above is actually supposed to throw an "not in a transaction block"
error, but you get the same result with a BEGIN in there.)

ISTM the Assertion is just bogus, and can be removed.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
Cc: "PostgreSQL Bugs" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Cursor on an INTERSECT query assertion fails
Date: 2007-10-22 17:05:47
Message-ID: 8567.1193072747@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"Heikki Linnakangas" <heikki(at)enterprisedb(dot)com> writes:
> TRAP: FailedAssertion("!(parse->utilityStmt == ((void *)0))", File:
> "prepunion.c", Line: 114)

> ISTM the Assertion is just bogus, and can be removed.

Good catch --- this used to be OK but I'd changed the parsetree
representation of DECLARE CURSOR, so it's now bogus. Removed.

regards, tom lane