Re: BUG #2112: query kills db thread

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2112: query kills db thread
Дата
Msg-id 21066.1134577928@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2112: query kills db thread  ("Jim Dew" <jdew@yggdrasil.ca>)
Список pgsql-bugs
"Jim Dew" <jdew@yggdrasil.ca> writes:
> Stumbled upon a (broken) query that causes the 8.1.0 thread handling the
> query to die:
> select foo from (select null) as foo

Fixed in 8.0 and up.  If you need the patch for 8.1, it's pretty simple:

Index: src/backend/executor/execQual.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/executor/execQual.c,v
retrieving revision 1.183.2.1
diff -c -r1.183.2.1 execQual.c
*** src/backend/executor/execQual.c    22 Nov 2005 18:23:08 -0000    1.183.2.1
--- src/backend/executor/execQual.c    14 Dec 2005 16:25:05 -0000
***************
*** 541,547 ****
      Assert(variable->varno != OUTER);
      slot = econtext->ecxt_scantuple;

!     tuple = slot->tts_tuple;
      tupleDesc = slot->tts_tupleDescriptor;

      /*
--- 541,547 ----
      Assert(variable->varno != OUTER);
      slot = econtext->ecxt_scantuple;

!     tuple = ExecFetchSlotTuple(slot);
      tupleDesc = slot->tts_tupleDescriptor;

      /*

Thanks for the report!

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2112: query kills db thread
Следующее
От: "Wojciech Sobczuk"
Дата:
Сообщение: BUG #2113: PostgreSQL hangs after running for 2 days