修复复制槽名称长度为64,65时提示创建复制槽成功但是复制槽不存在的偶现问题
This commit is contained in:
@ -1221,7 +1221,7 @@ int main(int argc, char** argv)
|
||||
rc = snprintf_s(query,
|
||||
sizeof(query),
|
||||
sizeof(query) - 1,
|
||||
"CREATE_REPLICATION_SLOT \"%s\" LOGICAL \"%s\"",
|
||||
"CREATE_REPLICATION_SLOT %s LOGICAL %s",
|
||||
replication_slot,
|
||||
plugin);
|
||||
securec_check_ss_c(rc, "\0", "\0");
|
||||
|
@ -2035,7 +2035,6 @@ static bool cmdStringLengthCheck(const char* cmd_string)
|
||||
{
|
||||
const size_t cmd_length_limit = 1024;
|
||||
const size_t slotname_limit = 64;
|
||||
const size_t double_quotes_len = 2;
|
||||
char comd[cmd_length_limit] = {'\0'};
|
||||
char* sub_cmd = NULL;
|
||||
char* rm_cmd = NULL;
|
||||
@ -2085,7 +2084,7 @@ static bool cmdStringLengthCheck(const char* cmd_string)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (strlen(slot_name) >= slotname_limit + double_quotes_len) {
|
||||
if (strlen(slot_name) >= slotname_limit) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user