diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index b40e6b9d51..3906a52c8c 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.188 2006/07/04 13:22:15 momjian Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.189 2006/08/04 22:20:06 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -973,6 +973,7 @@ PQsendQueryGuts(PGconn *conn, pqPuts("", conn) < 0 || pqPuts(stmtName, conn) < 0) goto sendFailed; + if (nParams > 0 && paramFormats) { if (pqPutInt(nParams, 2, conn) < 0) @@ -988,8 +989,10 @@ PQsendQueryGuts(PGconn *conn, if (pqPutInt(0, 2, conn) < 0) goto sendFailed; } + if (pqPutInt(nParams, 2, conn) < 0) goto sendFailed; + for (i = 0; i < nParams; i++) { if (paramValues && paramValues[i])