Re: simplifying foreign key/RI checks

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: simplifying foreign key/RI checks
Дата
Msg-id CA+HiwqHmZ9RpxVNg9M7ktzF1i6unGVpeBLqortEjW6NVtm+GvQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: simplifying foreign key/RI checks  (Zhihong Yu <zyu@yugabyte.com>)
Список pgsql-hackers
On Tue, Jan 19, 2021 at 12:00 PM Zhihong Yu <zyu@yugabyte.com> wrote:
> +               if (mapped_partkey_attnums[i] == pk_attnums[j])
> +               {
> +                   partkey_vals[i] = pk_vals[j];
> +                   partkey_isnull[i] = pk_nulls[j] == 'n' ? true : false;
> +                   i++;
> +                   break;
>
> The way counter (i) is incremented is out of my expectation.
> In the rare case, where some i doesn't have corresponding pk_attnums[j], wouldn't there be a dead loop ?
>
> I think the goal of adding the assertion should be not loop infinitely even if the invariant is not satisfied.
>
> I guess a counter other than i would be better for this purpose.

I have done that in v3.  Thanks.

-- 
Amit Langote
EDB: http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: simplifying foreign key/RI checks
Следующее
От: yuzuko
Дата:
Сообщение: Re: Release SPI plans for referential integrity with DISCARD ALL