This is an automated email from the ASF dual-hosted git repository. djwang pushed a commit to branch merge-with-upstream in repository https://gitbox.apache.org/repos/asf/cloudberry-pxf.git
commit a81df0b94fa4991eef7305948f3815e1dd1657b4 Author: Himanshu Pandey <[email protected]> AuthorDate: Fri Sep 9 14:35:19 2022 -0700 Handle fucntion call for 6.x and 7.x --- external-table/src/pxfheaders.c | 2 +- external-table/src/pxfuriparser.c | 13 ++++++++----- external-table/src/pxfutils.c | 7 ++++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/external-table/src/pxfheaders.c b/external-table/src/pxfheaders.c index 1ab908ad..2d45a319 100644 --- a/external-table/src/pxfheaders.c +++ b/external-table/src/pxfheaders.c @@ -21,11 +21,11 @@ #include "pxfheaders.h" #include "commands/defrem.h" #if PG_VERSION_NUM >= 120000 -#include "utils/timestamp.h" #include "access/external.h" #include "extension/gp_exttable_fdw/extaccess.h" #else #include "access/fileam.h" +#include "utils/timestamp.h" #include "catalog/pg_exttable.h" #endif #include "utils/timestamp.h" diff --git a/external-table/src/pxfuriparser.c b/external-table/src/pxfuriparser.c index 52f18af9..e251e0c9 100644 --- a/external-table/src/pxfuriparser.c +++ b/external-table/src/pxfuriparser.c @@ -290,11 +290,14 @@ GPHDUri_verify_no_duplicate_options(GPHDUri *uri) foreach(option, uri->options) { OptionData *data = (OptionData *) lfirst(option); - #if PG_VERSION_NUM >= 120000 - Value *key = makeString(asc_toupper(data->key, strlen(data->key))); - #else - Value *key = makeString(str_toupper(data->key, strlen(data->key))); - #endif + +// For GP 5.x latest ( 5.29.8) the server_version_num is 80323. +// For 6.x or later str_toupper doesn't work as it has different signature ( one extra parameter) so the asc_toupper will work for 6.x or 7.x +#if PG_VERSION_NUM <= 80323 + Value *key = makeString(str_toupper(data->key, strlen(data->key))); +#else + Value *key = makeString(asc_toupper(data->key, strlen(data->key))); +#endif if (!list_member(previousKeys, key)) previousKeys = lappend(previousKeys, key); diff --git a/external-table/src/pxfutils.c b/external-table/src/pxfutils.c index c6a01e6c..d8b2258d 100644 --- a/external-table/src/pxfutils.c +++ b/external-table/src/pxfutils.c @@ -22,8 +22,13 @@ normalize_key_name(const char *key) (errcode(ERRCODE_INTERNAL_ERROR), errmsg("internal error in pxfutils.c:normalize_key_name. Parameter key is null or empty."))); } - +// For GP 5.x latest ( 5.29.8) the server_version_num is 80323. +// For 6.x or later str_toupper doesn't work as it has different signature ( one extra parameter) so the asc_toupper will work for 6.x or 7.x +#if PG_VERSION_NUM <= 80323 + return psprintf("X-GP-OPTIONS-%s", str_toupper(pstrdup(key), strlen(key))); +#else return psprintf("X-GP-OPTIONS-%s", asc_toupper(pstrdup(key), strlen(key))); +#endif } /* --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
