BUG #4135: postmaster crashes if matching on VALUES is used on a column with index - Mailing list pgsql-bugs

From Miernik
Subject BUG #4135: postmaster crashes if matching on VALUES is used on a column with index
Date
Msg-id 200804302157.m3ULvjxc052168@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4135: postmaster crashes if matching on VALUES is used on a column with index
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4135
Logged by:          Miernik
Email address:      public@miernik.name
PostgreSQL version: 8.3.1
Operating system:   Linux polica 2.6.20-xen-r6 #2 SMP Wed Jan 16 19:43:41
CET 2008 i686 GNU/Linux
Description:        postmaster crashes if matching on VALUES is used on a
column with index
Details:

The simplest set of commands to reporoduce the crash I could find is
attached below. I hope it is self-explanatory. If you can't reporoduce it,
please e-mail me and I'll try to give more info. Please also e-mail me if
you happen to fix this bug. Thank you for your great work.

$ createdb test1
$ psql test1
Pager is always used.
Welcome to psql 8.3.1, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)

test1=> SELECT version();
                                        version
----------------------------------------------------------------------------
------------
 PostgreSQL 8.3.1 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.2.3
(Debian 4.2.3-2)
(1 row)
test1=> CREATE TABLE foo (bar numeric(1));
CREATE TABLE
test1=> CREATE INDEX foo_idx ON foo(bar);
CREATE INDEX
test1=> INSERT INTO foo VALUES (1);
INSERT 0 1
test1=> SELECT bar FROM foo;
 bar
-----
   1
(1 row)

test1=> SELECT bar FROM foo WHERE bar = 1;
 bar
-----
   1
(1 row)

test1=> SELECT bar FROM foo WHERE bar IN (VALUES (1));
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: Succeeded.

test1=>

tail -f /var/log/postgresql/postgresql-8.3-main.log
2008-04-30 23:46:08 CEST LOG:  server process (PID 4121) was terminated by
signal 11: Segmentation fault
2008-04-30 23:46:08 CEST LOG:  terminating any other active server
processes
2008-04-30 23:46:08 CEST LOG:  all server processes terminated;
reinitializing
2008-04-30 23:46:08 CEST LOG:  database system was interrupted; last known
up at 2008-04-30 23:43:38 CEST
2008-04-30 23:46:08 CEST LOG:  database system was not properly shut down;
automatic recovery in progress
2008-04-30 23:46:08 CEST LOG:  redo starts at 3/8B7F846C
2008-04-30 23:46:08 CEST LOG:  record with zero length at 3/8B810B6C
2008-04-30 23:46:08 CEST LOG:  redo done at 3/8B810B40
2008-04-30 23:46:08 CEST LOG:  last completed transaction was at log time
2008-04-30 23:45:42.858855+02
2008-04-30 23:46:08 CEST LOG:  database system is ready to accept
connections

pgsql-bugs by date:

Previous
From: "Anthony"
Date:
Subject: BUG #4133: Installation error
Next
From: Tom Lane
Date:
Subject: Re: BUG #4135: postmaster crashes if matching on VALUES is used on a column with index