解决enum类型guc参数的bug

This commit is contained in:
l00584793
2020-12-23 10:35:20 +08:00
committed by @luo_zihao5524
parent 8709ccc1d4
commit 4d9a9fe369
3 changed files with 37 additions and 12 deletions

View File

@ -4137,17 +4137,6 @@ int parse_double_value(const char* paraname, const char* value, const char* guc_
return SUCCESS;
}
/*
************************************************************************************
Function: check_enum_type_value
Desc : check the parameter value of enum type.
Input : paraname parameter name
guc_list_value the string from config file
value parameter value
Return : SUCCESS
FAILURE
************************************************************************************
*/
int is_value_in_range(const char* guc_list_value, const char* value)
{
char* ptr = NULL;
@ -4172,6 +4161,17 @@ int is_value_in_range(const char* guc_list_value, const char* value)
return FAILURE;
}
/*
************************************************************************************
Function: check_enum_type_value
Desc : check the parameter value of enum type.
Input : paraname parameter name
guc_list_value the string from config file
value parameter value
Return : SUCCESS
FAILURE
************************************************************************************
*/
int check_enum_type_value(const char* paraname, char* guc_list_value, const char* value)
{
char guc_val[MAX_VALUE_LEN] = {0};
@ -4195,7 +4195,11 @@ int check_enum_type_value(const char* paraname, char* guc_list_value, const char
}
make_string_tolower(value, tmp_paraname, sizeof(tmp_paraname) / sizeof(char));
vptr = strtok_r(tmp_paraname, delims, &vouter_ptr);
if (tmp_paraname != NULL && strlen(tmp_paraname) > 0) {
vptr = strtok_r(tmp_paraname, delims, &vouter_ptr);
} else {
vptr = "";
}
while (NULL != vptr) {
p = vptr;
while (isspace((unsigned char)*p))

View File

@ -0,0 +1,3 @@
\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "wal_level=hot_standby"
\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "wal_level=on"
\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "wal_level=''"

View File

@ -0,0 +1,18 @@
\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "wal_level=hot_standby"
NOTICE: If you need to copy the data stream for WAL log archiving and standby machine. You must be set to the parameter with archive or hot_standby. If this parameter is setted to archive. The hot_standby must be setted to off, otherwise it will cause the database can not be started, at the same time the max_wal_senders must be set at least 1.
expected instance path: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf]
gs_guc set: wal_level=hot_standby: [@abs_srcdir@/tmp_check/datanode1/postgresql.conf]
Total instances: 1. Failed instances: 0.
Success to perform gs_guc!
\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "wal_level=on"
NOTICE: If you need to copy the data stream for WAL log archiving and standby machine. You must be set to the parameter with archive or hot_standby. If this parameter is setted to archive. The hot_standby must be setted to off, otherwise it will cause the database can not be started, at the same time the max_wal_senders must be set at least 1.
ERROR: The value "on" is outside the valid range(minimal,archive,hot_standby,logical) for parameter "wal_level".
ERROR: The value "on" for parameter "wal_level" is incorrect.
Try "gs_guc --help" for more information.
\! @abs_bindir@/gs_guc set -D @abs_srcdir@/tmp_check/datanode1/ -c "wal_level=''"
NOTICE: If you need to copy the data stream for WAL log archiving and standby machine. You must be set to the parameter with archive or hot_standby. If this parameter is setted to archive. The hot_standby must be setted to off, otherwise it will cause the database can not be started, at the same time the max_wal_senders must be set at least 1.
ERROR: The value "" is outside the valid range(minimal,archive,hot_standby,logical) for parameter "wal_level".
ERROR: The value "''" for parameter "wal_level" is incorrect.
Try "gs_guc --help" for more information.