BUG #16171: Potential malformed JSON in explain output

Поиск
Список
Период
Сортировка
От PG Bug reporting form
Тема BUG #16171: Potential malformed JSON in explain output
Дата
Msg-id 16171-b72259ab75505fa2@postgresql.org
обсуждение исходный текст
Ответы Re: BUG #16171: Potential malformed JSON in explain output  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16171
Logged by:          Mahadevan Ramachandran
Email address:      mahadevan@rapidloop.com
PostgreSQL version: 12.1
Operating system:   any
Description:

Refer src/backend/commands/explain.c, version 12.1.

When a plan node has children, the function ExplainNode starts a JSON array
with the key "Plans" (line 1955), like so:

    "Plans": [ 

with the intention of creating an array of "Plan" objects, one for each
child:

    "Plans": [
        { .. a child plan goes here ..},
        { .. a child plan goes here ..}
    ]

However, if the node (the current, parent one) is of a certain type (see
switch at line 1975), then ExplainMemberNodes is called, which does this
(lines 3335-6):

    if (nsubnodes < nplans)
        ExplainPropertyInteger("Subplans Removed", NULL, nplans - nsubnodes,
es);

This can potentially cause a malformed JSON output like this:

    "Plans": [
        { .. a child plan goes here ..},
        "Subplans Removed": 5,
        { .. a child plan goes here ..}
    ]

I don't have a sample explain output that exhibits this error, this was
found while reviewing the code.


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: A row-level trigger on a partitioned table is not created on asub-partition created later
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Fwd: weird long time query