Fix field order in struct catcache.
authorTom Lane <[email protected]>
Thu, 12 Jan 2017 23:59:46 +0000 (18:59 -0500)
committerTom Lane <[email protected]>
Thu, 12 Jan 2017 23:59:57 +0000 (18:59 -0500)
Somebody failed to grasp the point of having the #ifdef CATCACHE_STATS
fields at the end of the struct.  Put that back the way it should be,
and add a comment making it more explicit why it should be that way.

src/include/utils/catcache.h

index 2cee8b85f59b8db4ee00ce3bf63b5ef6d35379a8..299d246585184dee8998946cc0e04f0bb022dfa2 100644 (file)
@@ -52,6 +52,12 @@ typedef struct catcache
                                                 * heap scans */
    bool        cc_isname[CATCACHE_MAXKEYS];    /* flag "name" key columns */
    dlist_head  cc_lists;       /* list of CatCList structs */
+   dlist_head *cc_bucket;      /* hash buckets */
+
+   /*
+    * Keep these at the end, so that compiling catcache.c with CATCACHE_STATS
+    * doesn't break ABI for other modules
+    */
 #ifdef CATCACHE_STATS
    long        cc_searches;    /* total # searches against this cache */
    long        cc_hits;        /* # of matches against existing entry */
@@ -66,7 +72,6 @@ typedef struct catcache
    long        cc_lsearches;   /* total # list-searches */
    long        cc_lhits;       /* # of matches against existing lists */
 #endif
-   dlist_head *cc_bucket;      /* hash buckets */
 } CatCache;