Re: Crash in BRIN minmax-multi indexes

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Crash in BRIN minmax-multi indexes
Date: 2021-03-31 23:10:36
Message-ID: c1a363f8-da2e-6a50-85e4-d10c929c8db2@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4/1/21 12:53 AM, Zhihong Yu wrote:
> Hi,
> For inet data type fix:
>
> +       unsigned char a = addra[i];
> +       unsigned char b = addrb[i];
> +
> +       if (i >= lena)
> +           a = 0;
> +
> +       if (i >= lenb)
> +           b = 0;
>
> Should the length check precede the addra[i] ?
> Something like:
>
>        unsigned char a;
>        if (i >= lena) a = 0;
>        else a = addra[i];
>

I don't think that makes any difference. We know the bytes are there, we
just want to ignore / reset them in some cases.

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jaime Casanova 2021-03-31 23:19:47 Re: Crash in BRIN minmax-multi indexes
Previous Message Zhihong Yu 2021-03-31 22:53:45 Re: Crash in BRIN minmax-multi indexes