Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ff49430

Browse files
committed
Fix datatype for number of heap tuples during last cleanup
It appears that new fields introduced in 857f9c3 have inconsistent datatypes: BTMetaPageData.btm_last_cleanup_num_heap_tuples is of float4 type, while xl_btree_metadata.last_cleanup_num_heap_tuples is of double type. IndexVacuumInfo.num_heap_tuples, which is a source of values for both former fields is of double type. So, make both those fields in BTMetaPageData and xl_btree_metadata use float8 type in order to match the precision of the source. That shouldn't be double type, because we always use types with explicit width in WAL. Patch introduces incompatibility of on-disk format since 857f9c3 commit, but that versions never was released, so just bump catalog version to avoid possible confusion. Author: Alexander Korortkov
1 parent f97f0c9 commit ff49430

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/include/access/nbtree.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ typedef struct BTMetaPageData
105105
/* following fields are available since page version 3 */
106106
TransactionId btm_oldest_btpo_xact; /* oldest btpo_xact among of
107107
* deleted pages */
108-
float4 btm_last_cleanup_num_heap_tuples; /* number of heap tuples
108+
float8 btm_last_cleanup_num_heap_tuples; /* number of heap tuples
109109
* during last cleanup */
110110
} BTMetaPageData;
111111

src/include/access/nbtxlog.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ typedef struct xl_btree_metadata
5252
BlockNumber fastroot;
5353
uint32 fastlevel;
5454
TransactionId oldest_btpo_xact;
55-
double last_cleanup_num_heap_tuples;
55+
float8 last_cleanup_num_heap_tuples;
5656
} xl_btree_metadata;
5757

5858
/*

src/include/catalog/catversion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 201804091
56+
#define CATALOG_VERSION_NO 201804191
5757

5858
#endif

0 commit comments

Comments
 (0)