Re: forgotten initalization of a variable

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: forgotten initalization of a variable
Date: 2020-04-21 08:34:26
Message-ID: 20200421083426.GB33034@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 21, 2020 at 03:08:30PM +0900, Kyotaro Horiguchi wrote:
> The commit a7e8ece41c adds a new member restoreCommand to
> XLogPageReadPrivate. readOneRecord doesn't make use of it but forgets
> to set NULL. That can lead to illegal pointer access.

That's an oversight of the original commit. Now, instead of failing
even if there is a restore command, wouldn't it be better to pass down
the restore_command to readOneRecord() so as we can optionally
improve the stability of a single record lookup? This only applies to
a checkpoint record now, but this routine could be called elsewhere in
the future. Please see the attached.
--
Michael

Attachment Content-Type Size
pgrewind-restore-fix-v2.patch text/x-diff 1.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andy Fan 2020-04-21 08:37:25 Re: WIP: Aggregation push-down
Previous Message Kyotaro Horiguchi 2020-04-21 08:15:31 Re: Remove non-fast promotion Re: Should we remove a fallback promotion? take 2