!3600 gs_get_session_memctx_detail函数输入空值报错信息优化
Merge pull request !3600 from zhangzhixian/empty_input_fix
This commit is contained in:
@ -310,6 +310,12 @@ Datum gs_get_thread_memctx_detail(PG_FUNCTION_ARGS)
|
||||
aclcheck_error(ACLCHECK_NO_PRIV, ACL_KIND_PROC, "gs_get_thread_memctx_detail");
|
||||
}
|
||||
|
||||
if (PG_ARGISNULL(1)) {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("second parameter should not be empty")));
|
||||
}
|
||||
|
||||
const ThreadId tid = PG_GETARG_INT64(0);
|
||||
char* ctx_name = TextDatumGetCString(PG_GETARG_TEXT_PP(1));
|
||||
|
||||
@ -411,6 +417,12 @@ Datum gs_get_session_memctx_detail(PG_FUNCTION_ARGS)
|
||||
aclcheck_error(ACLCHECK_NO_PRIV, ACL_KIND_PROC, "gs_get_session_memctx_detail");
|
||||
}
|
||||
|
||||
if (PG_ARGISNULL(0)) {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("input parameter should not be empty")));
|
||||
}
|
||||
|
||||
char* ctx_name = TextDatumGetCString(PG_GETARG_TEXT_PP(0));
|
||||
|
||||
gs_check_context_name_valid(ctx_name);
|
||||
@ -476,6 +488,12 @@ Datum gs_get_shared_memctx_detail(PG_FUNCTION_ARGS)
|
||||
aclcheck_error(ACLCHECK_NO_PRIV, ACL_KIND_PROC, "gs_get_shared_memctx_detail");
|
||||
}
|
||||
|
||||
if (PG_ARGISNULL(0)) {
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("input parameter should not be empty")));
|
||||
}
|
||||
|
||||
char* ctx_name = TextDatumGetCString(PG_GETARG_TEXT_PP(0));
|
||||
|
||||
gs_check_context_name_valid(ctx_name);
|
||||
|
@ -11,7 +11,7 @@ select * from gs_get_shared_memctx_detail('AbnormalContext');
|
||||
(0 rows)
|
||||
|
||||
select * from gs_get_shared_memctx_detail(NULL);
|
||||
ERROR: NULL input for detoast datum packed
|
||||
ERROR: input parameter should not be empty
|
||||
select * from gs_get_session_memctx_detail('CBBTopMemoryContext') limit 1;
|
||||
--?.*
|
||||
--?.*
|
||||
@ -24,12 +24,12 @@ select * from gs_get_session_memctx_detail('AbnormalContext');
|
||||
(0 rows)
|
||||
|
||||
select * from gs_get_session_memctx_detail(NULL);
|
||||
ERROR: NULL input for detoast datum packed
|
||||
ERROR: input parameter should not be empty
|
||||
select * from gs_get_thread_memctx_detail(100, 'CBBTopMemoryContext');
|
||||
ERROR: can not find pid 100
|
||||
|
||||
select * from gs_get_thread_memctx_detail(100, NULL);
|
||||
ERROR: NULL input for detoast datum packed
|
||||
ERROR: second parameter should not be empty
|
||||
select gs_get_thread_memctx_detail(tid, 'CBBTopMemoryContext') from pv_thread_memory_context where contextname = 'CBBTopMemoryContext' limit 1;
|
||||
--?.*
|
||||
--?.*
|
||||
|
Reference in New Issue
Block a user