[td-11818] merge 3.0 and fix a bug.
This commit is contained in:
parent
ea424d0b1d
commit
067116330b
|
@ -113,6 +113,13 @@ TAOS *taos_connect_internal(const char *ip, const char *user, const char *pass,
|
||||||
return taosConnectImpl(ip, user, &secretEncrypt[0], db, port, NULL, NULL, *pInst);
|
return taosConnectImpl(ip, user, &secretEncrypt[0], db, port, NULL, NULL, *pInst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool supportedQueryType(int32_t type) {
|
||||||
|
return (type == TSDB_MSG_TYPE_CREATE_USER || type == TSDB_MSG_TYPE_SHOW || type == TSDB_MSG_TYPE_DROP_USER ||
|
||||||
|
type == TSDB_MSG_TYPE_DROP_ACCT || type == TSDB_MSG_TYPE_CREATE_DB || type == TSDB_MSG_TYPE_CREATE_ACCT ||
|
||||||
|
type == TSDB_MSG_TYPE_CREATE_TABLE || type == TSDB_MSG_TYPE_CREATE_STB || type == TSDB_MSG_TYPE_USE_DB ||
|
||||||
|
type == TSDB_MSG_TYPE_DROP_DB || type == TSDB_MSG_TYPE_DROP_STB);
|
||||||
|
}
|
||||||
|
|
||||||
TAOS_RES *taos_query_l(TAOS *taos, const char *sql, int sqlLen) {
|
TAOS_RES *taos_query_l(TAOS *taos, const char *sql, int sqlLen) {
|
||||||
STscObj *pTscObj = (STscObj *)taos;
|
STscObj *pTscObj = (STscObj *)taos;
|
||||||
if (sqlLen > (size_t) tsMaxSQLStringLen) {
|
if (sqlLen > (size_t) tsMaxSQLStringLen) {
|
||||||
|
@ -151,10 +158,11 @@ TAOS_RES *taos_query_l(TAOS *taos, const char *sql, int sqlLen) {
|
||||||
.pMsg = pRequest->msgBuf,
|
.pMsg = pRequest->msgBuf,
|
||||||
.msgLen = ERROR_MSG_BUF_DEFAULT_SIZE
|
.msgLen = ERROR_MSG_BUF_DEFAULT_SIZE
|
||||||
};
|
};
|
||||||
|
|
||||||
SQueryNode* pQuery = NULL;
|
SQueryNode* pQuery = NULL;
|
||||||
int32_t code = qParseQuerySql(&cxt, &pQuery);
|
int32_t code = qParseQuerySql(&cxt, &pQuery);
|
||||||
if (qIsDclQuery(pQuery)) {
|
if (qIsDclQuery(pQuery)) {
|
||||||
SDclStmtInfo* pDcl = (SDclStmtInfo*)pQuery;
|
SDclStmtInfo* pDcl = (SDclStmtInfo*) pQuery;
|
||||||
pRequest->type = pDcl->msgType;
|
pRequest->type = pDcl->msgType;
|
||||||
pRequest->body.requestMsg = (SReqMsgInfo){.pMsg = pDcl->pMsg, .len = pDcl->msgLen};
|
pRequest->body.requestMsg = (SReqMsgInfo){.pMsg = pDcl->pMsg, .len = pDcl->msgLen};
|
||||||
|
|
||||||
|
@ -215,7 +223,7 @@ TAOS_RES *taos_query_l(TAOS *taos, const char *sql, int sqlLen) {
|
||||||
int initEpSetFromCfg(const char *firstEp, const char *secondEp, SCorEpSet *pEpSet) {
|
int initEpSetFromCfg(const char *firstEp, const char *secondEp, SCorEpSet *pEpSet) {
|
||||||
pEpSet->version = 0;
|
pEpSet->version = 0;
|
||||||
|
|
||||||
// init mgmt ip set
|
// init mnode ip set
|
||||||
SEpSet *mgmtEpSet = &(pEpSet->epSet);
|
SEpSet *mgmtEpSet = &(pEpSet->epSet);
|
||||||
mgmtEpSet->numOfEps = 0;
|
mgmtEpSet->numOfEps = 0;
|
||||||
mgmtEpSet->inUse = 0;
|
mgmtEpSet->inUse = 0;
|
||||||
|
|
|
@ -4457,8 +4457,6 @@ int32_t qParserValidateDclSqlNode(SSqlInfo* pInfo, SParseBasicCtx* pCtx, SDclStm
|
||||||
return TSDB_CODE_TSC_INVALID_OPERATION;
|
return TSDB_CODE_TSC_INVALID_OPERATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(pCreateMsg->db, token.z, token.n);
|
|
||||||
|
|
||||||
pDcl->pMsg = (char*)pCreateMsg;
|
pDcl->pMsg = (char*)pCreateMsg;
|
||||||
pDcl->msgLen = sizeof(SCreateDbMsg);
|
pDcl->msgLen = sizeof(SCreateDbMsg);
|
||||||
pDcl->msgType = (pInfo->type == TSDB_SQL_CREATE_DB)? TSDB_MSG_TYPE_CREATE_DB:TSDB_MSG_TYPE_ALTER_DB;
|
pDcl->msgType = (pInfo->type == TSDB_SQL_CREATE_DB)? TSDB_MSG_TYPE_CREATE_DB:TSDB_MSG_TYPE_ALTER_DB;
|
||||||
|
|
Loading…
Reference in New Issue