Re: latest plperl

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: latest plperl
Дата
Msg-id 40E436A0.5040207@joeconway.com
обсуждение исходный текст
Ответ на Re: latest plperl  ("Andrew Dunstan" <andrew@dunslane.net>)
Список pgsql-patches
Andrew Dunstan wrote:
> Doh! Very bogus! sizeof(int)and a malloc to boot ???
>
> I didn't check the trigger code much because it has supposedly been working
> for quite a while. I will examine more closely.

Well, essentially 4 bytes (sizeof(int)) were being allocated to print a
two byte interger that can never be greater than two characters ("32"),
so I don't expect it would have ever failed, but only by serendipity.

>>Shouldn't that look more like this?
>>
>>+         plval = plperl_get_elem(hvNew, platt);
>>
>>+         if (plval)
>>+         {
>>+             modvalues[j] = FunctionCall3(&finfo,
>>+                   CStringGetDatum(plval),
>>+                   ObjectIdGetDatum(typelem),
>>+                   Int32GetDatum(tupdesc->attrs[atti]->atttypmod)); +
>>           modnulls[j] = ' ';
>>+         }
>>+         else
>>+         {
>>+             modvalues[i] = (Datum) 0;
>>+             modnulls[j] = 'n';
>>+         }
>>
>
> Yes, except that that [i] looks wrong too. Surely it should be [j]. And with
> this change decl of src appears redundant.

Hmmm, I missed that -- looks wrong to me too. I'll check it out.

> I will do some checking on these changes, but with those caveats they look
> good to me.
>
> Do you need a revised patch?

Nah, I'll make the changes and post a revised patch for you to comment
on prior to committing.

Joe

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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: [Plperlng-devel] Re: latest plperl
Следующее
От: Tom Lane
Дата:
Сообщение: Re: latest plperl