Skip to content

Commit

Permalink
Issue #84: MemSet ParquetFdwPlanState before using
Browse files Browse the repository at this point in the history
  • Loading branch information
za-arthur committed Jun 3, 2024
1 parent d1c43db commit f059d87
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/parquet_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,8 @@ get_table_options(Oid relid, ParquetFdwPlanState *fdw_private)
char *funcname = NULL;
char *funcarg = NULL;

fdw_private->filenames = NIL;
fdw_private->attrs_sorted = NIL;
fdw_private->use_mmap = false;
fdw_private->use_threads = false;
fdw_private->max_open_files = 0;
Expand Down Expand Up @@ -1677,6 +1679,7 @@ parquetAcquireSampleRowsFunc(Relation relation, int /* elevel */,
ListCell *lc;
std::string error;

MemSet(&fdw_private, 0, sizeof(fdw_private));
get_table_options(RelationGetRelid(relation), &fdw_private);

for (int i = 0; i < tupleDesc->natts; ++i)
Expand Down

0 comments on commit f059d87

Please sign in to comment.