diff options
| author | Mason Sharp | 2015-03-03 22:42:49 +0000 |
|---|---|---|
| committer | Pavan Deolasee | 2015-04-15 05:49:16 +0000 |
| commit | 94cf23fc9b4229b427d63cbf7acaeb3cea245bc4 (patch) | |
| tree | 343768ae7b81cda3ab86a8d1f25f92a64517335c | |
| parent | 5404c28eafd2740e6781e3b3d9285386e82fde23 (diff) | |
Address reading type short on big endian processors like SPARC
| -rw-r--r-- | src/backend/pgxc/pool/pgxcnode.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/pgxc/pool/pgxcnode.c b/src/backend/pgxc/pool/pgxcnode.c index 96f062f36b..38b22ee8cb 100644 --- a/src/backend/pgxc/pool/pgxcnode.c +++ b/src/backend/pgxc/pool/pgxcnode.c @@ -1405,6 +1405,7 @@ pgxc_node_send_plan(PGXCNodeHandle * handle, const char *statement, int msgLen; char **paramTypes = (char **)palloc(sizeof(char *) * num_params); int i; + short tmp_num_params; /* Invalid connection state, return error */ if (handle->state != DN_CONNECTION_STATE_IDLE) @@ -1449,8 +1450,9 @@ pgxc_node_send_plan(PGXCNodeHandle * handle, const char *statement, memcpy(handle->outBuffer + handle->outEnd, planstr, planLen); handle->outEnd += planLen; /* parameter types */ - *((short *)(handle->outBuffer + handle->outEnd)) = htons(num_params); - handle->outEnd += sizeof(num_params); + tmp_num_params = htons(num_params); + memcpy(handle->outBuffer + handle->outEnd, &tmp_num_params, sizeof(tmp_num_params)); + handle->outEnd += sizeof(tmp_num_params); /* * instead of parameter ids we should send parameter names (qualified by * schema name if required). The OIDs of types can be different on |
