Cleanup useless assignments and checks
authorMichael Paquier <[email protected]>
Tue, 4 Oct 2022 04:16:23 +0000 (13:16 +0900)
committerMichael Paquier <[email protected]>
Tue, 4 Oct 2022 04:16:23 +0000 (13:16 +0900)
This cleans up a couple of areas:
- Remove XLogSegNo calculation for the last WAL segment in backup in
xlog.c (7d70809 has moved this logic entirely to xlogbackup.c when
building the contents of the backup history file).
- Remove check on log_min_duration in analyze.c, as it is already true
where this code path is reached.
- Simplify call to find_option() in guc.c.

Author: Ranier Vilela
Reviewed-by: Masahiko Sawada
Discussion: https://postgr.es/m/CAEudQArCDQQiPiFR16=yu9k5s2tp4tgEe1U1ZbkW4ofx81AWWQ@mail.gmail.com

src/backend/access/transam/xlog.c
src/backend/commands/analyze.c
src/backend/utils/misc/guc.c

index 8e15256db845853a5b2163f75e7c834f50fd5b17..27085b15a83e7bf2f6740612282e14b02216b2e6 100644 (file)
@@ -8733,7 +8733,6 @@ do_pg_backup_stop(BackupState *state, bool waitforarchive)
         */
        RequestXLogSwitch(false);
 
-       XLByteToPrevSeg(state->stoppoint, _logSegNo, wal_segment_size);
        state->stoptime = (pg_time_t) time(NULL);
 
        /*
index a7966fff83929c56fd06d26889103bfe259a83c0..ff1354812bdd4e237b2cc3be026427f349be4002 100644 (file)
@@ -360,8 +360,7 @@ do_analyze_rel(Relation onerel, VacuumParams *params,
        }
 
        pg_rusage_init(&ru0);
-       if (params->log_min_duration >= 0)
-           starttime = GetCurrentTimestamp();
+       starttime = GetCurrentTimestamp();
    }
 
    /*
index ff082fc3d95e295b85b160523ad8f3d545c63a47..013576603598bc2e017d3c62456505bbbb59113d 100644 (file)
@@ -5262,12 +5262,10 @@ read_nondefault_variables(void)
 
    for (;;)
    {
-       struct config_generic *record;
-
        if ((varname = read_string_with_null(fp)) == NULL)
            break;
 
-       if ((record = find_option(varname, true, false, FATAL)) == NULL)
+       if (find_option(varname, true, false, FATAL) == NULL)
            elog(FATAL, "failed to locate variable \"%s\" in exec config params file", varname);
 
        if ((varvalue = read_string_with_null(fp)) == NULL)