mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Implement new-protocol binary I/O support in DataRow, Bind, and FunctionCall
messages. Binary I/O is now up and working, but only for a small set of datatypes (integers, text, bytea).
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.341 2003/05/09 15:57:24 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.342 2003/05/09 18:08:48 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* this is the "main" module of the postgres backend and
|
||||
@ -1342,8 +1342,21 @@ exec_bind_message(StringInfo input_message)
|
||||
}
|
||||
else if (pformat == 1)
|
||||
{
|
||||
/* XXX something similar to above */
|
||||
elog(ERROR, "Binary BIND not implemented yet");
|
||||
Oid typReceive;
|
||||
Oid typElem;
|
||||
|
||||
/* Call the parameter type's binary input converter */
|
||||
getTypeBinaryInputInfo(ptype, &typReceive, &typElem);
|
||||
|
||||
params[i].value =
|
||||
OidFunctionCall2(typReceive,
|
||||
PointerGetDatum(&pbuf),
|
||||
ObjectIdGetDatum(typElem));
|
||||
|
||||
/* Trouble if it didn't eat the whole buffer */
|
||||
if (pbuf.cursor != pbuf.len)
|
||||
elog(ERROR, "Improper binary format in BIND parameter %d",
|
||||
i + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2511,7 +2524,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
||||
if (!IsUnderPostmaster)
|
||||
{
|
||||
puts("\nPOSTGRES backend interactive interface ");
|
||||
puts("$Revision: 1.341 $ $Date: 2003/05/09 15:57:24 $\n");
|
||||
puts("$Revision: 1.342 $ $Date: 2003/05/09 18:08:48 $\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2771,6 +2784,9 @@ PostgresMain(int argc, char *argv[], const char *username)
|
||||
/* start an xact for this function invocation */
|
||||
start_xact_command();
|
||||
|
||||
/* switch back to message context */
|
||||
MemoryContextSwitchTo(MessageContext);
|
||||
|
||||
if (HandleFunctionRequest(input_message) == EOF)
|
||||
{
|
||||
/* lost frontend connection during F message input */
|
||||
|
Reference in New Issue
Block a user