提交 1f1821c8 编写于 作者: M Minglei Jin

[TD-13882]<fix>: fix ERROR output when monitor start first time

上级 546afbb5
......@@ -1092,28 +1092,16 @@ static void monSaveDnodesInfo() {
static int32_t checkCreateVgroupTable(int32_t vgId) {
char subsql[256];
bool create_table = false;
int32_t code = TSDB_CODE_SUCCESS;
memset(subsql, 0, sizeof(subsql));
snprintf(subsql, 255, "describe %s.vgroup_%d", tsMonitorDbName, vgId);
snprintf(subsql, sizeof(subsql), "create table if not exists %s.vgroup_%d using %s.vgroups_info tags(%d)",
tsMonitorDbName, vgId, tsMonitorDbName, vgId);
TAOS_RES *result = taos_query(tsMonitor.conn, subsql);
code = taos_errno(result);
if (code != 0) {
create_table = true;
snprintf(subsql, sizeof(subsql), "create table if not exists %s.vgroup_%d using %s.vgroups_info tags(%d)",
tsMonitorDbName, vgId, tsMonitorDbName, vgId);
monError("table vgroup_%d not exist, create table vgroup_%d", vgId, vgId);
}
taos_free_result(result);
if (create_table == true) {
result = taos_query(tsMonitor.conn, subsql);
code = taos_errno(result);
taos_free_result(result);
}
return code;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册