pgsql: Fix failure to set ActiveSnapshot while rewinding a cursor.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix failure to set ActiveSnapshot while rewinding a cursor.
Дата
Msg-id E1Wi6XR-0008DZ-PT@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix failure to set ActiveSnapshot while rewinding a cursor.

ActiveSnapshot needs to be set when we call ExecutorRewind because some
plan node types may execute user-defined functions during their ReScan
calls (nodeLimit.c does so, at least).  The wisdom of that is somewhat
debatable, perhaps, but for now the simplest fix is to make sure the
required context is valid.  Failure to do this typically led to a
null-pointer-dereference core dump, though it's possible that in more
complex cases a function could be executed with the wrong snapshot
leading to very subtle misbehavior.

Per report from Leif Jensen.  It's been broken for a long time, so
back-patch to all active branches.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/7f66ade71a59a8da58a43514ca851ab5e96dd209

Modified Files
--------------
src/backend/tcop/pquery.c             |   14 ++++++++++++--
src/test/regress/expected/portals.out |   24 ++++++++++++++++++++++++
src/test/regress/sql/portals.sql      |   11 +++++++++++
3 files changed, 47 insertions(+), 2 deletions(-)


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: pgsql: Never crash-and-restart for bgworkers without shared memory acce
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix failure to set ActiveSnapshot while rewinding a cursor.