Re: Inline non-SQL SRFs using SupportRequestSimplify

Поиск
Список
Период
Сортировка
От zengman
Тема Re: Inline non-SQL SRFs using SupportRequestSimplify
Дата
Msg-id tencent_55B48B8D5D156361159F0F8E@qq.com
обсуждение исходный текст
Ответ на Re: Inline non-SQL SRFs using SupportRequestSimplify  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Inline non-SQL SRFs using SupportRequestSimplify
Список pgsql-hackers
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

В списке pgsql-hackers по дате отправления: