Re: BUG #17355: Server crashes on ExecReScanForeignScan in postgres_fdw when accessing foreign partition

Marina Polyakova <m.polyakova@postgrespro.ru>

From: Marina Polyakova <m.polyakova@postgrespro.ru>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Alexander Lakhin <exclusion@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2022-02-03T10:37:55Z
Lists: pgsql-bugs

Attachments

On 2022-02-03 09:38, Etsuro Fujita wrote:
> I think it would be better to create a separate patch so that we test
> not only this but other EvalPlanQual stuff such as ForeignRecheck, so
> I applied the proposed patch to HEAD as well.
> 
> Thanks!
> 
> Best regards,
> Etsuro Fujita

Hello everyone in this thread!

Looks like gcc 11.2.0 is now reporting a warning in the branches 
master/REL_14_STABLE, e.g. see CI 
https://github.com/postgres/postgres/runs/5047720839:

[06:30:18.201] nodeForeignscan.c: In function ‘ForeignNext’:
[06:30:18.201] nodeForeignscan.c:47:13: error: unused variable ‘estate’ 
[-Werror=unused-variable]
[06:30:18.201]    47 |  EState    *estate = node->ss.ps.state;
[06:30:18.201]       |             ^~~~~~

Please could you fix it? E.g. like in the attached patch - the following 
commands work for me with it:

$ ./configure && COPT=-Werror make world-bin

-- 
Marina Polyakova
Postgres Professional: http://www.postgrespro.com

Commits

  1. Further fix for EvalPlanQual with mix of local and foreign partitions.

  2. Fix segfault during EvalPlanQual with mix of local and foreign partitions.

  3. Rework planning and execution of UPDATE and DELETE.