@@ -56,7 +56,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
56
56
bool got_toast = false;
57
57
bool got_date_is_int = false;
58
58
bool got_float8_pass_by_value = false;
59
- bool got_data_checksums = false;
59
+ bool got_data_checksum_version = false;
60
60
char * lc_collate = NULL ;
61
61
char * lc_ctype = NULL ;
62
62
char * lc_monetary = NULL ;
@@ -135,8 +135,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
135
135
/* Only in <= 9.2 */
136
136
if (GET_MAJOR_VERSION (cluster -> major_version ) <= 902 )
137
137
{
138
- cluster -> controldata .data_checksums = false ;
139
- got_data_checksums = true;
138
+ cluster -> controldata .data_checksum_version = 0 ;
139
+ got_data_checksum_version = true;
140
140
}
141
141
142
142
/* we have the result of cmd in "output". so parse it line by line now */
@@ -401,7 +401,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
401
401
cluster -> controldata .float8_pass_by_value = strstr (p , "by value" ) != NULL ;
402
402
got_float8_pass_by_value = true;
403
403
}
404
- else if ((p = strstr (bufin , "checksums " )) != NULL )
404
+ else if ((p = strstr (bufin , "checksum " )) != NULL )
405
405
{
406
406
p = strchr (p , ':' );
407
407
@@ -410,8 +410,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
410
410
411
411
p ++ ; /* removing ':' char */
412
412
/* used later for contrib check */
413
- cluster -> controldata .data_checksums = strstr ( p , "enabled" ) != NULL ;
414
- got_data_checksums = true;
413
+ cluster -> controldata .data_checksum_version = str2uint ( p ) ;
414
+ got_data_checksum_version = true;
415
415
}
416
416
/* In pre-8.4 only */
417
417
else if ((p = strstr (bufin , "LC_COLLATE:" )) != NULL )
@@ -496,7 +496,7 @@ get_control_data(ClusterInfo *cluster, bool live_check)
496
496
!got_tli ||
497
497
!got_align || !got_blocksz || !got_largesz || !got_walsz ||
498
498
!got_walseg || !got_ident || !got_index || !got_toast ||
499
- !got_date_is_int || !got_float8_pass_by_value || !got_data_checksums )
499
+ !got_date_is_int || !got_float8_pass_by_value || !got_data_checksum_version )
500
500
{
501
501
pg_log (PG_REPORT ,
502
502
"The %s cluster lacks some required control information:\n" ,
@@ -556,8 +556,8 @@ get_control_data(ClusterInfo *cluster, bool live_check)
556
556
pg_log (PG_REPORT , " float8 argument passing method\n" );
557
557
558
558
/* value added in Postgres 9.3 */
559
- if (!got_data_checksums )
560
- pg_log (PG_REPORT , " data checksums \n" );
559
+ if (!got_data_checksum_version )
560
+ pg_log (PG_REPORT , " data checksum version \n" );
561
561
562
562
pg_log (PG_FATAL ,
563
563
"Cannot continue without required control information, terminating\n" );
@@ -622,10 +622,10 @@ check_control_data(ControlData *oldctrl,
622
622
}
623
623
624
624
/* We might eventually allow upgrades from checksum to no-checksum clusters. */
625
- if (oldctrl -> data_checksums != newctrl -> data_checksums )
625
+ if (oldctrl -> data_checksum_version != newctrl -> data_checksum_version )
626
626
{
627
627
pg_log (PG_FATAL ,
628
- "old and new pg_controldata checksums settings are invalid or do not match\n" );
628
+ "old and new pg_controldata checksum versions are invalid or do not match\n" );
629
629
}
630
630
}
631
631
0 commit comments