8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.494 2006/08/04 18:53:46 momjian Exp $
11
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.495 2006/08/06 02:00:52 momjian Exp $
12
12
*
13
13
* NOTES
14
14
* this is the "main" module of the postgres backend and
@@ -1364,7 +1364,6 @@ exec_bind_message(StringInfo input_message)
1364
1364
int numParams ;
1365
1365
int numRFormats ;
1366
1366
int16 * rformats = NULL ;
1367
- int i ;
1368
1367
PreparedStatement * pstmt ;
1369
1368
Portal portal ;
1370
1369
ParamListInfo params ;
@@ -1391,6 +1390,8 @@ exec_bind_message(StringInfo input_message)
1391
1390
numPFormats = pq_getmsgint (input_message , 2 );
1392
1391
if (numPFormats > 0 )
1393
1392
{
1393
+ int i ;
1394
+
1394
1395
pformats = (int16 * ) palloc (numPFormats * sizeof (int16 ));
1395
1396
for (i = 0 ; i < numPFormats ; i ++ )
1396
1397
pformats [i ] = pq_getmsgint (input_message , 2 );
@@ -1463,6 +1464,7 @@ exec_bind_message(StringInfo input_message)
1463
1464
{
1464
1465
ListCell * l ;
1465
1466
MemoryContext oldContext ;
1467
+ int paramno ;
1466
1468
1467
1469
oldContext = MemoryContextSwitchTo (PortalGetHeapMemory (portal ));
1468
1470
@@ -1471,7 +1473,7 @@ exec_bind_message(StringInfo input_message)
1471
1473
(numParams - 1 ) * sizeof (ParamExternData ));
1472
1474
params -> numParams = numParams ;
1473
1475
1474
- i = 0 ;
1476
+ paramno = 0 ;
1475
1477
foreach (l , pstmt -> argtype_list )
1476
1478
{
1477
1479
Oid ptype = lfirst_oid (l );
@@ -1511,7 +1513,7 @@ exec_bind_message(StringInfo input_message)
1511
1513
}
1512
1514
1513
1515
if (numPFormats > 1 )
1514
- pformat = pformats [i ];
1516
+ pformat = pformats [paramno ];
1515
1517
else if (numPFormats > 0 )
1516
1518
pformat = pformats [0 ];
1517
1519
else
@@ -1534,7 +1536,7 @@ exec_bind_message(StringInfo input_message)
1534
1536
else
1535
1537
pstring = pg_client_to_server (pbuf .data , plength );
1536
1538
1537
- params -> params [i ].value = OidInputFunctionCall (typinput ,
1539
+ params -> params [paramno ].value = OidInputFunctionCall (typinput ,
1538
1540
pstring ,
1539
1541
typioparam ,
1540
1542
-1 );
@@ -1558,7 +1560,7 @@ exec_bind_message(StringInfo input_message)
1558
1560
else
1559
1561
bufptr = & pbuf ;
1560
1562
1561
- params -> params [i ].value = OidReceiveFunctionCall (typreceive ,
1563
+ params -> params [paramno ].value = OidReceiveFunctionCall (typreceive ,
1562
1564
bufptr ,
1563
1565
typioparam ,
1564
1566
-1 );
@@ -1568,7 +1570,7 @@ exec_bind_message(StringInfo input_message)
1568
1570
ereport (ERROR ,
1569
1571
(errcode (ERRCODE_INVALID_BINARY_REPRESENTATION ),
1570
1572
errmsg ("incorrect binary data format in bind parameter %d" ,
1571
- i + 1 )));
1573
+ paramno + 1 )));
1572
1574
}
1573
1575
else
1574
1576
{
@@ -1582,10 +1584,10 @@ exec_bind_message(StringInfo input_message)
1582
1584
if (!isNull )
1583
1585
pbuf .data [plength ] = csave ;
1584
1586
1585
- params -> params [i ].isnull = isNull ;
1586
- params -> params [i ].ptype = ptype ;
1587
+ params -> params [paramno ].isnull = isNull ;
1588
+ params -> params [paramno ].ptype = ptype ;
1587
1589
1588
- i ++ ;
1590
+ paramno ++ ;
1589
1591
}
1590
1592
1591
1593
MemoryContextSwitchTo (oldContext );
@@ -1597,6 +1599,8 @@ exec_bind_message(StringInfo input_message)
1597
1599
numRFormats = pq_getmsgint (input_message , 2 );
1598
1600
if (numRFormats > 0 )
1599
1601
{
1602
+ int i ;
1603
+
1600
1604
rformats = (int16 * ) palloc (numRFormats * sizeof (int16 ));
1601
1605
for (i = 0 ; i < numRFormats ; i ++ )
1602
1606
rformats [i ] = pq_getmsgint (input_message , 2 );
0 commit comments