pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: digoal@126.com
Subject: BUG #15766: discard plans bug. database CRASH
Date: Wed, 17 Apr 2019 08:56:01 +0000
Message-ID: <15766-a14f0968d3e87beb@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15766
Logged by:          Zhou Digoal
Email address:      digoal@126.com
PostgreSQL version: 11.1
Operating system:   CENTOS 7.X X64
Description:        

discard plans bug. database CRASH 

for exp:

```
postgres=# create table tc (id int ,c1 int, c2 int);
CREATE TABLE
postgres=# insert into tc values (1,1,1);
INSERT 0 1
postgres=# prepare x (int) as select * from tc where  id=$1;
PREPARE
postgres=# execute x(1);
 id | c1 | c2 
----+----+----
  1 |  1 |  1
(1 row)

postgres=# alter table tc add column c3 int;
ALTER TABLE
postgres=# execute x(1);
ERROR:  0A000: cached plan must not change result type
LOCATION:  RevalidateCachedQuery, plancache.c:723
postgres=# \h discard
Command:     DISCARD
Description: discard session state
Syntax:
DISCARD { ALL | PLANS | SEQUENCES | TEMPORARY | TEMP }

postgres=# discard plans;
DISCARD PLANS
```


and then reexecute , database will crash.

```
postgres=# execute x(1);
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
^CCancel request sent
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!> \q
```

best regards,
digoal



view thread (3+ messages)  latest in thread

Message-ID: <15766-a14f0968d3e87beb@postgresql.org>
Permalink:  ../15766-a14f0968d3e87beb@postgresql.org/
Also on:    postgresql.org/message-id/15766-a14f0968d3e87beb@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, digoal@126.com
  Subject: Re: BUG #15766: discard plans bug. database CRASH
  In-Reply-To: <15766-a14f0968d3e87beb@postgresql.org>
  References: <15766-a14f0968d3e87beb@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox