Re: latest plperl

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: latest plperl
Дата
Msg-id 40E3A776.8020203@joeconway.com
обсуждение исходный текст
Ответ на latest plperl  ("Andrew Dunstan" <andrew@dunslane.net>)
Ответы Re: latest plperl
Список pgsql-patches
Andrew Dunstan wrote:
> The attached patch (and 2 new files incorporating previous eloglvl.[ch]  as
> before) has the following changes over previously sent patch
> (fixes all by me):

Some comments below:

--------------------
In plperl_trigger_build_args(), this looks bogus:

+     char       *tmp;
+
+     tmp = (char *) malloc(sizeof(int));
...
+     sprintf(tmp, "%d", tdata->tg_trigger->tgnargs);
+     sv_catpvf(rv, ", argc => %s", tmp);
...
+     free(tmp);

I changed it to:

+     sv_catpvf(rv, ", argc => %d", tdata->tg_trigger->tgnargs);


--------------------
In this section, it appears that empty strings in the tuple will be
coerced into NULL values:

+         plval = plperl_get_elem(hvNew, platt);

+         if (plval)
+         {
+             src = plval;
+             if (strlen(plval))
+             {
+                 modvalues[j] = FunctionCall3(&finfo,
+                       CStringGetDatum(src),
+                       ObjectIdGetDatum(typelem),
+                       Int32GetDatum(tupdesc->attrs[atti]->atttypmod));
+                 modnulls[j] = ' ';
+             }
+             else
+             {
+                 modvalues[i] = (Datum) 0;
+                 modnulls[j] = 'n';
+             }
+         }
+         plval = NULL;

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';
+         }

Joe

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

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: latest plperl
Следующее
От: Tom Lane
Дата:
Сообщение: Re: contrib/dbmirror