From fc028d57e4182005dd9510b63aceada89202a4b0 Mon Sep 17 00:00:00 2001 From: Craig Ringer Date: Wed, 9 Sep 2020 12:54:56 +0800 Subject: [PATCH v999 1/3] Deliberately break something so we can check it Break postgres_fdw --- contrib/postgres_fdw/postgres_fdw.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index a31abce7c9..0565037ac8 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -3441,6 +3441,9 @@ fetch_more_data(ForeignScanState *node) /* Must be EOF if we didn't get as many tuples as we asked for. */ fsstate->eof_reached = (numrows < fsstate->fetch_size); + + /* Escape PG_TRY() */ + return; } PG_FINALLY(); { @@ -3844,6 +3847,9 @@ store_returning_result(PgFdwModifyState *fmstate, { HeapTuple newtup; + int foo = 0; + fprintf(stdout, "%d", 10/foo); + newtup = make_tuple_from_result_row(res, 0, fmstate->rel, fmstate->attinmeta, @@ -3856,11 +3862,23 @@ store_returning_result(PgFdwModifyState *fmstate, * heaptuples directly, so allow for conversion. */ ExecForceStoreHeapTuple(newtup, slot, true); + + /* Escape PG_TRY() */ + return; + } PG_CATCH(); { + int bar = 0; + fprintf(stdout, "%d", 10/bar); + if (res) PQclear(res); + + + /* Escape PG_CATCH() */ + return; + PG_RE_THROW(); } PG_END_TRY(); -- 2.26.2