Skip to content

Commit

Permalink
fix: compatible with postgres17
Browse files Browse the repository at this point in the history
  • Loading branch information
howz97 committed Aug 2, 2023
1 parent 3ee46aa commit c8a301c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
regression.diffs
regression.out
results
.cache
compile_commands.json
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ make install
or in case when PostgreSQL is installed in a custom location:
```sh
make install PG_CONFIG=/path/to/pg_config

# generate compile_commands.json
sudo bear -- make install PG_CONFIG=/usr/local/pgsql/bin/pg_config
```
It is possible to pass additional compilation flags through either custom
`CCFLAGS` or standard `PG_CFLAGS`, `PG_CXXFLAGS`, `PG_CPPFLAGS` variables.
Expand Down
2 changes: 1 addition & 1 deletion src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exc_palloc(std::size_t size)
void *ret;
MemoryContext context = CurrentMemoryContext;

AssertArg(MemoryContextIsValid(context));
Assert(MemoryContextIsValid(context));

if (!AllocSizeIsValid(size))
throw std::bad_alloc();
Expand Down
14 changes: 6 additions & 8 deletions src/parquet_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct ParquetFdwPlanState
static int
get_strategy(Oid type, Oid opno, Oid am)
{
Oid opclass;
Oid opclass;
Oid opfamily;

opclass = GetDefaultOpClass(type, am);
Expand Down Expand Up @@ -331,8 +331,7 @@ convert_const(Const *c, Oid dst_oid)
getTypeOutputInfo(c->consttype, &output_fn, &isvarlena);
getTypeInputInfo(dst_oid, &input_fn, &input_param);

str = DatumGetCString(OidOutputFunctionCall(output_fn,
c->constvalue));
str = OidOutputFunctionCall(output_fn, c->constvalue);
newc->constvalue = OidInputFunctionCall(input_fn, str,
input_param, 0);

Expand Down Expand Up @@ -950,7 +949,7 @@ get_filenames_from_userfunc(const char *funcname, const char *funcarg)
{
Jsonb *j = NULL;
Oid funcid;
List *f = stringToQualifiedNameList(funcname);
List *f = stringToQualifiedNameList(funcname, NULL);
Datum filenames;
Oid jsonboid = JSONBOID;
Datum *values;
Expand Down Expand Up @@ -1265,9 +1264,8 @@ parquetGetForeignPaths(PlannerInfo *root,
NULL);

/* Create PathKey for the attribute from "sorted" option */
attr_pathkeys = build_expression_pathkey(root, (Expr *) var, NULL,
sort_op, baserel->relids,
true);
attr_pathkeys = build_expression_pathkey(root, (Expr *) var, sort_op,
baserel->relids, true);

if (attr_pathkeys != NIL)
{
Expand Down Expand Up @@ -2081,7 +2079,7 @@ parquet_fdw_validator_impl(PG_FUNCTION_ARGS)
else if (strcmp(def->defname, "files_func") == 0)
{
Oid jsonboid = JSONBOID;
List *funcname = stringToQualifiedNameList(defGetString(def));
List *funcname = stringToQualifiedNameList(defGetString(def), NULL);
Oid funcoid;
Oid rettype;

Expand Down

0 comments on commit c8a301c

Please sign in to comment.