Re: BUG #15668: Server crash in transformPartitionRangeBounds - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: BUG #15668: Server crash in transformPartitionRangeBounds
Date
Msg-id 20190326011532.GL2558@paquier.xyz
Whole thread Raw
In response to Re: BUG #15668: Server crash in transformPartitionRangeBounds  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: BUG #15668: Server crash in transformPartitionRangeBounds  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Re: BUG #15668: Server crash in transformPartitionRangeBounds  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-bugs
On Fri, Mar 22, 2019 at 02:49:42PM +0900, Amit Langote wrote:
> This comment sounds a bit misleading.  The code above this "did" find
> field names, but there were too many.  What this comment should mention is
> that parsing didn't return a single field name, which is the format that
> the code below this can do something useful with.  I had proposed that
> upthread, but maybe that feedback got lost in the discussion about other
> related issues.

True.  I was reviewing that stuff yesterday and I have not been able
to finish wrapping it.

> +CREATE TABLE part_bogus_expr_fail PARTITION OF range_parted
> +  FOR VALUES FROM (sum(a)) TO ('2019-01-01');
> +ERROR:  function sum(date) does not exist
> +LINE 2:   FOR VALUES FROM (sum(a)) TO ('2019-01-01');
>
> Maybe, we should add to this patch only the tests relevant to the cases
> that would lead to crash without this patch.

Done as you suggested, with a minimal set enough to trigger the crash,
still the error message is rather misleading as you would expect :)

> A separate thread will definitely attract more attention, at least in due
> time. :)

Sure.  For now I have committed a lighter version of 0001, with
tweaked comments based on your suggestion, as well as a minimum set of
test cases.  I have added on the way some tests for range partitions
which have been missing from the start, and improved the existing set
by removing the original "a.a" references, and switching to use
max(date) for range partitions to bump correctly on the aggregate
error.  I am just updating the second patch now and I'll begin a new
thread soon.
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: Thomas Munro
Date:
Subject: Re: parallel query hangs - impossible to cancel
Next
From: Amit Langote
Date:
Subject: Re: BUG #15668: Server crash in transformPartitionRangeBounds