public inbox for [email protected]  
help / color / mirror / Atom feed
From: =?gb18030?B?emVuZ21hbg==?= <[email protected]>
To: =?gb18030?B?UGF2ZWwgU3RlaHVsZQ==?= <[email protected]>
Cc: =?gb18030?B?cGdzcWwtaGFja2Vycw==?= <[email protected]>
Subject: Re: Inline non-SQL SRFs using SupportRequestSimplify
Date: Sat, 20 Dec 2025 18:53:17 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFj8pRAF1FjKE=OezxxtmLm6Tc3b+zEzBCQZqLLxdgw5Op-uPw@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CA+renyXxanvX8rnrqTNkZt1r9=rm59MHSG4DDVfsV2aUGe3dUQ@mail.gmail.com>
	<[email protected]>
	<CAFj8pRAH17WO_d9nUWAsV8MXVAVC18Jmn7f+KxGfakEHFY33Xg@mail.gmail.com>
	<[email protected]>
	<CAFj8pRAF1FjKE=OezxxtmLm6Tc3b+zEzBCQZqLLxdgw5Op-uPw@mail.gmail.com>

I share this opinion. In fact, in the existing tests, if test_inline_in_from_support_func is triggered, 
the input parameters are necessarily of type TEXT—so there’s no need for an additional type check.

How about changing it to the following?
```
diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c
index b7a926c6f01..adb8b9793ba 100644
--- a/src/test/regress/regress.c
+++ b/src/test/regress/regress.c
@@ -849,9 +849,9 @@ test_inline_in_from_support_func(PG_FUNCTION_ARGS)
                }
 
                c = (Const *) node;
-               if (c->consttype != TEXTOID || c->constisnull)
+               if (c->constisnull)
                {
-                       ereport(WARNING, (errmsg("test_inline_in_from_support_func called with non-TEXT parameters")));
+                       ereport(WARNING, (errmsg("test_inline_in_from_support_func called with null parameter for colname")));
                        PG_RETURN_POINTER(NULL);
                }
                colname = TextDatumGetCString(c->constvalue);
@@ -865,9 +865,9 @@ test_inline_in_from_support_func(PG_FUNCTION_ARGS)
                }
 
                c = (Const *) node;
-               if (c->consttype != TEXTOID || c->constisnull)
+               if (c->constisnull)
                {
-                       ereport(WARNING, (errmsg("test_inline_in_from_support_func called with non-TEXT parameters")));
+                       ereport(WARNING, (errmsg("test_inline_in_from_support_func called with null parameter for tablename")));
                        PG_RETURN_POINTER(NULL);
                }
                tablename = TextDatumGetCString(c->constvalue);
```

Regards
Man Zeng

view thread (19+ messages)  latest in thread

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Inline non-SQL SRFs using SupportRequestSimplify
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox