提交 baf10a4a 编写于 作者: sangshuduo's avatar sangshuduo

[TD-3228] <fix>: support quorum. fix buffer issue.

上级 5adfc1f4
......@@ -2081,7 +2081,7 @@ static int createDatabases() {
int dataLen = 0;
dataLen += snprintf(command + dataLen,
BUFFER_SIZE - dataLen, "create database if not exists %s", g_Dbs.db[i].dbName);
BUFFER_SIZE - dataLen, "create database if not exists %s ", g_Dbs.db[i].dbName);
if (g_Dbs.db[i].dbCfg.blocks > 0) {
dataLen += snprintf(command + dataLen,
......@@ -2965,9 +2965,9 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
if (quorum && quorum->type == cJSON_Number) {
g_Dbs.db[i].dbCfg.quorum = quorum->valueint;
} else if (!quorum) {
g_Dbs.db[i].dbCfg.quorum = -1;
g_Dbs.db[i].dbCfg.quorum = 1;
} else {
printf("failed to read json, walLevel not found");
printf("failed to read json, quorum input mistake");
goto PARSE_OVER;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册