Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
79aa4453
Commit
79aa4453
authored
Jun 29, 2011
by
Magnus Hagander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect pg_stat_reset_shared() against NULL input
Per bug #6082, reported by Steve Haslam
parent
21f1e15a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
src/backend/utils/adt/pgstatfuncs.c
src/backend/utils/adt/pgstatfuncs.c
+11
-3
No files found.
src/backend/utils/adt/pgstatfuncs.c
View file @
79aa4453
...
...
@@ -1537,9 +1537,17 @@ pg_stat_reset(PG_FUNCTION_ARGS)
Datum
pg_stat_reset_shared
(
PG_FUNCTION_ARGS
)
{
char
*
target
=
text_to_cstring
(
PG_GETARG_TEXT_PP
(
0
));
pgstat_reset_shared_counters
(
target
);
if
(
PG_ARGISNULL
(
0
))
/*
* Same error message as in pgstat_reset_shared_counters(),
* to keep translations the same.
*/
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_PARAMETER_VALUE
),
errmsg
(
"unrecognized reset target:
\"
%s
\"
"
,
"null"
),
errhint
(
"Target must be
\"
bgwriter
\"
."
)));
pgstat_reset_shared_counters
(
text_to_cstring
(
PG_GETARG_TEXT_PP
(
0
)));
PG_RETURN_VOID
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment