提交 8bb16b3e 编写于 作者: wmmhello's avatar wmmhello

fix:add config for tmq test

上级 99fc0e0c
...@@ -27,6 +27,7 @@ typedef struct { ...@@ -27,6 +27,7 @@ typedef struct {
bool snapShot; bool snapShot;
bool dropTable; bool dropTable;
bool subTable; bool subTable;
int meta;
int srcVgroups; int srcVgroups;
int dstVgroups; int dstVgroups;
char dir[64]; char dir[64];
...@@ -511,14 +512,18 @@ int32_t create_topic() { ...@@ -511,14 +512,18 @@ int32_t create_topic() {
taos_free_result(pRes); taos_free_result(pRes);
if (g_conf.subTable) { if (g_conf.subTable) {
pRes = taos_query(pConn, "create topic meters_summary_t1 with meta as stable meters_summary"); char topic[128] = {0};
sprintf(topic, "create topic meters_summary_t1 %s as stable meters_summary", g_conf.meta == 0 ? "with meta" : "only meta");
pRes = taos_query(pConn, topic);
if (taos_errno(pRes) != 0) { if (taos_errno(pRes) != 0) {
printf("failed to create topic meters_summary_t1, reason:%s\n", taos_errstr(pRes)); printf("failed to create topic meters_summary_t1, reason:%s\n", taos_errstr(pRes));
return -1; return -1;
} }
taos_free_result(pRes); taos_free_result(pRes);
} else { } else {
pRes = taos_query(pConn, "create topic topic_db with meta as database abc1"); char topic[128] = {0};
sprintf(topic, "create topic topic_db %s as database abc1", g_conf.meta == 0 ? "with meta" : "only meta");
pRes = taos_query(pConn, topic);
if (taos_errno(pRes) != 0) { if (taos_errno(pRes) != 0) {
printf("failed to create topic topic_db, reason:%s\n", taos_errstr(pRes)); printf("failed to create topic topic_db, reason:%s\n", taos_errstr(pRes));
return -1; return -1;
...@@ -802,6 +807,8 @@ int main(int argc, char* argv[]) { ...@@ -802,6 +807,8 @@ int main(int argc, char* argv[]) {
g_conf.dstVgroups = atol(argv[++i]); g_conf.dstVgroups = atol(argv[++i]);
} else if (strcmp(argv[i], "-t") == 0) { } else if (strcmp(argv[i], "-t") == 0) {
g_conf.subTable = true; g_conf.subTable = true;
} else if (strcmp(argv[i], "-onlymeta") == 0) {
g_conf.meta = 1;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册