pgsql: Fix crash in error report of invalid tuple lock
От | Alvaro Herrera |
---|---|
Тема | pgsql: Fix crash in error report of invalid tuple lock |
Дата | |
Msg-id | E1V5JJp-0006kw-Ms@gemulon.postgresql.org обсуждение исходный текст |
Список | pgsql-committers |
Fix crash in error report of invalid tuple lock My tweak of these error messages in commit c359a1b082 contained the thinko that a query would always have rowMarks set for a query containing a locking clause. Not so: when declaring a cursor, for instance, rowMarks isn't set at the point we're checking, so we'd be dereferencing a NULL pointer. The fix is to pass the lock strength to the function raising the error, instead of trying to reverse-engineer it. The result not only is more robust, but it also seems cleaner overall. Per report from Robert Haas. Branch ------ REL9_3_STABLE Details ------- http://git.postgresql.org/pg/commitdiff/0009462e985b90d07dc430bb3c4f1e6f57e0c318 Modified Files -------------- src/backend/optimizer/plan/planner.c | 3 ++- src/backend/parser/analyze.c | 25 +++++++++---------------- src/include/parser/analyze.h | 2 +- src/test/regress/expected/portals.out | 4 ++++ src/test/regress/expected/union.out | 2 ++ src/test/regress/sql/portals.sql | 3 +++ src/test/regress/sql/union.sql | 2 ++ 7 files changed, 23 insertions(+), 18 deletions(-)
В списке pgsql-committers по дате отправления: