Re: [HACKERS] Re: SELECT INTO TABLE busted?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: SELECT INTO TABLE busted?
Date: 1999-02-06 20:41:49
Message-ID: 21986.918333709@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I found part of the SELECT INTO TABLE problem: at line 2872 of gram.y,

n->istemp = (bool)((A_Const *)lfirst($4))->val.val.ival;

the cast should be to Value* not A_Const*. On my machine, an
uninitialized field is picked up and dropped into n->istemp,
so that the system sometimes interprets SELECT INTO TABLE
as SELECT INTO TEMP TABLE. Ooops.

With this fix, the regression tests pass again (except the "don't know
whether nodes of type 600 are equal" problem is still there).

However, I can now report that there's a second bug involving
trying to access a temp table after end of transaction.
The query series (in the regression database)

BEGIN;
SELECT * INTO TEMP TABLE xacttest FROM aggtest;
INSERT INTO xacttest (a, b) VALUES (777, 777.777);
END;
SELECT a FROM xacttest WHERE a > 100;

crashes the backend. It seems to think that xacttest still exists,
but it chokes trying to retrieve tuples from it. (Whether a non-temp
table xacttest exists doesn't seem to matter, btw.)

Am I right in thinking that the temp table should disappear
at END TRANSACTION?

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-02-07 01:13:40 Re: [HACKERS] equal: don't know whether nodes of type 600 are equal
Previous Message Bruce Momjian 1999-02-06 17:51:52 Re: [HACKERS] Optimizer speed and GEQO (was: nested loops in joins)