From c8178943f1f8021ab1705abb5ee306ccfba0c9e3 Mon Sep 17 00:00:00 2001 From: Maxim Orlov Date: Thu, 4 Feb 2021 15:48:51 +0300 Subject: [PATCH 1/2] Issue #38: fix backand crash on nonhashable row insert. --- expected/pg_variables_trans.out | 5 +++++ pg_variables.c | 8 ++++++++ sql/pg_variables_trans.sql | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/expected/pg_variables_trans.out b/expected/pg_variables_trans.out index 2f46e04..6cede44 100644 --- a/expected/pg_variables_trans.out +++ b/expected/pg_variables_trans.out @@ -3829,3 +3829,8 @@ SELECT pgv_free(); (1 row) +-- +-- Test case for issue #38 [PGPRO-4676] +-- +SELECT pgv_insert('test', 'x5', ROW ((2::int, 1::int)), TRUE); +ERROR: could not identify a hash function for type record diff --git a/pg_variables.c b/pg_variables.c index b75701a..5e7156e 100644 --- a/pg_variables.c +++ b/pg_variables.c @@ -2116,6 +2116,14 @@ rollbackSavepoint(TransObject *object, TransObjectType type) { TransState *state; + /* Nothing to do here if trans object was removed already. */ + if (dlist_is_empty(&object->states)) + { + /* Probably redundant. */ + removeObject(object, type); + return; + } + state = GetActualState(object); removeState(object, type, state); diff --git a/sql/pg_variables_trans.sql b/sql/pg_variables_trans.sql index 72d9559..7deef59 100644 --- a/sql/pg_variables_trans.sql +++ b/sql/pg_variables_trans.sql @@ -1163,3 +1163,9 @@ SELECT pgv_insert('vars', 'r2', tab) FROM tab; SELECT pgv_select('vars', 'r2'); SELECT pgv_free(); + + +-- +-- Test case for issue #38 [PGPRO-4676] +-- +SELECT pgv_insert('test', 'x5', ROW ((2::int, 1::int)), TRUE); From 2a38b715170c1016b14783bebcd5eec497c9732f Mon Sep 17 00:00:00 2001 From: Maxim Orlov Date: Mon, 8 Feb 2021 12:39:54 +0300 Subject: [PATCH 2/2] Issue #38: remove useless comment. --- pg_variables.c | 1 - 1 file changed, 1 deletion(-) diff --git a/pg_variables.c b/pg_variables.c index 5e7156e..152b5d6 100644 --- a/pg_variables.c +++ b/pg_variables.c @@ -2119,7 +2119,6 @@ rollbackSavepoint(TransObject *object, TransObjectType type) /* Nothing to do here if trans object was removed already. */ if (dlist_is_empty(&object->states)) { - /* Probably redundant. */ removeObject(object, type); return; } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy