提交 2541d191 编写于 作者: L Liu Jicong

use full name to create topic

上级 f53ea715
...@@ -384,16 +384,13 @@ TAOS_RES* tmq_create_topic(TAOS* taos, const char* topicName, const char* sql, i ...@@ -384,16 +384,13 @@ TAOS_RES* tmq_create_topic(TAOS* taos, const char* topicName, const char* sql, i
tNameFromString(&name, dbName, T_NAME_ACCT | T_NAME_DB); tNameFromString(&name, dbName, T_NAME_ACCT | T_NAME_DB);
tNameFromString(&name, topicName, T_NAME_TABLE); tNameFromString(&name, topicName, T_NAME_TABLE);
char topicFname[TSDB_TOPIC_FNAME_LEN] = {0};
tNameExtractFullName(&name, topicFname);
SMCreateTopicReq req = { SMCreateTopicReq req = {
.igExists = 1, .igExists = 1,
.physicalPlan = (char*)pStr, .physicalPlan = (char*)pStr,
.sql = (char*)sql, .sql = (char*)sql,
.logicalPlan = (char*)"no logic plan", .logicalPlan = (char*)"no logic plan",
}; };
memcpy(req.name, topicName, TSDB_TOPIC_FNAME_LEN); tNameExtractFullName(&name, req.name);
int tlen = tSerializeMCreateTopicReq(NULL, 0, &req); int tlen = tSerializeMCreateTopicReq(NULL, 0, &req);
void* buf = malloc(tlen); void* buf = malloc(tlen);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "mndVgroup.h" #include "mndVgroup.h"
#include "tname.h" #include "tname.h"
#define MND_TOPIC_VER_NUMBER 1 #define MND_TOPIC_VER_NUMBER 1
#define MND_TOPIC_RESERVE_SIZE 64 #define MND_TOPIC_RESERVE_SIZE 64
static int32_t mndTopicActionInsert(SSdb *pSdb, SMqTopicObj *pTopic); static int32_t mndTopicActionInsert(SSdb *pSdb, SMqTopicObj *pTopic);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册