Re: INSERT INTO ... SELECT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jiang Wei <sdjiangwei(at)sina(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: INSERT INTO ... SELECT
Date: 2004-04-07 18:47:53
Message-ID: 26280.1081363673@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Jiang Wei <sdjiangwei(at)sina(dot)com> writes:
> =>create table empty();
> =>insert into empty default values;
> =>insert into empty select * from empty;
> server crash.

Fixed, thanks for the report.

regards, tom lane

Index: execJunk.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/executor/execJunk.c,v
retrieving revision 1.36
retrieving revision 1.36.4.1
diff -c -r1.36 -r1.36.4.1
*** execJunk.c 11 Aug 2003 20:46:46 -0000 1.36
--- execJunk.c 7 Apr 2004 18:46:20 -0000 1.36.4.1
***************
*** 262,273 ****
cleanTupType = junkfilter->jf_cleanTupType;
cleanLength = junkfilter->jf_cleanLength;
cleanMap = junkfilter->jf_cleanMap;
-
- /*
- * Handle the trivial case first.
- */
- if (cleanLength == 0)
- return (HeapTuple) NULL;

/*
* Create the arrays that will hold the attribute values and the null
--- 262,267 ----

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-04-07 19:28:38 Re: Sequential Scan Index Bug
Previous Message Stephan Szabo 2004-04-07 17:18:42 Re: Sequential Scan Index Bug