On 21.01.23 04:35, Michael Paquier wrote:
I'll read the 0003 again more carefully.  I haven't studied the new 0004
yet.

Thanks, again.  Rebased version attached.

A couple of small fixes are attached.

There is something weird in _jumbleNode(). There are two switch (nodeTag(expr)) statements. Maybe that's intentional, but then it should be commented better, because now it looks more like an editing mistake.

The handling of T_RangeTblEntry could be improved. In other contexts we have for example a custom_copy attribute, which generates the switch entry but not the function. Something like this could be useful here too.

Otherwise, this looks ok. I haven't checked whether it maintains the exact behavior from before. What is the test coverage situation for this?

For the 0004 patch, it should be documented why one would want one behavior or the other. That's totally unclear right now.

I think if we are going to accept 0004, then it might be better to combine it with 0003. Otherwise, 0004 is just undoing a lot of the code structure changes in JumbleQuery() that 0003 did.
From 0597275ef439f070b1bd32ba25ca3581cbc2af30 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Mon, 23 Jan 2023 14:16:39 +0100
Subject: [PATCH] fixup! Support for automated query jumble with all Nodes

---
 src/backend/nodes/queryjumblefuncs.c | 2 +-
 src/include/nodes/nodes.h            | 4 ++--
 src/include/nodes/primnodes.h        | 1 -
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/backend/nodes/queryjumblefuncs.c 
b/src/backend/nodes/queryjumblefuncs.c
index 278150fba0..bdb5636b1b 100644
--- a/src/backend/nodes/queryjumblefuncs.c
+++ b/src/backend/nodes/queryjumblefuncs.c
@@ -21,7 +21,7 @@
  * tree(s) generated from the query.  The executor can then use this value
  * to blame query costs on the proper queryId.
  *
- * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index 6ecd944a90..e7f92df7cb 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -59,12 +59,12 @@ typedef enum NodeTag
  *
  * - no_copy_equal: Shorthand for both no_copy and no_equal.
  *
- * - no_query_jumble: Does not support jumble() at all.
+ * - no_query_jumble: Does not support JumbleQuery() at all.
  *
  * - no_read: Does not support nodeRead() at all.
  *
  * - nodetag_only: Does not support copyObject(), equal(), outNode(),
- *   or nodeRead().
+ *   or nodeRead(). XXX
  *
  * - special_read_write: Has special treatment in outNode() and nodeRead().
  *
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h
index f81518c2fd..9ea819a6a7 100644
--- a/src/include/nodes/primnodes.h
+++ b/src/include/nodes/primnodes.h
@@ -799,7 +799,6 @@ typedef OpExpr NullIfExpr;
  * filled in right away, so will be ignored for equality if they are not set
  * yet.
  *
- *
  * OID entries of the internal function types are irrelevant for the query
  * jumbling, but the operator OID and the arguments are.
  */
-- 
2.39.1

Reply via email to