From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Cc: Drouvot, Bertrand <bdrouvot@amazon.com>
Subject: Re: Generating code for query jumbling through gen_node_support.pl
Date: Mon, 23 Jan 2023 14:27:13 +0100
Message-ID: <bf604c8d-b6e9-284b-327a-cac8417a74e8@enterprisedb.com> (raw)
In-Reply-To: <Y8tdmPlzFyNcrPR3@paquier.xyz>
References: <34491a4e-2664-6ea7-662c-b13d18d2a92d@enterprisedb.com>
<Y8EOUuViEL8Ewvf/@paquier.xyz>
<d74d2681-5c07-2f6e-d177-995905015311@enterprisedb.com>
<Y8YakMwx2a6Y63oR@paquier.xyz>
<e4801c28-cb5b-3b81-bda1-03af8df1fef9@enterprisedb.com>
<Y8ZTvD6nEqNttAHJ@paquier.xyz>
<Y8eZ9/3STyhF57RV@paquier.xyz>
<50b571dc-e0c0-22be-9803-4a3480d2e792@enterprisedb.com>
<Y8oaA5Vxnr4rzEDJ@paquier.xyz>
<e4d61d52-4992-d190-b5ad-48c6c752942c@enterprisedb.com>
<Y8tdmPlzFyNcrPR3@paquier.xyz>
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.
Attachments:0001-fixup-Support-for-automated-query-jumble-with-all-No.patch (text/plain, 2.1K) download
From 0597275ef439f070b1bd32ba25ca3581cbc2af30 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@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.cindex 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.hindex 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.hindex 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 instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@enterprisedb.com, michael@paquier.xyz, pgsql-hackers@lists.postgresql.org, bdrouvot@amazon.com
Subject: Re: Generating code for query jumbling through gen_node_support.pl
In-Reply-To: <bf604c8d-b6e9-284b-327a-cac8417a74e8@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox