Re: BUG #17076: Server crashes on composing an error message about invalid modulus for a new table partition

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, exclusion(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17076: Server crashes on composing an error message about invalid modulus for a new table partition
Date: 2021-06-29 18:36:52
Message-ID: 485564.1624991812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Amit Langote <amitlangote09(at)gmail(dot)com> writes:
> On Tue, Jun 29, 2021 at 7:30 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I think the patch has got more problems than that too, as it's far
>>> from clear why the next remainder would have anything to do with the
>>> next larger modulus.

> Yes. Though, I think the problem is that the code uses
> boundinfo->indexes[<offset>] as an index into partdesc->oids[] array
> to get the existing partition to show in the error message. The
> correct thing here would be to use <offset> directly. That is because
> the hash partition bounds as laid out in boudinfo->datums[] correspond
> one-to-one with the partition OIDs laid out in partdesc->oids[].

Got it. Pushed your fix, along with some twiddling of the nearby
comments which seemed a bit vague.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Korotkov 2021-06-29 20:22:27 Re: BUG #17066: Cache lookup failed when null (unknown) is passed as anycompatiblemultirange
Previous Message Amit Langote 2021-06-29 07:11:51 Re: BUG #17076: Server crashes on composing an error message about invalid modulus for a new table partition