Re: BUG #17076: Server crashes on composing an error message about invalid modulus for a new table partition
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, exclusion@gmail.com,
PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-06-29T18:36:52Z
Lists: pgsql-bugs
Amit Langote <amitlangote09@gmail.com> writes: > On Tue, Jun 29, 2021 at 7:30 AM Tom Lane <tgl@sss.pgh.pa.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
Commits
-
Fix bogus logic for reporting which hash partition conflicts.
- f8b51464c265 14.0 landed
- dd2364ced985 15.0 landed