Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add NULL test on GetConfigOption() #33

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pg_query_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ execPlantuner(Query *parse, const char *query_st, int cursorOptions, ParamListIn
int64 id;
char *guc_value = NULL;
char *guc_name = NULL;
const char *oldValue = NULL;
parameter *param = NULL;
uint64 queryid = 0;

Expand Down Expand Up @@ -213,7 +214,13 @@ execPlantuner(Query *parse, const char *query_st, int cursorOptions, ParamListIn
param->name = pstrdup(guc_name);

/* Get and store current value for the parameter. */
param->oldValue = pstrdup(GetConfigOption(guc_name, true, false));
oldValue = GetConfigOption(guc_name, true, false);
if (oldValue == NULL)
{
elog(WARNING, "Parameter %s does not exists", guc_name);
continue;
}
param->oldValue = pstrdup(oldValue);

slist_push_head(&paramResetList, &param->node);

Expand Down