Re: BUG #19049: Assert failure when using skip arrays on an index key with DESC order - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #19049: Assert failure when using skip arrays on an index key with DESC order
Date
Msg-id 1788650.1757605785@sss.pgh.pa.us
Whole thread Raw
In response to BUG #19049: Assert failure when using skip arrays on an index key with DESC order  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #19049: Assert failure when using skip arrays on an index key with DESC order
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> -- This query crashes with an Assert
>  select distinct on(s0, s1) * from mv where t2 >= -1 and t1 < 10 order by
> s0, s1, t1 desc, t2 desc;

> Assert is:
>                 if (ScanDirectionIsForward(dir) && array->low_compare)
> Assert(DatumGetBool(FunctionCall2Coll(&array->low_compare->sk_func,
> array->low_compare->sk_collation, tupdatum, array->low_compare->sk_argument)));

Indeed.  "git bisect" says this started at

b3f1a13f22f9e28842ee5fbd08b7ec805e27aaac is the first bad commit
commit b3f1a13f22f9e28842ee5fbd08b7ec805e27aaac
Author: Peter Geoghegan <pg@bowt.ie>
Date:   Fri Apr 4 14:14:08 2025 -0400

    Avoid extra index searches through preprocessing.

Peter, you want to take a look?

            regards, tom lane



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #19050: psql: could not find digest for NID UNDEF
Next
From: Peter Geoghegan
Date:
Subject: Re: BUG #19049: Assert failure when using skip arrays on an index key with DESC order