refactor: do some internal refactor.
This commit is contained in:
parent
91eea02258
commit
b419650116
|
@ -791,7 +791,7 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) {
|
||||||
goto _OVER;
|
goto _OVER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(createStreamReq.sql != NULL){
|
if (createStreamReq.sql != NULL) {
|
||||||
sqlLen = strlen(createStreamReq.sql);
|
sqlLen = strlen(createStreamReq.sql);
|
||||||
sql = taosMemoryMalloc(sqlLen + 1);
|
sql = taosMemoryMalloc(sqlLen + 1);
|
||||||
memset(sql, 0, sqlLen + 1);
|
memset(sql, 0, sqlLen + 1);
|
||||||
|
@ -878,14 +878,13 @@ static int32_t mndProcessCreateStreamReq(SRpcMsg *pReq) {
|
||||||
// reuse this function for stream
|
// reuse this function for stream
|
||||||
|
|
||||||
if (sql != NULL && sqlLen > 0) {
|
if (sql != NULL && sqlLen > 0) {
|
||||||
auditRecord(pReq, pMnode->clusterId, "createStream", dbname.dbname, name.dbname, sql,
|
auditRecord(pReq, pMnode->clusterId, "createStream", dbname.dbname, name.dbname, sql, sqlLen);
|
||||||
sqlLen);
|
} else {
|
||||||
}
|
|
||||||
else{
|
|
||||||
char detail[1000] = {0};
|
char detail[1000] = {0};
|
||||||
sprintf(detail, "dbname:%s, stream name:%s", dbname.dbname, name.dbname);
|
sprintf(detail, "dbname:%s, stream name:%s", dbname.dbname, name.dbname);
|
||||||
auditRecord(pReq, pMnode->clusterId, "createStream", dbname.dbname, name.dbname, detail, strlen(detail));
|
auditRecord(pReq, pMnode->clusterId, "createStream", dbname.dbname, name.dbname, detail, strlen(detail));
|
||||||
}
|
}
|
||||||
|
|
||||||
_OVER:
|
_OVER:
|
||||||
if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
|
if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
|
||||||
mError("stream:%s, failed to create since %s", createStreamReq.name, terrstr());
|
mError("stream:%s, failed to create since %s", createStreamReq.name, terrstr());
|
||||||
|
@ -894,7 +893,7 @@ _OVER:
|
||||||
mndReleaseStream(pMnode, pStream);
|
mndReleaseStream(pMnode, pStream);
|
||||||
tFreeSCMCreateStreamReq(&createStreamReq);
|
tFreeSCMCreateStreamReq(&createStreamReq);
|
||||||
tFreeStreamObj(&streamObj);
|
tFreeStreamObj(&streamObj);
|
||||||
if(sql != NULL){
|
if (sql != NULL) {
|
||||||
taosMemoryFreeClear(sql);
|
taosMemoryFreeClear(sql);
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
|
|
Loading…
Reference in New Issue