fix ci error
This commit is contained in:
parent
0a312dfdd6
commit
0e3c63e94d
|
@ -124,8 +124,9 @@ static int32_t smlCheckAuth(SSmlHandle *info, SRequestConnInfo* conn, const cha
|
|||
code = catalogChkAuth(info->pCatalog, conn, &pAuth, &authRes);
|
||||
nodesDestroyNode(authRes.pCond[AUTH_RES_BASIC]);
|
||||
|
||||
return (code == TSDB_CODE_SUCCESS) ? (authRes.pass[AUTH_RES_BASIC] ? TSDB_CODE_SUCCESS : TSDB_CODE_PAR_PERMISSION_DENIED) : code;
|
||||
|
||||
return (code == TSDB_CODE_SUCCESS)
|
||||
? (authRes.pass[AUTH_RES_BASIC] ? TSDB_CODE_SUCCESS : TSDB_CODE_PAR_PERMISSION_DENIED)
|
||||
: code;
|
||||
}
|
||||
|
||||
int32_t smlBuildInvalidDataMsg(SSmlMsgBuf *pBuf, const char *msg1, const char *msg2) {
|
||||
|
@ -223,7 +224,8 @@ SSmlSTableMeta* smlBuildSuperTableInfo(SSmlHandle *info, SSmlLineInfo *currEleme
|
|||
SSmlKv kv = {.key = col->name, .keyLen = strlen(col->name), .type = col->type};
|
||||
if (col->type == TSDB_DATA_TYPE_NCHAR) {
|
||||
kv.length = (col->bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE;
|
||||
} else if (col->type == TSDB_DATA_TYPE_BINARY || col->type == TSDB_DATA_TYPE_GEOMETRY || col->type == TSDB_DATA_TYPE_VARBINARY) {
|
||||
} else if (col->type == TSDB_DATA_TYPE_BINARY || col->type == TSDB_DATA_TYPE_GEOMETRY ||
|
||||
col->type == TSDB_DATA_TYPE_VARBINARY) {
|
||||
kv.length = col->bytes - VARSTR_HEADER_SIZE;
|
||||
} else {
|
||||
kv.length = col->bytes;
|
||||
|
@ -768,7 +770,8 @@ static int32_t smlGenerateSchemaAction(SSchema *colField, SHashObj *colHash, SSm
|
|||
return TSDB_CODE_SML_INVALID_DATA;
|
||||
}
|
||||
|
||||
if (((colField[*index].type == TSDB_DATA_TYPE_VARCHAR || colField[*index].type == TSDB_DATA_TYPE_VARBINARY || colField[*index].type == TSDB_DATA_TYPE_GEOMETRY) &&
|
||||
if (((colField[*index].type == TSDB_DATA_TYPE_VARCHAR || colField[*index].type == TSDB_DATA_TYPE_VARBINARY ||
|
||||
colField[*index].type == TSDB_DATA_TYPE_GEOMETRY) &&
|
||||
(colField[*index].bytes - VARSTR_HEADER_SIZE) < kv->length) ||
|
||||
(colField[*index].type == TSDB_DATA_TYPE_NCHAR &&
|
||||
((colField[*index].bytes - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE < kv->length))) {
|
||||
|
@ -799,7 +802,8 @@ static int32_t smlFindNearestPowerOf2(int32_t length, uint8_t type) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_VARBINARY || type == TSDB_DATA_TYPE_GEOMETRY) && result > TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE) {
|
||||
if ((type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_VARBINARY || type == TSDB_DATA_TYPE_GEOMETRY) &&
|
||||
result > TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE) {
|
||||
result = TSDB_MAX_BINARY_LEN - VARSTR_HEADER_SIZE;
|
||||
} else if (type == TSDB_DATA_TYPE_NCHAR && result > (TSDB_MAX_NCHAR_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE) {
|
||||
result = (TSDB_MAX_NCHAR_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE;
|
||||
|
@ -851,7 +855,8 @@ static int32_t smlCheckMeta(SSchema *schema, int32_t length, SArray *cols, bool
|
|||
}
|
||||
|
||||
static int32_t getBytes(uint8_t type, int32_t length) {
|
||||
if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_VARBINARY || type == TSDB_DATA_TYPE_NCHAR || type == TSDB_DATA_TYPE_GEOMETRY) {
|
||||
if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_VARBINARY || type == TSDB_DATA_TYPE_NCHAR ||
|
||||
type == TSDB_DATA_TYPE_GEOMETRY) {
|
||||
return smlFindNearestPowerOf2(length, type);
|
||||
} else {
|
||||
return tDataTypes[type].bytes;
|
||||
|
@ -909,6 +914,7 @@ static int32_t smlSendMetaMsg(SSmlHandle *info, SName *pName, SArray *pColumns,
|
|||
|
||||
// put front for free
|
||||
pReq.numOfColumns = taosArrayGetSize(pColumns);
|
||||
pReq.pColumns = taosArrayInit(pReq.numOfColumns, sizeof(SFieldWithOptions));
|
||||
for (int32_t i = 0; i < pReq.numOfColumns; ++i) {
|
||||
SField *pField = taosArrayGet(pColumns, i);
|
||||
SFieldWithOptions fieldWithOption;
|
||||
|
@ -917,7 +923,6 @@ static int32_t smlSendMetaMsg(SSmlHandle *info, SName *pName, SArray *pColumns,
|
|||
taosArrayPush(pReq.pColumns, &fieldWithOption);
|
||||
}
|
||||
|
||||
pReq.pColumns = pColumns;
|
||||
pReq.numOfTags = taosArrayGetSize(pTags);
|
||||
pReq.pTags = pTags;
|
||||
|
||||
|
@ -1058,6 +1063,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
|||
goto end;
|
||||
}
|
||||
code = smlSendMetaMsg(info, &pName, pColumns, pTags, NULL, SCHEMA_ACTION_CREATE_STABLE);
|
||||
taosArrayDestroy(pColumns);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
uError("SML:0x%" PRIx64 " smlSendMetaMsg failed. can not create %s", info->id, pName.tname);
|
||||
goto end;
|
||||
|
@ -1131,6 +1137,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
|||
}
|
||||
|
||||
code = smlSendMetaMsg(info, &pName, pColumns, pTags, pTableMeta, action);
|
||||
taosArrayDestroy(pColumns);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
uError("SML:0x%" PRIx64 " smlSendMetaMsg failed. can not create %s", info->id, pName.tname);
|
||||
goto end;
|
||||
|
@ -1199,6 +1206,7 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
|||
}
|
||||
|
||||
code = smlSendMetaMsg(info, &pName, pColumns, pTags, pTableMeta, action);
|
||||
taosArrayDestroy(pColumns);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
uError("SML:0x%" PRIx64 " smlSendMetaMsg failed. can not create %s", info->id, pName.tname);
|
||||
goto end;
|
||||
|
@ -1620,7 +1628,6 @@ static void smlPrintStatisticInfo(SSmlHandle *info) {
|
|||
info->cost.numOfAlterColSTables, info->cost.schemaTime - info->cost.parseTime,
|
||||
info->cost.insertBindTime - info->cost.schemaTime, info->cost.insertRpcTime - info->cost.insertBindTime,
|
||||
info->cost.endTime - info->cost.insertRpcTime, info->cost.endTime - info->cost.parseTime);
|
||||
|
||||
}
|
||||
|
||||
int32_t smlClearForRerun(SSmlHandle *info) {
|
||||
|
@ -1648,8 +1655,8 @@ int32_t smlClearForRerun(SSmlHandle *info) {
|
|||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
static bool getLine(SSmlHandle *info, char *lines[], char **rawLine, char *rawLineEnd,
|
||||
int numLines, int i, char** tmp, int *len){
|
||||
static bool getLine(SSmlHandle *info, char *lines[], char **rawLine, char *rawLineEnd, int numLines, int i, char **tmp,
|
||||
int *len) {
|
||||
if (lines) {
|
||||
*tmp = lines[i];
|
||||
*len = strlen(*tmp);
|
||||
|
@ -1669,12 +1676,12 @@ static bool getLine(SSmlHandle *info, char *lines[], char **rawLine, char *rawLi
|
|||
if (*rawLine != NULL && (uDebugFlag & DEBUG_DEBUG)) {
|
||||
char *print = taosMemoryCalloc(*len + 1, 1);
|
||||
memcpy(print, *tmp, *len);
|
||||
uDebug("SML:0x%" PRIx64 " smlParseLine is raw, numLines:%d, protocol:%d, len:%d, data:%s", info->id,
|
||||
numLines, info->protocol, *len, print);
|
||||
uDebug("SML:0x%" PRIx64 " smlParseLine is raw, numLines:%d, protocol:%d, len:%d, data:%s", info->id, numLines,
|
||||
info->protocol, *len, print);
|
||||
taosMemoryFree(print);
|
||||
} else {
|
||||
uDebug("SML:0x%" PRIx64 " smlParseLine is not numLines:%d, protocol:%d, len:%d, data:%s", info->id,
|
||||
numLines, info->protocol, *len, *tmp);
|
||||
uDebug("SML:0x%" PRIx64 " smlParseLine is not numLines:%d, protocol:%d, len:%d, data:%s", info->id, numLines,
|
||||
info->protocol, *len, *tmp);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1774,7 +1781,8 @@ static int smlProcess(SSmlHandle *info, char *lines[], char *rawLine, char *rawL
|
|||
|
||||
do {
|
||||
code = smlModifyDBSchemas(info);
|
||||
if (code != TSDB_CODE_TDB_INVALID_TABLE_SCHEMA_VER && code != TSDB_CODE_SDB_OBJ_CREATING && code != TSDB_CODE_MND_TRANS_CONFLICT) {
|
||||
if (code != TSDB_CODE_TDB_INVALID_TABLE_SCHEMA_VER && code != TSDB_CODE_SDB_OBJ_CREATING &&
|
||||
code != TSDB_CODE_MND_TRANS_CONFLICT) {
|
||||
break;
|
||||
}
|
||||
taosMsleep(100);
|
||||
|
@ -1899,8 +1907,8 @@ TAOS_RES *taos_schemaless_insert_inner(TAOS *taos, char *lines[], char *rawLine,
|
|||
request->code = code;
|
||||
info->cost.endTime = taosGetTimestampUs();
|
||||
info->cost.code = code;
|
||||
if (NEED_CLIENT_HANDLE_ERROR(code) || code == TSDB_CODE_SDB_OBJ_CREATING ||
|
||||
code == TSDB_CODE_PAR_VALUE_TOO_LONG || code == TSDB_CODE_MND_TRANS_CONFLICT) {
|
||||
if (NEED_CLIENT_HANDLE_ERROR(code) || code == TSDB_CODE_SDB_OBJ_CREATING || code == TSDB_CODE_PAR_VALUE_TOO_LONG ||
|
||||
code == TSDB_CODE_MND_TRANS_CONFLICT) {
|
||||
if (cnt++ >= 10) {
|
||||
uInfo("SML:%" PRIx64 " retry:%d/10 end code:%d, msg:%s", info->id, cnt, code, tstrerror(code));
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue