Re: [PATCH] Add pretty-printed XML output option

Поиск
Список
Период
Сортировка
От Jim Jones
Тема Re: [PATCH] Add pretty-printed XML output option
Дата
Msg-id b43a6aff-cf96-4146-8816-32f9042efd71@uni-muenster.de
обсуждение исходный текст
Ответ на Re: [PATCH] Add pretty-printed XML output option  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 22.05.25 17:00, Tom Lane wrote:
> Yeah, after sleeping on it I fear that leaving xml_parse entirely
> alone will just be a recipe for future copy-and-paste errors.
That's exactly my concern as well.
> The Assert solution seems like the way to go, approximately
>
>             xmlNodePtr    root;
> +           xmlNodePtr    oldroot PG_USED_FOR_ASSERTS_ONLY;
>
> ...
>             /* This attaches root to doc, so we need not free it separately. */
> -           xmlDocSetRootElement(doc, root);
> +           oldroot = xmlDocSetRootElement(doc, root);
> +           /* ... and there can't yet be any old root to clean up. */
> +           Assert(oldroot == NULL);
>
> I'll make it so.

+1

Thanks!

Best regards, Jim





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