Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit24e2d4b

Browse files
committed
Mark pg_stat_reset_shared as strict
This is the proper fix for bug #6082 aboutpg_stat_reset_shared(NULL) causing a crash, and it revertscommit79aa445 on head.The workaround of throwing an error from inside the function isleft on backbranches (including 9.1) since this change requiresa new initdb.
1 parent426cafc commit24e2d4b

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

‎src/backend/utils/adt/pgstatfuncs.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,17 +1537,9 @@ pg_stat_reset(PG_FUNCTION_ARGS)
15371537
Datum
15381538
pg_stat_reset_shared(PG_FUNCTION_ARGS)
15391539
{
1540-
if (PG_ARGISNULL(0))
1541-
/*
1542-
* Same error message as in pgstat_reset_shared_counters(),
1543-
* to keep translations the same.
1544-
*/
1545-
ereport(ERROR,
1546-
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1547-
errmsg("unrecognized reset target: \"%s\"","null"),
1548-
errhint("Target must be \"bgwriter\".")));
1549-
1550-
pgstat_reset_shared_counters(text_to_cstring(PG_GETARG_TEXT_PP(0)));
1540+
char*target=text_to_cstring(PG_GETARG_TEXT_PP(0));
1541+
1542+
pgstat_reset_shared_counters(target);
15511543

15521544
PG_RETURN_VOID();
15531545
}

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO201106211
56+
#defineCATALOG_VERSION_NO201107031
5757

5858
#endif

‎src/include/catalog/pg_proc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2663,7 +2663,7 @@ DATA(insert OID = 2230 ( pg_stat_clear_snapshotPGNSP PGUID 12 1 0 0 0 f f f f
26632663
DESCR("statistics: discard current transaction's statistics snapshot");
26642664
DATA(insertOID=2274 (pg_stat_resetPGNSPPGUID121000fffffv002278""_null__null__null__null_pg_stat_reset_null__null__null_ ));
26652665
DESCR("statistics: reset collected statistics for current database");
2666-
DATA(insertOID=3775 (pg_stat_reset_sharedPGNSPPGUID121000fffffv102278"25"_null__null__null__null_pg_stat_reset_shared_null__null__null_ ));
2666+
DATA(insertOID=3775 (pg_stat_reset_sharedPGNSPPGUID121000ffftfv102278"25"_null__null__null__null_pg_stat_reset_shared_null__null__null_ ));
26672667
DESCR("statistics: reset collected statistics shared across the cluster");
26682668
DATA(insertOID=3776 (pg_stat_reset_single_table_countersPGNSPPGUID121000fffffv102278"26"_null__null__null__null_pg_stat_reset_single_table_counters_null__null__null_ ));
26692669
DESCR("statistics: reset collected statistics for a single table or index in the current database");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp