mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Prevent asynchronous execution of direct foreign-table modifications.
Commits27e1f1456
and86dc90056
, which were independently discussed, cause a crash when executing an inherited foreign UPDATE/DELETE query with asynchronous execution enabled, where children of an Append node that is the direct/indirect child of the ModifyTable node are rewritten so as to modify foreign tables directly by postgresPlanDirectModify(); as in that case the direct modifications are executed asynchronously, which is not currently supported by asynchronous execution. Fix by disabling asynchronous execution of the direct modifications in that function. Author: Etsuro Fujita Reviewed-by: Amit Langote Discussion: https://postgr.es/m/CAPmGK158e9sJOfuWxfn%2B0ynrspXQU3JhNjSCbaoeSzMvnga%2Bbw%40mail.gmail.com
This commit is contained in:
@ -2530,6 +2530,13 @@ postgresPlanDirectModify(PlannerInfo *root,
|
||||
rebuild_fdw_scan_tlist(fscan, returningList);
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally, unset the async-capable flag if it is set, as we currently
|
||||
* don't support asynchronous execution of direct modifications.
|
||||
*/
|
||||
if (fscan->scan.plan.async_capable)
|
||||
fscan->scan.plan.async_capable = false;
|
||||
|
||||
table_close(rel, NoLock);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user