Rename variables to not shadow globals in RHEL6 (#3194)

Fixes #2839
pull/3164/head
Jelte Fennema 2019-11-15 12:12:24 +01:00 committed by GitHub
parent a8bd2d58f5
commit 1b2c438e69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 27 deletions

View File

@ -3216,14 +3216,14 @@ GetConnectionState(HTAB *connectionStateHash, MultiConnection *connection)
CopyConnectionState *connectionState = NULL;
bool found = false;
int socket = PQsocket(connection->pgConn);
Assert(socket != -1);
int sock = PQsocket(connection->pgConn);
Assert(sock != -1);
connectionState = (CopyConnectionState *) hash_search(connectionStateHash, &socket,
connectionState = (CopyConnectionState *) hash_search(connectionStateHash, &sock,
HASH_ENTER, &found);
if (!found)
{
connectionState->socket = socket;
connectionState->socket = sock;
connectionState->connection = connection;
connectionState->activePlacementState = NULL;
dlist_init(&connectionState->bufferedPlacementList);

View File

@ -598,7 +598,7 @@ WaitEventSetFromMultiConnectionStates(List *connections, int *waitCount)
{
MultiConnectionPollState *connectionState = (MultiConnectionPollState *) lfirst(
connectionCell);
int socket = 0;
int sock = 0;
int eventMask = 0;
if (numEventsAdded >= eventSetSize)
@ -613,11 +613,11 @@ WaitEventSetFromMultiConnectionStates(List *connections, int *waitCount)
continue;
}
socket = PQsocket(connectionState->connection->pgConn);
sock = PQsocket(connectionState->connection->pgConn);
eventMask = MultiConnectionStateEventMask(connectionState);
AddWaitEventToSet(waitEventSet, eventMask, socket, NULL, connectionState);
AddWaitEventToSet(waitEventSet, eventMask, sock, NULL, connectionState);
numEventsAdded++;
if (waitCount)

View File

@ -706,7 +706,7 @@ static bool
FinishConnectionIO(MultiConnection *connection, bool raiseInterrupts)
{
PGconn *pgConn = connection->pgConn;
int socket = PQsocket(pgConn);
int sock = PQsocket(pgConn);
Assert(pgConn);
Assert(PQisnonblocking(pgConn));
@ -752,7 +752,7 @@ FinishConnectionIO(MultiConnection *connection, bool raiseInterrupts)
return true;
}
rc = WaitLatchOrSocket(MyLatch, waitFlags, socket, 0, PG_WAIT_EXTENSION);
rc = WaitLatchOrSocket(MyLatch, waitFlags, sock, 0, PG_WAIT_EXTENSION);
if (rc & WL_POSTMASTER_DEATH)
{
ereport(ERROR, (errmsg("postmaster was shut down, exiting")));
@ -1047,7 +1047,7 @@ BuildWaitEventSet(MultiConnection **allConnections, int totalConnectionCount,
{
MultiConnection *connection = allConnections[pendingConnectionsStartIndex +
connectionIndex];
int socket = PQsocket(connection->pgConn);
int sock = PQsocket(connection->pgConn);
/*
* Always start by polling for both readability (server sent bytes)
@ -1055,7 +1055,7 @@ BuildWaitEventSet(MultiConnection **allConnections, int totalConnectionCount,
*/
int eventMask = WL_SOCKET_READABLE | WL_SOCKET_WRITEABLE;
AddWaitEventToSet(waitEventSet, eventMask, socket, NULL, (void *) connection);
AddWaitEventToSet(waitEventSet, eventMask, sock, NULL, (void *) connection);
}
/*

View File

@ -3611,7 +3611,7 @@ BuildWaitEventSet(List *sessionList)
{
WorkerSession *session = lfirst(sessionCell);
MultiConnection *connection = session->connection;
int socket = 0;
int sock = 0;
int waitEventSetIndex = 0;
if (connection->pgConn == NULL)
@ -3626,14 +3626,14 @@ BuildWaitEventSet(List *sessionList)
continue;
}
socket = PQsocket(connection->pgConn);
if (socket == -1)
sock = PQsocket(connection->pgConn);
if (sock == -1)
{
/* connection was closed */
continue;
}
waitEventSetIndex = AddWaitEventToSet(waitEventSet, connection->waitFlags, socket,
waitEventSetIndex = AddWaitEventToSet(waitEventSet, connection->waitFlags, sock,
NULL, (void *) session);
session->waitEventSetIndex = waitEventSetIndex;
}
@ -3658,7 +3658,7 @@ UpdateWaitEventSetFlags(WaitEventSet *waitEventSet, List *sessionList)
{
WorkerSession *session = lfirst(sessionCell);
MultiConnection *connection = session->connection;
int socket = 0;
int sock = 0;
int waitEventSetIndex = session->waitEventSetIndex;
if (connection->pgConn == NULL)
@ -3673,8 +3673,8 @@ UpdateWaitEventSetFlags(WaitEventSet *waitEventSet, List *sessionList)
continue;
}
socket = PQsocket(connection->pgConn);
if (socket == -1)
sock = PQsocket(connection->pgConn);
if (sock == -1)
{
/* connection was closed */
continue;

View File

@ -1348,8 +1348,8 @@ multi_join_restriction_hook(PlannerInfo *root,
* it to retrieve restrictions on relations.
*/
void
multi_relation_restriction_hook(PlannerInfo *root, RelOptInfo *relOptInfo, Index index,
RangeTblEntry *rte)
multi_relation_restriction_hook(PlannerInfo *root, RelOptInfo *relOptInfo,
Index restrictionIndex, RangeTblEntry *rte)
{
PlannerRestrictionContext *plannerRestrictionContext = NULL;
RelationRestrictionContext *relationRestrictionContext = NULL;
@ -1379,7 +1379,7 @@ multi_relation_restriction_hook(PlannerInfo *root, RelOptInfo *relOptInfo, Index
localTable = !distributedTable;
relationRestriction = palloc0(sizeof(RelationRestriction));
relationRestriction->index = index;
relationRestriction->index = restrictionIndex;
relationRestriction->relationId = rte->relid;
relationRestriction->rte = rte;
relationRestriction->relOptInfo = relOptInfo;

View File

@ -457,7 +457,6 @@ FullCompositeFieldList(List *compositeFieldList)
foreach(fieldSelectCell, compositeFieldList)
{
FieldSelect *fieldSelect = (FieldSelect *) lfirst(fieldSelectCell);
uint32 compositeFieldIndex = 0;
Expr *fieldExpression = fieldSelect->arg;
if (!IsA(fieldExpression, Var))
@ -467,7 +466,6 @@ FullCompositeFieldList(List *compositeFieldList)
if (compositeFieldArray == NULL)
{
uint32 index = 0;
Var *compositeColumn = (Var *) fieldExpression;
Oid compositeTypeId = compositeColumn->vartype;
Oid compositeRelationId = get_typ_typrelid(compositeTypeId);
@ -478,13 +476,15 @@ FullCompositeFieldList(List *compositeFieldList)
compositeFieldArray = palloc0(compositeFieldCount * sizeof(bool));
relation_close(relation, AccessShareLock);
for (index = 0; index < compositeFieldCount; index++)
for (uint32 compositeFieldIndex = 0;
compositeFieldIndex < compositeFieldCount;
compositeFieldIndex++)
{
compositeFieldArray[index] = false;
compositeFieldArray[compositeFieldIndex] = false;
}
}
compositeFieldIndex = fieldSelect->fieldnum - 1;
uint32 compositeFieldIndex = fieldSelect->fieldnum - 1;
compositeFieldArray[compositeFieldIndex] = true;
}

View File

@ -108,7 +108,7 @@ extern List * ExtractRangeTableEntryList(Query *query);
extern bool NeedsDistributedPlanning(Query *query);
extern struct DistributedPlan * GetDistributedPlan(CustomScan *node);
extern void multi_relation_restriction_hook(PlannerInfo *root, RelOptInfo *relOptInfo,
Index index, RangeTblEntry *rte);
Index restrictionIndex, RangeTblEntry *rte);
extern void multi_join_restriction_hook(PlannerInfo *root,
RelOptInfo *joinrel,
RelOptInfo *outerrel,