Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

pg_upgrade fails with non-standard ACL #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master_ci
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix
  • Loading branch information
alubennikova committed Jun 11, 2020
commit fc87edb12a2d15bd445bad2a5c55442c8375e2c7
8 changes: 6 additions & 2 deletions src/bin/pg_upgrade/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ get_non_default_acl_infos(ClusterInfo *cluster)
DbInfo *dbinfo = &cluster->dbarr.dbs[dbnum];
PGconn *conn = connectToServer(cluster, dbinfo->db_name);
PGresult *res;
AclInfo *aclinfos;
AclInfo *curr;
AclInfo *aclinfos = NULL;
AclInfo *curr = NULL;
int nacls = 0,
size_acls = 8;
int aclnum = 0;
Expand Down Expand Up @@ -500,6 +500,7 @@ get_db_infos(ClusterInfo *cluster)

/* initialize clean array */
dbinfos[tupnum].non_def_acl_arr.nacls = 0;
dbinfos[tupnum].non_def_acl_arr.aclinfos = NULL;
}
PQclear(res);

Expand Down Expand Up @@ -711,6 +712,7 @@ free_db_and_rel_infos(DbInfoArr *db_arr)
for (dbnum = 0; dbnum < db_arr->ndbs; dbnum++)
{
free_rel_infos(&db_arr->dbs[dbnum].rel_arr);

if (&db_arr->dbs[dbnum].non_def_acl_arr.nacls > 0)
free_acl_infos(&db_arr->dbs[dbnum].non_def_acl_arr);
pg_free(db_arr->dbs[dbnum].db_name);
Expand Down Expand Up @@ -750,7 +752,9 @@ free_acl_infos(AclInfoArr *acl_arr)
pg_free(acl_arr->aclinfos[aclnum].obj_ident);
pg_free(acl_arr->aclinfos[aclnum].role_names);
}

pg_free(acl_arr->aclinfos);
acl_arr->aclinfos = NULL;
acl_arr->nacls = 0;
pg_log(PG_REPORT, "free_acl_infos 2 %d\n", acl_arr->nacls);
}
Expand Down