Re: Problems with insert rule called from plpython

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problems with insert rule called from plpython
Дата
Msg-id 11090.1045257253@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problems with insert rule called from plpython  (Pavel Hanak <hanak@brailcom.cz>)
Список pgsql-bugs
Pavel Hanak <hanak@brailcom.cz> writes:
> Now calling "select testfun()" shows this fatal error:
>    FATAL:  SPI: improper call to spi_dest_setup

Hm, I'm glad I put in that test --- it exposed a problem.  Here is
the patch for 7.3.

            regards, tom lane


*** src/backend/executor/spi.c.orig    Wed Jan 29 10:24:57 2003
--- src/backend/executor/spi.c    Fri Feb 14 16:09:38 2003
***************
*** 1097,1102 ****
--- 1097,1111 ----
              else
                  canSetResult = false;

+             /* Reset state if can set result */
+             if (canSetResult)
+             {
+                 SPI_processed = 0;
+                 SPI_lastoid = InvalidOid;
+                 SPI_tuptable = NULL;
+                 _SPI_current->tuptable = NULL;
+             }
+
              if (queryTree->commandType == CMD_UTILITY)
              {
                  if (IsA(queryTree->utilityStmt, CopyStmt))
***************
*** 1206,1211 ****
--- 1215,1229 ----
                  canSetResult = true;
              else
                  canSetResult = false;
+
+             /* Reset state if can set result */
+             if (canSetResult)
+             {
+                 SPI_processed = 0;
+                 SPI_lastoid = InvalidOid;
+                 SPI_tuptable = NULL;
+                 _SPI_current->tuptable = NULL;
+             }

              if (queryTree->commandType == CMD_UTILITY)
              {

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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Function will not back up on 7.2.3
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Function will not back up on 7.2.3