mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Backpatch missing check_stack_depth() to some recursive functions
Backpatch changes fromd57b7cc333
,75bcba6cbd
to all supported branches per proposal of Egor Chindyaskin. Discussion: https://postgr.es/m/DE5FD776-A8CD-4378-BCFA-3BF30F1F6D60%40mail.ru
This commit is contained in:
@@ -6745,6 +6745,9 @@ ATExecAddColumn(List **wqueue, AlteredTableInfo *tab, Relation rel,
|
||||
TupleDesc tupdesc;
|
||||
FormData_pg_attribute *aattr[] = {&attribute};
|
||||
|
||||
/* since this function recurses, it could be driven to stack overflow */
|
||||
check_stack_depth();
|
||||
|
||||
/* At top level, permission check was done in ATPrepCmd, else do it */
|
||||
if (recursing)
|
||||
ATSimplePermissions((*cmd)->subtype, rel, ATT_TABLE | ATT_FOREIGN_TABLE);
|
||||
@@ -8477,6 +8480,10 @@ ATExecDropColumn(List **wqueue, Relation rel, const char *colName,
|
||||
|
||||
/* Initialize addrs on the first invocation */
|
||||
Assert(!recursing || addrs != NULL);
|
||||
|
||||
/* since this function recurses, it could be driven to stack overflow */
|
||||
check_stack_depth();
|
||||
|
||||
if (!recursing)
|
||||
addrs = new_object_addresses();
|
||||
|
||||
@@ -10939,6 +10946,9 @@ ATExecAlterConstrRecurse(Constraint *cmdcon, Relation conrel, Relation tgrel,
|
||||
Oid refrelid;
|
||||
bool changed = false;
|
||||
|
||||
/* since this function recurses, it could be driven to stack overflow */
|
||||
check_stack_depth();
|
||||
|
||||
currcon = (Form_pg_constraint) GETSTRUCT(contuple);
|
||||
conoid = currcon->oid;
|
||||
refrelid = currcon->confrelid;
|
||||
@@ -11955,6 +11965,9 @@ ATExecDropConstraint(Relation rel, const char *constrName,
|
||||
bool is_no_inherit_constraint = false;
|
||||
char contype;
|
||||
|
||||
/* since this function recurses, it could be driven to stack overflow */
|
||||
check_stack_depth();
|
||||
|
||||
/* At top level, permission check was done in ATPrepCmd, else do it */
|
||||
if (recursing)
|
||||
ATSimplePermissions(AT_DropConstraint, rel, ATT_TABLE | ATT_FOREIGN_TABLE);
|
||||
|
Reference in New Issue
Block a user