mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Use better named loop variable for large loop, rather than 'i'.
This commit is contained in:
parent
635d42e9c3
commit
c0dc166adc
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.494 2006/08/04 18:53:46 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.495 2006/08/06 02:00:52 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* this is the "main" module of the postgres backend and
|
* this is the "main" module of the postgres backend and
|
||||||
@ -1364,7 +1364,6 @@ exec_bind_message(StringInfo input_message)
|
|||||||
int numParams;
|
int numParams;
|
||||||
int numRFormats;
|
int numRFormats;
|
||||||
int16 *rformats = NULL;
|
int16 *rformats = NULL;
|
||||||
int i;
|
|
||||||
PreparedStatement *pstmt;
|
PreparedStatement *pstmt;
|
||||||
Portal portal;
|
Portal portal;
|
||||||
ParamListInfo params;
|
ParamListInfo params;
|
||||||
@ -1391,6 +1390,8 @@ exec_bind_message(StringInfo input_message)
|
|||||||
numPFormats = pq_getmsgint(input_message, 2);
|
numPFormats = pq_getmsgint(input_message, 2);
|
||||||
if (numPFormats > 0)
|
if (numPFormats > 0)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
pformats = (int16 *) palloc(numPFormats * sizeof(int16));
|
pformats = (int16 *) palloc(numPFormats * sizeof(int16));
|
||||||
for (i = 0; i < numPFormats; i++)
|
for (i = 0; i < numPFormats; i++)
|
||||||
pformats[i] = pq_getmsgint(input_message, 2);
|
pformats[i] = pq_getmsgint(input_message, 2);
|
||||||
@ -1463,6 +1464,7 @@ exec_bind_message(StringInfo input_message)
|
|||||||
{
|
{
|
||||||
ListCell *l;
|
ListCell *l;
|
||||||
MemoryContext oldContext;
|
MemoryContext oldContext;
|
||||||
|
int paramno;
|
||||||
|
|
||||||
oldContext = MemoryContextSwitchTo(PortalGetHeapMemory(portal));
|
oldContext = MemoryContextSwitchTo(PortalGetHeapMemory(portal));
|
||||||
|
|
||||||
@ -1471,7 +1473,7 @@ exec_bind_message(StringInfo input_message)
|
|||||||
(numParams - 1) * sizeof(ParamExternData));
|
(numParams - 1) * sizeof(ParamExternData));
|
||||||
params->numParams = numParams;
|
params->numParams = numParams;
|
||||||
|
|
||||||
i = 0;
|
paramno = 0;
|
||||||
foreach(l, pstmt->argtype_list)
|
foreach(l, pstmt->argtype_list)
|
||||||
{
|
{
|
||||||
Oid ptype = lfirst_oid(l);
|
Oid ptype = lfirst_oid(l);
|
||||||
@ -1511,7 +1513,7 @@ exec_bind_message(StringInfo input_message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (numPFormats > 1)
|
if (numPFormats > 1)
|
||||||
pformat = pformats[i];
|
pformat = pformats[paramno];
|
||||||
else if (numPFormats > 0)
|
else if (numPFormats > 0)
|
||||||
pformat = pformats[0];
|
pformat = pformats[0];
|
||||||
else
|
else
|
||||||
@ -1534,7 +1536,7 @@ exec_bind_message(StringInfo input_message)
|
|||||||
else
|
else
|
||||||
pstring = pg_client_to_server(pbuf.data, plength);
|
pstring = pg_client_to_server(pbuf.data, plength);
|
||||||
|
|
||||||
params->params[i].value = OidInputFunctionCall(typinput,
|
params->params[paramno].value = OidInputFunctionCall(typinput,
|
||||||
pstring,
|
pstring,
|
||||||
typioparam,
|
typioparam,
|
||||||
-1);
|
-1);
|
||||||
@ -1558,7 +1560,7 @@ exec_bind_message(StringInfo input_message)
|
|||||||
else
|
else
|
||||||
bufptr = &pbuf;
|
bufptr = &pbuf;
|
||||||
|
|
||||||
params->params[i].value = OidReceiveFunctionCall(typreceive,
|
params->params[paramno].value = OidReceiveFunctionCall(typreceive,
|
||||||
bufptr,
|
bufptr,
|
||||||
typioparam,
|
typioparam,
|
||||||
-1);
|
-1);
|
||||||
@ -1568,7 +1570,7 @@ exec_bind_message(StringInfo input_message)
|
|||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
|
(errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
|
||||||
errmsg("incorrect binary data format in bind parameter %d",
|
errmsg("incorrect binary data format in bind parameter %d",
|
||||||
i + 1)));
|
paramno + 1)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1582,10 +1584,10 @@ exec_bind_message(StringInfo input_message)
|
|||||||
if (!isNull)
|
if (!isNull)
|
||||||
pbuf.data[plength] = csave;
|
pbuf.data[plength] = csave;
|
||||||
|
|
||||||
params->params[i].isnull = isNull;
|
params->params[paramno].isnull = isNull;
|
||||||
params->params[i].ptype = ptype;
|
params->params[paramno].ptype = ptype;
|
||||||
|
|
||||||
i++;
|
paramno++;
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryContextSwitchTo(oldContext);
|
MemoryContextSwitchTo(oldContext);
|
||||||
@ -1597,6 +1599,8 @@ exec_bind_message(StringInfo input_message)
|
|||||||
numRFormats = pq_getmsgint(input_message, 2);
|
numRFormats = pq_getmsgint(input_message, 2);
|
||||||
if (numRFormats > 0)
|
if (numRFormats > 0)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
rformats = (int16 *) palloc(numRFormats * sizeof(int16));
|
rformats = (int16 *) palloc(numRFormats * sizeof(int16));
|
||||||
for (i = 0; i < numRFormats; i++)
|
for (i = 0; i < numRFormats; i++)
|
||||||
rformats[i] = pq_getmsgint(input_message, 2);
|
rformats[i] = pq_getmsgint(input_message, 2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user