Re: assertion failure w/extended query protocol - Mailing list pgsql-hackers

From Robert Haas
Subject Re: assertion failure w/extended query protocol
Date
Msg-id CA+Tgmobtn2T4gmG5WwGA1P4syh0weX6Hh0AA-FtvsXr0bMo0Vw@mail.gmail.com
Whole thread Raw
In response to Re: assertion failure w/extended query protocol  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: assertion failure w/extended query protocol  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: assertion failure w/extended query protocol  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Oct 19, 2012 at 2:01 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> On Friday, October 19, 2012 06:41:27 PM Peter Geoghegan wrote:
>> On 19 October 2012 17:19, Robert Haas <robertmhaas@gmail.com> wrote:
>> > Rushabh Lathia of the EnterpriseDB development team and I have been
>> > doing some testing of the extended query protocol and have found a
>> > case where it causes an assertion failure.  Here's how to reproduce:
>> >
>> > 1. Apply the attached patch to teach psql how to use the extended
>> > query protocol.  Compile, install.
>> >
>> > 2. Start the modified psql and do this:
>> >
>> > \set PROTOCOL extended
>> > PREPARE stmt as select 1;
>> > CREATE TEMPORARY TABLE tmptbl AS EXECUTE stmt;
>> >
>> > The result is:
>> >
>> > TRAP: FailedAssertion("!(qry->commandType != CMD_UTILITY)", File:
>> > "utility.c", Line: 1516)f
>>
>> I'm reasonably confident that commit
>> 9dbf2b7d75de5af38d087cbe2b1147dd0fd10f0a caused this breakage.
>
> Simple fix attached.

Looks reasonable to me, but I'm not terribly familiar with this code.
Tom, any comments?

> Btw, do you plan to submit that psql patch at some point? I repeatedly wished
> to be able to use the extended protocol without writing code or misusing
> pgbench exactly to test stuff like this.

I didn't think it would be accepted, but if you think it's useful to
have, consider it submitted.  If you review the code and it seems OK
(or can be fixed to be OK), I'm happy to write some user
documentation.  I'm not sure it actually handles all the cases right
now but perhaps you could have a look.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: [RFC] CREATE QUEUE (log-only table) for londiste/pgQ ccompatibility
Next
From: Robert Haas
Date:
Subject: Re: Very minor feature suggestion