Thread: INSERT INTO ... SELECT

INSERT INTO ... SELECT

From
Jiang Wei
Date:
=>create table empty();

=>insert into empty default values;
=>insert into empty select * from empty;

server crash.

Re: INSERT INTO ... SELECT

From
Tom Lane
Date:
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 ----