Refine query jumbling handling for CallStmt
authorMichael Paquier <michael@paquier.xyz>
Wed, 8 Mar 2023 05:38:35 +0000 (14:38 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 8 Mar 2023 05:38:35 +0000 (14:38 +0900)
Previously, all the nodes of CallStmt were included in the jumbling,
causing a duplicate in the computation as the transformed state of the
CALL query was included as well as the parsed state (transformed
FuncCall with all the input arguments and potential output arguments).

Reviewed-by: Bertrand Drouvot
Discussion: https://postgr.es/m/Y+MRdEq9W9XVa2AB@paquier.xyz

src/include/nodes/parsenodes.h

index f7d7f10f7dc57270acb898c5c70cc1ef37b702ee..259e8142538d8042ae70bfda4db3f8059bf8aedb 100644 (file)
@@ -3221,14 +3221,18 @@ typedef struct InlineCodeBlock
  * list contains copies of the expressions for all output arguments, in the
  * order of the procedure's declared arguments.  (outargs is never evaluated,
  * but is useful to the caller as a reference for what to assign to.)
+ * The transformed call state is not relevant in the query jumbling, only the
+ * function call is.
  * ----------------------
  */
 typedef struct CallStmt
 {
        NodeTag         type;
        FuncCall   *funccall;           /* from the parser */
-       FuncExpr   *funcexpr;           /* transformed call, with only input args */
-       List       *outargs;            /* transformed output-argument expressions */
+       /* transformed call, with only input args */
+       FuncExpr   *funcexpr pg_node_attr(query_jumble_ignore);
+       /* transformed output-argument expressions */
+       List       *outargs pg_node_attr(query_jumble_ignore);
 } CallStmt;
 
 typedef struct CallContext