Re: remaining sql/json patches

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Erik Rijkers <er(at)xs4all(dot)nl>, jian he <jian(dot)universality(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: remaining sql/json patches
Date: 2024-01-18 11:46:24
Message-ID: 202401181146.fuoeskfzriq7@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've been eyeballing the coverage report generated after applying all
patches (but I only checked the code added by the 0008 patch). AFAICS
the coverage is pretty good. Some uncovered paths:

commands/explain.c (Hmm, I think this is a preexisting bug actually)

3893 18 : case T_TableFuncScan:
3894 18 : Assert(rte->rtekind == RTE_TABLEFUNC);
3895 18 : if (rte->tablefunc)
3896 0 : if (rte->tablefunc->functype == TFT_XMLTABLE)
3897 0 : objectname = "xmltable";
3898 : else /* Must be TFT_JSON_TABLE */
3899 0 : objectname = "json_table";
3900 : else
3901 18 : objectname = NULL;
3902 18 : objecttag = "Table Function Name";
3903 18 : break;

parser/gram.y:

16940 : json_table_plan_cross:
16941 : json_table_plan_primary CROSS json_table_plan_primary
16942 39 : { $$ = makeJsonTableJoinedPlan(JSTPJ_CROSS, $1, $3, @1); }
16943 : | json_table_plan_cross CROSS json_table_plan_primary
16944 0 : { $$ = makeJsonTableJoinedPlan(JSTPJ_CROSS, $1, $3, @1); }
Not really sure how critical this one is TBH.

utils/adt/jsonpath_exec.c:

3492 : /* Recursively reset scan and its child nodes */
3493 : static void
3494 120 : JsonTableRescanRecursive(JsonTablePlanState * state)
3495 : {
3496 120 : if (state->type == JSON_TABLE_JOIN_STATE)
3497 : {
3498 0 : JsonTableJoinState *join = (JsonTableJoinState *) state;
3499 :
3500 0 : JsonTableRescanRecursive(join->left);
3501 0 : JsonTableRescanRecursive(join->right);
3502 0 : join->advanceRight = false;
3503 : }

I think this one had better be covered.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"The saddest aspect of life right now is that science gathers knowledge faster
than society gathers wisdom." (Isaac Asimov)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2024-01-18 11:58:05 Re: Report planning memory in EXPLAIN ANALYZE
Previous Message Bharath Rupireddy 2024-01-18 11:29:39 Re: Fix race condition in InvalidatePossiblyObsoleteSlot()