Re: INSERT INTO ... SELECT - Mailing list pgsql-bugs

From Tom Lane
Subject Re: INSERT INTO ... SELECT
Date
Msg-id 26280.1081363673@sss.pgh.pa.us
Whole thread Raw
In response to INSERT INTO ... SELECT  (Jiang Wei <sdjiangwei@sina.com>)
List pgsql-bugs
Jiang Wei <sdjiangwei@sina.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 ----

pgsql-bugs by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Sequential Scan Index Bug
Next
From: Tom Lane
Date:
Subject: Re: Sequential Scan Index Bug