fix:fix error in get db name for schemaless parameters
This commit is contained in:
parent
10807abbc8
commit
90cdc36018
|
@ -960,10 +960,10 @@ static int32_t smlParseInfluxString(const char* sql, SSmlLineInfo *elements, SSm
|
|||
return TSDB_CODE_SML_INVALID_DATA;
|
||||
}
|
||||
elements->colsLen = sql - elements->cols;
|
||||
if(elements->colsLen == 0) {
|
||||
smlBuildInvalidDataMsg(msg, "cols is empty", NULL);
|
||||
return TSDB_CODE_SML_INVALID_DATA;
|
||||
}
|
||||
// if(elements->colsLen == 0) {
|
||||
// smlBuildInvalidDataMsg(msg, "cols is empty", NULL);
|
||||
// return TSDB_CODE_SML_INVALID_DATA;
|
||||
// }
|
||||
|
||||
// parse timestamp
|
||||
JUMP_SPACE(sql)
|
||||
|
@ -1124,7 +1124,7 @@ static int32_t smlParseTelnetString(SSmlHandle *info, const char* sql, SSmlTable
|
|||
}
|
||||
|
||||
static int32_t smlParseCols(const char* data, int32_t len, SArray *cols, char *childTableName, bool isTag, SHashObj *dumplicateKey, SSmlMsgBuf *msg){
|
||||
if(isTag && len == 0){
|
||||
if(len == 0){
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -2407,6 +2407,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
|
|||
info->pRequest->code = smlProcess(info, lines, numLines);
|
||||
|
||||
end:
|
||||
uDebug("result:%s", info->msgBuf.buf);
|
||||
smlDestroyInfo(info);
|
||||
return (TAOS_RES*)request;
|
||||
}
|
||||
|
|
|
@ -1329,6 +1329,8 @@ static int32_t parseInsertBody(SInsertParseContext* pCxt) {
|
|||
SName name;
|
||||
CHECK_CODE(createSName(&name, &tbnameToken, pCxt->pComCxt->acctId, pCxt->pComCxt->db, &pCxt->msg));
|
||||
|
||||
CHECK_CODE(isNotSchemalessDb(pCxt->pComCxt, name.dbname));
|
||||
|
||||
tNameExtractFullName(&name, tbFName);
|
||||
CHECK_CODE(taosHashPut(pCxt->pTableNameHashObj, tbFName, strlen(tbFName), &name, sizeof(SName)));
|
||||
|
||||
|
@ -1468,11 +1470,6 @@ int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery) {
|
|||
(*pQuery)->msgType = TDMT_VND_SUBMIT;
|
||||
(*pQuery)->pRoot = (SNode*)context.pOutput;
|
||||
|
||||
int32_t code = isNotSchemalessDb(pContext);
|
||||
if(code != TSDB_CODE_SUCCESS){
|
||||
return code;
|
||||
}
|
||||
|
||||
if (NULL == (*pQuery)->pTableList) {
|
||||
(*pQuery)->pTableList = taosArrayInit(taosHashGetSize(context.pTableNameHashObj), sizeof(SName));
|
||||
if (NULL == (*pQuery)->pTableList) {
|
||||
|
@ -1482,7 +1479,7 @@ int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery) {
|
|||
|
||||
context.pOutput->payloadType = PAYLOAD_TYPE_KV;
|
||||
|
||||
code = skipInsertInto(&context.pSql, &context.msg);
|
||||
int32_t code = skipInsertInto(&context.pSql, &context.msg);
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = parseInsertBody(&context);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue