diff --git a/src/option.c b/src/option.c index c82a7f01..c126c8e8 100644 --- a/src/option.c +++ b/src/option.c @@ -85,8 +85,6 @@ static bool is_ch_option(const char* keyword); static bool parse_min_tls_version(const char* val, tls_version* out); -static bool -parse_encoding_check(const char* val, pgch_encoding_check* out); /* * Validate the generic options given to a FOREIGN DATA WRAPPER, SERVER, @@ -172,7 +170,7 @@ clickhouse_fdw_validator(PG_FUNCTION_ARGS) { const char* val = defGetString(def); pgch_encoding_check v; - if (!parse_encoding_check(val, &v)) { + if (!pgch_parse_encoding_check(val, &v)) { ereport( ERROR, errcode(ERRCODE_FDW_INVALID_STRING_FORMAT), @@ -278,23 +276,6 @@ parse_min_tls_version(const char* val, tls_version* out) { return true; } -/* Map an encoding_check option value to pgch_encoding_check. */ -static bool -parse_encoding_check(const char* val, pgch_encoding_check* out) { - if (pg_strcasecmp(val, "replace") == 0) { - *out = CHC_ENC_REPLACE; - } else if (pg_strcasecmp(val, "remove") == 0) { - *out = CHC_ENC_REMOVE; - } else if (pg_strcasecmp(val, "truncate") == 0) { - *out = CHC_ENC_TRUNCATE; - } else if (pg_strcasecmp(val, "fail") == 0) { - *out = CHC_ENC_FAIL; - } else { - return false; - } - return true; -} - /* * Check whether the given option is one of the valid clickhouse_fdw options. * context is the Oid of the catalog holding the object the option is for. @@ -363,7 +344,7 @@ chfdw_extract_options( *driver = defGetString(def); } else if (encoding_check && strcmp(def->defname, "encoding_check") == 0) { /* invalid values rejected by the validator; ignore here */ - parse_encoding_check(defGetString(def), encoding_check); + pgch_parse_encoding_check(defGetString(def), encoding_check); } if (is_ch_option(def->defname)) { diff --git a/vendor/pg-clickhouse-c b/vendor/pg-clickhouse-c index 3cc34cb3..f45f0563 160000 --- a/vendor/pg-clickhouse-c +++ b/vendor/pg-clickhouse-c @@ -1 +1 @@ -Subproject commit 3cc34cb3e2506305b21374e8b90ee50e2d5bfd61 +Subproject commit f45f05634627c2c0f148700fbe39f948e91efdea