88 *
99 *
1010 * IDENTIFICATION
11- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.133 2003/04/25 19:45:09 tgl Exp $
11+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.134 2003/04/26 20:22:59 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -1027,6 +1027,8 @@ parseInput(PGconn *conn)
10271027conn -> asyncStatus = PGASYNC_READY ;
10281028break ;
10291029case 'Z' :/* backend is ready for new query */
1030+ if (pqGetc (& conn -> xact_status ,conn ))
1031+ return ;
10301032conn -> asyncStatus = PGASYNC_IDLE ;
10311033break ;
10321034case 'I' :/* empty query */
@@ -1222,11 +1224,15 @@ getRowDescriptions(PGconn *conn)
12221224/* get type info */
12231225for (i = 0 ;i < nfields ;i ++ )
12241226{
1227+ int tableid ;
1228+ int columnid ;
12251229int typid ;
12261230int typlen ;
12271231int atttypmod ;
12281232
12291233if (pqGets (& conn -> workBuffer ,conn )||
1234+ pqGetInt (& tableid ,4 ,conn )||
1235+ pqGetInt (& columnid ,2 ,conn )||
12301236pqGetInt (& typid ,4 ,conn )||
12311237pqGetInt (& typlen ,2 ,conn )||
12321238pqGetInt (& atttypmod ,4 ,conn ))
@@ -1237,15 +1243,17 @@ getRowDescriptions(PGconn *conn)
12371243
12381244/*
12391245 * Since pqGetInt treats 2-byte integers as unsigned, we need to
1240- * coercethe result to signed form.
1246+ * coercethese results to signed form.
12411247 */
1248+ columnid = (int ) ((int16 )columnid );
12421249typlen = (int ) ((int16 )typlen );
12431250
12441251result -> attDescs [i ].name = pqResultStrdup (result ,
12451252conn -> workBuffer .data );
12461253result -> attDescs [i ].typid = typid ;
12471254result -> attDescs [i ].typlen = typlen ;
12481255result -> attDescs [i ].atttypmod = atttypmod ;
1256+ /* XXX todo: save tableid/columnid too */
12491257}
12501258
12511259/* Success! */
@@ -2289,9 +2297,10 @@ PQfn(PGconn *conn,
22892297continue ;
22902298break ;
22912299case 'Z' :/* backend is ready for new query */
2300+ if (pqGetc (& conn -> xact_status ,conn ))
2301+ continue ;
22922302/* consume the message and exit */
22932303conn -> inStart += 5 + msgLength ;
2294- /* XXX expect additional fields here */
22952304/* if we saved a result object (probably an error), use it */
22962305if (conn -> result )
22972306return prepareAsyncResult (conn );