custom-stats-const.patch
text/x-diff
Filename: custom-stats-const.patch
Type: text/x-diff
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/include/utils/pgstat_internal.h | 1 | 1 |
| src/test/modules/test_custom_stats/test_custom_var_stats.c | 4 | 3 |
diff --git a/src/include/utils/pgstat_internal.h b/src/include/utils/pgstat_internal.h
index 5c1ce4d3d6af..01db3b701bdf 100644
--- a/src/include/utils/pgstat_internal.h
+++ b/src/include/utils/pgstat_internal.h
@@ -335,7 +335,7 @@ typedef struct PgStat_KindInfo
const PgStatShared_Common *header,
FILE *statfile);
bool (*from_serialized_data) (const PgStat_HashKey *key,
- const PgStatShared_Common *header,
+ PgStatShared_Common *header,
FILE *statfile);
/*
diff --git a/src/test/modules/test_custom_stats/test_custom_var_stats.c b/src/test/modules/test_custom_stats/test_custom_var_stats.c
index c71922dc4a8f..3dea38e3fe83 100644
--- a/src/test/modules/test_custom_stats/test_custom_var_stats.c
+++ b/src/test/modules/test_custom_stats/test_custom_var_stats.c
@@ -92,7 +92,7 @@ static void test_custom_stats_var_to_serialized_data(const PgStat_HashKey *key,
/* Deserialization callback: read auxiliary entry data */
static bool test_custom_stats_var_from_serialized_data(const PgStat_HashKey *key,
- const PgStatShared_Common *header,
+ PgStatShared_Common *header,
FILE *statfile);
/* Finish callback: end of statistics file operations */
@@ -196,9 +196,10 @@ test_custom_stats_var_to_serialized_data(const PgStat_HashKey *key,
{
char *description;
size_t len;
- PgStatShared_CustomVarEntry *entry = (PgStatShared_CustomVarEntry *) header;
bool found;
uint32 magic_number = TEST_CUSTOM_VAR_MAGIC_NUMBER;
+ const PgStatShared_CustomVarEntry *entry =
+ (const PgStatShared_CustomVarEntry *) header;
/*
* First mark the main file with a magic number, keeping a trace that some
@@ -276,7 +277,7 @@ test_custom_stats_var_to_serialized_data(const PgStat_HashKey *key,
*/
static bool
test_custom_stats_var_from_serialized_data(const PgStat_HashKey *key,
- const PgStatShared_Common *header,
+ PgStatShared_Common *header,
FILE *statfile)
{
PgStatShared_CustomVarEntry *entry;