Re: BUG #2948: default null values for not-null domains

Поиск
Список
Период
Сортировка
От Sergiy Vyshnevetskiy
Тема Re: BUG #2948: default null values for not-null domains
Дата
Msg-id Pine.LNX.4.64.0702012234230.22446@uanet.vostok.net
обсуждение исходный текст
Ответ на Re: BUG #2948: default null values for not-null domains  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Thu, 1 Feb 2007, Tom Lane wrote:

> Sergiy Vyshnevetskiy <serg@vostok.net> writes:
>> If input function IS strict then nulls are ALWAYS accepted.
>> If input function IS NOT strict then nulls MIGHT be rejectted.
>> And the patch is much more simple now (attached).
>> Is that it?
>
> Almost right.  exec_assign_value() thinks its isNull argument is the
> null flag for the *source* value (not sure why it's pass by reference).

Because the value may change during type cast. From null to non-null too.
Or vice-versa. I'll try it later.

> As you set it up, var->isnull would be aliased by *isNull, which might
> manage to break things within that function if the code were ever
> rearranged.
>
> Also, some comments are usually a good idea (if the purpose were
> obvious, it'd have been right the first time, no?),

I will, when I'm sure what I'm doing. For now it's mostly "mokey see -
monkey do".

> and you always need to check the regression tests --- it turns out that
> the wrong behavior was actually being exposed by the tests.

Hmm? Oh, yeah, I /heard/ something about them ... I think. :)

> Patch as-applied is attached.

Excellent. Thanks.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2954: null is not checked against domain constraints in return clause
Следующее
От: "Jessica"
Дата:
Сообщение: BUG #2952: where is the user guide