projects
/
postgres-xl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18a810d
)
Ensure pgxc_node_str returns the result in correct format
author
Pavan Deolasee
<
[email protected]
>
Wed, 29 Aug 2018 05:58:38 +0000
(11:28 +0530)
committer
Pavan Deolasee
<
[email protected]
>
Wed, 29 Aug 2018 05:58:38 +0000
(11:28 +0530)
Per report from Krzysztof Nienartowicz, this broke the pgxc_clean command on
XL10.
src/backend/pgxc/pool/pgxcnode.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/pgxc/pool/pgxcnode.c
b/src/backend/pgxc/pool/pgxcnode.c
index f6dfd2a48c6b546b3ab1f7a9e368b000782a9e2d..01d678dd2f0c6e67db224265e2de1fb883d8a468 100644
(file)
--- a/
src/backend/pgxc/pool/pgxcnode.c
+++ b/
src/backend/pgxc/pool/pgxcnode.c
@@
-2566,7
+2566,15
@@
PGXCNodeGetNodeOid(int nodeid, char node_type)
Datum
pgxc_node_str(PG_FUNCTION_ARGS)
{
- PG_RETURN_TEXT_P(cstring_to_text(PGXCNodeName));
+ Name result;
+ int len;
+
+ len = strlen(PGXCNodeName);
+ /* We use palloc0 here to ensure result is zero-padded */
+ result = (Name) palloc0(NAMEDATALEN);
+ memcpy(NameStr(*result), PGXCNodeName, NAMEDATALEN - 1);
+
+ PG_RETURN_NAME(result);
}
/*