diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-08-12 21:34:44 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-08-12 21:34:44 +0000 |
commit | 90ade5b775cf6ca014f56848ac887029edd8670e (patch) | |
tree | 1f7fff4d5471bb3e37b192e3df850b2e9fc87175 /src/interfaces/libpq/fe-protocol3.c | |
parent | b6e5823eda7d238c6a7565f4de0241f5967b5b3e (diff) | |
download | postgresql-90ade5b775cf6ca014f56848ac887029edd8670e.tar.gz postgresql-90ade5b775cf6ca014f56848ac887029edd8670e.zip |
Cope with NoData message from backend. Needed for case where
PQexecParams is used with a statement that doesn't return data.
Diffstat (limited to 'src/interfaces/libpq/fe-protocol3.c')
-rw-r--r-- | src/interfaces/libpq/fe-protocol3.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c index 15de69007d1..cc2546128c5 100644 --- a/src/interfaces/libpq/fe-protocol3.c +++ b/src/interfaces/libpq/fe-protocol3.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-protocol3.c,v 1.6 2003/08/04 02:40:20 momjian Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-protocol3.c,v 1.7 2003/08/12 21:34:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -232,8 +232,7 @@ pqParseInput3(PGconn *conn) if (pqGetInt(&(conn->be_key), 4, conn)) return; break; - case 'T': /* row descriptions (start of query - * results) */ + case 'T': /* Row Description */ if (conn->result == NULL) { /* First 'T' in a query sequence */ @@ -253,6 +252,17 @@ pqParseInput3(PGconn *conn) return; } break; + case 'n': /* No Data */ + /* + * NoData indicates that we will not be seeing a + * RowDescription message because the statement or + * portal inquired about doesn't return rows. + * Set up a COMMAND_OK result, instead of TUPLES_OK. + */ + if (conn->result == NULL) + conn->result = PQmakeEmptyPGresult(conn, + PGRES_COMMAND_OK); + break; case 'D': /* Data Row */ if (conn->result != NULL && conn->result->resultStatus == PGRES_TUPLES_OK) |