Backend crash on query with UNION subselect - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Backend crash on query with UNION subselect
Date
Msg-id 200101120926.f0C9QjO21307@hub.org
Whole thread Raw
Responses Re: Backend crash on query with UNION subselect
List pgsql-bugs
Vladimir Zamiussky (ltd@ippe.obninsk.ru) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
Backend crash on query with UNION subselect

Long Description
There are two nearly identical tables, differ from each other by the length of corresponding fields of type CHARACTER
(onehas CHARACTER(20) field, other has CHARACTER(30) field).  
when i do "select * from table1 union select * from table2" backend crashes with message:
FATAL 1: Memory exhausted in AllocSetAlloc()
pqReadData() -- backend closed channel unexpectadly.
    This probably means the backend terminated abnormally before or while         processing the request.

When char fileds have the same size, crash does not occur.

This bug takes place on 7.0.2 and 7.0.3 versions

Sample Code
create table pipe_alarms(
    dtime timestamp default now(),
    pipe_name char(30),
    alarm_name char(30) );

create table gauge_alarms(
    dtime timestamp default now(),
    gauge_name char(20),
    alarm_name char(30) );

insert into pipe_alarms(pipe_name,alarm_name) values('Pipe 1','LEAK');
insert into pipe_alarms(pipe_name,alarm_name) values('Pipe 2','No leaks');
insert into gauge_alarms(gauge_name,alarm_name) values('sensor_1','OverLimit');
insert into gauge_alarms(gauge_name,alarm_name) values('sensor_2','OverLimit');
insert into gauge_alarms(gauge_name,alarm_name) values('sensor_3','OverLimit');

select * from gauge_alarms union all select * from pipe_alarms


No file was uploaded with this report

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: JDBC PreparedStatement.setMaxRows() affects other objects intantiated from this class and it's parent class
Next
From: Tom Lane
Date:
Subject: Re: Backend crash on query with UNION subselect