BUG #15766: discard plans bug. database CRASH

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: digoal(at)126(dot)com
Subject: BUG #15766: discard plans bug. database CRASH
Date: 2019-04-17 08:56:01
Message-ID: 15766-a14f0968d3e87beb@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15766
Logged by: Zhou Digoal
Email address: digoal(at)126(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-04-17 09:16:27 BUG #15767: Export fails 'worker process died unexpectedly' but no error in pg_dump
Previous Message Devrim Gündüz 2019-04-17 07:55:12 Re: Fw: PostgreSQL 11.2 , missing X509_get_signature_nid symbol causes the standby to fail to start stream replication