Skip site navigation (1) Skip section navigation (2)

reltime with NULL fields crashes backend

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: reltime with NULL fields crashes backend
Date: 2001-04-11 11:38:04
Message-ID: 200104111138.f3BBc4p06732@hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Dmitry Tsitelov (cit(at)tag-ltd(dot)spb(dot)ru) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
reltime with NULL fields crashes backend

Long Description
I use expression like int4(reltime(<interval-field>)) to get interval length in seconds. When <interval-field> is NULL backend crashes (psql session):

organizer=> SELECT reltime(task.duration_real) FROM pmgr_task task WHERE task.id = 5;
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally before or while processing the request.

#######
OS: FreeBSD 4.1-RELEASE #2
PostgreSQL ver: PostgreSQL 7.0.2 on i386-unknown-freebsdelf4.1, compiled by gcc 2.95.2

####### Postmaster log:

Server process (pid 37685) exited with status 139 at Wed Apr 11 15:33:18 2001
Terminating any active server processes...
NOTICE:  Message from PostgreSQL backend:
        The Postmaster has informed me that some other backend died abnormally a
nd possibly corrupted shared memory.
        I have rolled back the current transaction and am going to terminate you
r database system connection and exit.
        Please reconnect to the database system and repeat your query.
NOTICE:  Message from PostgreSQL backend:
        The Postmaster has informed me that some other backend died abnormally a
nd possibly corrupted shared memory.
        I have rolled back the current transaction and am going to terminate you
r database system connection and exit.
        Please reconnect to the database system and repeat your query.
NOTICE:  Message from PostgreSQL backend:
        The Postmaster has informed me that some other backend died abnormally a
nd possibly corrupted shared memory.
        I have rolled back the current transaction and am going to terminate you
r database system connection and exit.
        Please reconnect to the database system and repeat your query.
Server processes were terminated at Wed Apr 11 15:33:18 2001
Reinitializing shared memory and semaphores
DEBUG:  Data Base System is starting up at Wed Apr 11 15:33:18 2001
The Data Base System is starting up
DEBUG:  Data Base System was interrupted being in production at Wed Apr 11 15:27
:41 2001
DEBUG:  Data Base System is in production state at Wed Apr 11 15:33:18 2001




Sample Code
CREATE TABLE t ( f interval ); 		: OK
INSERT INTO t (f) VALUES ('23 s'); 	: OK
SELECT reltime(f) FROM t;		: OK
SELECT int4(reltime(f)) FROM t;		: OK
DELETE FROM t;			        : OK
INSERT INTO t (f) VALUES (NULL);        : OK
SELECT reltime(f) FROM t;		: Backend crash

SELECT reltime(NULL);                   : OK
SELECT reltime(interval(NULL));         : Backend crash


No file was uploaded with this report


Responses

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2001-04-11 13:14:22
Subject: result of conversion to timestamp is shifted 1 minute back
Previous:From: Rainer MagerDate: 2001-04-11 06:58:34
Subject: RE: Problem with 7.0.3 dump -> 7.1b4 restore

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group