Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Proper init of the local variables, when loading data from the file.

  • Loading branch information...
commit 7399311059834066cf95037c175393ad9f94aaeb 1 parent c2c19e6
@tvondra authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 queryhist.c
View
10 queryhist.c
@@ -427,6 +427,16 @@ void histogram_load_from_file(void) {
if (memcmp(hash_file, hash_comp, 16) == 0) {
memcpy(shared_histogram_info, buffer, sizeof(histogram_info_t));
+
+ /* FIXME Is this necessary? */
+ shared_histogram_info->lock = LWLockAssign();
+
+ /* copy the values from the histogram */
+ default_histogram_type = shared_histogram_info->type;
+ default_histogram_bins = shared_histogram_info->bins;
+ default_histogram_step = shared_histogram_info->step;
+ default_histogram_sample_pct = shared_histogram_info->sample_pct;
+
elog(DEBUG1, "successfully loaded query histogram from a file : %s",
HISTOGRAM_DUMP_FILE);
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.