From 4bfe36ac6066807d4645d35e6469beddd63d2139 Mon Sep 17 00:00:00 2001 From: ashnah Date: Fri, 7 Jan 2022 11:44:50 +0800 Subject: [PATCH 1/2] fix problem: pg_proc.provariadic is invalid after initdb --- src/common/backend/utils/cache/catcache.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/backend/utils/cache/catcache.cpp b/src/common/backend/utils/cache/catcache.cpp index 221a3269da..c5f9ce4bfe 100644 --- a/src/common/backend/utils/cache/catcache.cpp +++ b/src/common/backend/utils/cache/catcache.cpp @@ -1883,6 +1883,11 @@ HeapTuple CreateHeapTuple4BuiltinFunc(const Builtin_func* func, TupleDesc desc) } } + if (IsBootstrapProcessingMode()) + { + variadicType = func->provariadic; + } + /* construct the spcified struct */ parameterTypes = buildoidvector(func->proargtypes.values, func->proargtypes.count); defargpos = buildint2vector(func->prodefaultargpos->values, func->prodefaultargpos->count); -- Gitee From 76baad7594ecab4aa94ce53ffc8cf355f08c421e Mon Sep 17 00:00:00 2001 From: ashnah Date: Fri, 7 Jan 2022 12:47:43 +0800 Subject: [PATCH 2/2] fix regress expected --- src/test/regress/expected/json_and_jsonb.out | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/regress/expected/json_and_jsonb.out b/src/test/regress/expected/json_and_jsonb.out index b027969d8c..32dd3718b4 100644 --- a/src/test/regress/expected/json_and_jsonb.out +++ b/src/test/regress/expected/json_and_jsonb.out @@ -24,14 +24,14 @@ select oid,* from pg_proc where proname like '%json%' order by oid; 3155 | row_to_json | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | s | 1 | 0 | 114 | 2249 | | | | | row_to_json | | | | | f | | f | f | | 0 | f | | 3156 | row_to_json | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | s | 2 | 0 | 114 | 2249 16 | | | | | row_to_json_pretty | | | | | f | | f | f | | 0 | f | | 3238 | json_build_array | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | f | f | i | 0 | 0 | 114 | | | | | | json_build_array_noargs | | | | | f | f | f | f | | 0 | f | | - 3239 | json_build_array | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | f | f | i | 1 | 0 | 114 | 2276 | {2276} | {v} | | | json_build_array | | | | | f | f | f | f | | 0 | f | | + 3239 | json_build_array | 11 | 10 | 12 | 1 | 0 | 2276 | - | f | f | f | f | f | f | i | 1 | 0 | 114 | 2276 | {2276} | {v} | | | json_build_array | | | | | f | f | f | f | | 0 | f | | 3258 | json_each | 11 | 10 | 12 | 1 | 100 | 0 | - | f | f | f | f | t | t | i | 1 | 0 | 2249 | 114 | {114,25,114} | {i,o,o} | {from_json,key,value} | | json_each | | | | | f | f | f | f | | 0 | f | | 3259 | json_each_text | 11 | 10 | 12 | 1 | 100 | 0 | - | f | f | f | f | t | t | i | 1 | 0 | 2249 | 114 | {114,25,25} | {i,o,o} | {from_json,key,value} | | json_each_text | | | | | f | f | f | f | | 0 | f | | 3260 | json_build_object | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | f | f | i | 0 | 0 | 114 | | | | | | json_build_object_noargs | | | | | f | f | f | f | | 0 | f | | - 3261 | json_build_object | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | f | f | i | 1 | 0 | 114 | 2276 | {2276} | {v} | | | json_build_object | | | | | f | f | f | f | | 0 | f | | - 3262 | json_extract_path | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 114 | 114 1009 | {114,1009} | {i,v} | | | json_extract_path | | | | | f | f | f | f | | 0 | f | | + 3261 | json_build_object | 11 | 10 | 12 | 1 | 0 | 2276 | - | f | f | f | f | f | f | i | 1 | 0 | 114 | 2276 | {2276} | {v} | | | json_build_object | | | | | f | f | f | f | | 0 | f | | + 3262 | json_extract_path | 11 | 10 | 12 | 1 | 0 | 25 | - | f | f | f | f | t | f | i | 2 | 0 | 114 | 114 1009 | {114,1009} | {i,v} | | | json_extract_path | | | | | f | f | f | f | | 0 | f | | 3263 | json_extract_path_op | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 114 | 114 1009 | | | | | json_extract_path | | | | | f | f | f | f | | 0 | f | | - 3264 | json_extract_path_text | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 25 | 114 1009 | {114,1009} | {i,v} | | | json_extract_path_text | | | | | f | f | f | f | | 0 | f | | + 3264 | json_extract_path_text | 11 | 10 | 12 | 1 | 0 | 25 | - | f | f | f | f | t | f | i | 2 | 0 | 25 | 114 1009 | {114,1009} | {i,v} | | | json_extract_path_text | | | | | f | f | f | f | | 0 | f | | 3270 | json_typeof | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 1 | 0 | 25 | 114 | | | | | json_typeof | | | | | f | f | f | f | | 0 | f | | 3318 | json_extract_path_text_op | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 25 | 114 1009 | | | | | json_extract_path_text | | | | | f | f | f | f | | 0 | f | | 3319 | jsonb_extract_path_op | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 3802 | 3802 1009 | | | | | jsonb_extract_path | | | | | f | f | f | f | | 0 | f | | @@ -59,8 +59,8 @@ select oid,* from pg_proc where proname like '%json%' order by oid; 3422 | jsonb_exists | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 16 | 3802 25 | | | | | jsonb_exists | | | | | f | f | f | f | | 0 | f | | 3423 | jsonb_exists_all | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 16 | 3802 1009 | | | | | jsonb_exists_all | | | | | f | f | f | f | | 0 | f | | 3424 | jsonb_exists_any | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 16 | 3802 1009 | | | | | jsonb_exists_any | | | | | f | f | f | f | | 0 | f | | - 3425 | jsonb_extract_path | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 3802 | 3802 1009 | {3802,1009} | {i,v} | | | jsonb_extract_path | | | | | f | f | f | f | | 0 | f | | - 3426 | jsonb_extract_path_text | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 25 | 3802 1009 | {3802,1009} | {i,v} | | | jsonb_extract_path_text | | | | | f | f | f | f | | 0 | f | | + 3425 | jsonb_extract_path | 11 | 10 | 12 | 1 | 0 | 25 | - | f | f | f | f | t | f | i | 2 | 0 | 3802 | 3802 1009 | {3802,1009} | {i,v} | | | jsonb_extract_path | | | | | f | f | f | f | | 0 | f | | + 3426 | jsonb_extract_path_text | 11 | 10 | 12 | 1 | 0 | 25 | - | f | f | f | f | t | f | i | 2 | 0 | 25 | 3802 1009 | {3802,1009} | {i,v} | | | jsonb_extract_path_text | | | | | f | f | f | f | | 0 | f | | 3427 | jsonb_extract_path_text_op | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 25 | 3802 1009 | | | | | jsonb_extract_path_text | | | | | f | f | f | f | | 0 | f | | 3428 | jsonb_ge | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 16 | 3802 3802 | | | | | jsonb_ge | | | | | f | f | f | f | | 0 | f | | 3429 | jsonb_gt | 11 | 10 | 12 | 1 | 0 | 0 | - | f | f | f | f | t | f | i | 2 | 0 | 16 | 3802 3802 | | | | | jsonb_gt | | | | | f | f | f | f | | 0 | f | | -- Gitee