void sync query return val
This commit is contained in:
parent
e19514e2c4
commit
49a6bf4c23
|
@ -32,7 +32,6 @@ extern int32_t tsS3PageCacheSize;
|
||||||
extern int32_t tsS3UploadDelaySec;
|
extern int32_t tsS3UploadDelaySec;
|
||||||
|
|
||||||
int32_t s3Init();
|
int32_t s3Init();
|
||||||
void s3CleanUp();
|
|
||||||
int32_t s3CheckCfg();
|
int32_t s3CheckCfg();
|
||||||
int32_t s3PutObjectFromFile(const char *file, const char *object);
|
int32_t s3PutObjectFromFile(const char *file, const char *object);
|
||||||
int32_t s3PutObjectFromFile2(const char *file, const char *object, int8_t withcp);
|
int32_t s3PutObjectFromFile2(const char *file, const char *object, int8_t withcp);
|
||||||
|
|
|
@ -26,10 +26,10 @@ extern "C" {
|
||||||
#include "query.h"
|
#include "query.h"
|
||||||
#include "taos.h"
|
#include "taos.h"
|
||||||
#include "tcommon.h"
|
#include "tcommon.h"
|
||||||
#include "tmisce.h"
|
|
||||||
#include "tdef.h"
|
#include "tdef.h"
|
||||||
#include "thash.h"
|
#include "thash.h"
|
||||||
#include "tlist.h"
|
#include "tlist.h"
|
||||||
|
#include "tmisce.h"
|
||||||
#include "tmsg.h"
|
#include "tmsg.h"
|
||||||
#include "tmsgtype.h"
|
#include "tmsgtype.h"
|
||||||
#include "trpc.h"
|
#include "trpc.h"
|
||||||
|
@ -319,11 +319,13 @@ void syncCatalogFn(SMetaData* pResult, void* param, int32_t code);
|
||||||
TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly, int8_t source);
|
TAOS_RES* taosQueryImpl(TAOS* taos, const char* sql, bool validateOnly, int8_t source);
|
||||||
TAOS_RES* taosQueryImplWithReqid(TAOS* taos, const char* sql, bool validateOnly, int64_t reqid);
|
TAOS_RES* taosQueryImplWithReqid(TAOS* taos, const char* sql, bool validateOnly, int64_t reqid);
|
||||||
|
|
||||||
void taosAsyncQueryImpl(uint64_t connId, const char* sql, __taos_async_fn_t fp, void* param, bool validateOnly, int8_t source);
|
void taosAsyncQueryImpl(uint64_t connId, const char* sql, __taos_async_fn_t fp, void* param, bool validateOnly,
|
||||||
|
int8_t source);
|
||||||
void taosAsyncQueryImplWithReqid(uint64_t connId, const char* sql, __taos_async_fn_t fp, void* param, bool validateOnly,
|
void taosAsyncQueryImplWithReqid(uint64_t connId, const char* sql, __taos_async_fn_t fp, void* param, bool validateOnly,
|
||||||
int64_t reqid);
|
int64_t reqid);
|
||||||
void taosAsyncFetchImpl(SRequestObj* pRequest, __taos_async_fn_t fp, void* param);
|
void taosAsyncFetchImpl(SRequestObj* pRequest, __taos_async_fn_t fp, void* param);
|
||||||
int32_t clientParseSql(void* param, const char* dbName, const char* sql, bool parseOnly, const char* effectiveUser, SParseSqlRes* pRes);
|
int32_t clientParseSql(void* param, const char* dbName, const char* sql, bool parseOnly, const char* effectiveUser,
|
||||||
|
SParseSqlRes* pRes);
|
||||||
void syncQueryFn(void* param, void* res, int32_t code);
|
void syncQueryFn(void* param, void* res, int32_t code);
|
||||||
|
|
||||||
int32_t getVersion1BlockMetaSize(const char* p, int32_t numOfCols);
|
int32_t getVersion1BlockMetaSize(const char* p, int32_t numOfCols);
|
||||||
|
@ -422,7 +424,7 @@ typedef struct SSqlCallbackWrapper {
|
||||||
} SSqlCallbackWrapper;
|
} SSqlCallbackWrapper;
|
||||||
|
|
||||||
void setQueryRequest(int64_t rId);
|
void setQueryRequest(int64_t rId);
|
||||||
SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQuery, void** res);
|
void launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQuery, void** res);
|
||||||
int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList);
|
int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList);
|
||||||
void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultMeta, SSqlCallbackWrapper* pWrapper);
|
void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultMeta, SSqlCallbackWrapper* pWrapper);
|
||||||
int32_t refreshMeta(STscObj* pTscObj, SRequestObj* pRequest);
|
int32_t refreshMeta(STscObj* pTscObj, SRequestObj* pRequest);
|
||||||
|
@ -444,7 +446,8 @@ void doRequestCallback(SRequestObj* pRequest, int32_t code);
|
||||||
void freeQueryParam(SSyncQueryParam* param);
|
void freeQueryParam(SSyncQueryParam* param);
|
||||||
|
|
||||||
#ifdef TD_ENTERPRISE
|
#ifdef TD_ENTERPRISE
|
||||||
int32_t clientParseSqlImpl(void* param, const char* dbName, const char* sql, bool parseOnly, const char* effeciveUser, SParseSqlRes* pRes);
|
int32_t clientParseSqlImpl(void* param, const char* dbName, const char* sql, bool parseOnly, const char* effeciveUser,
|
||||||
|
SParseSqlRes* pRes);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TSC_ERR_RET(c) \
|
#define TSC_ERR_RET(c) \
|
||||||
|
@ -474,11 +477,7 @@ int32_t clientParseSqlImpl(void* param, const char* dbName, const char* sql, boo
|
||||||
|
|
||||||
void slowQueryLog(int64_t rid, bool killed, int32_t code, int32_t cost);
|
void slowQueryLog(int64_t rid, bool killed, int32_t code, int32_t cost);
|
||||||
|
|
||||||
enum {
|
enum { MONITORSQLTYPESELECT = 0, MONITORSQLTYPEINSERT = 1, MONITORSQLTYPEDELETE = 2 };
|
||||||
MONITORSQLTYPESELECT = 0,
|
|
||||||
MONITORSQLTYPEINSERT = 1,
|
|
||||||
MONITORSQLTYPEDELETE = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
void sqlReqLog(int64_t rid, bool killed, int32_t code, int8_t type);
|
void sqlReqLog(int64_t rid, bool killed, int32_t code, int8_t type);
|
||||||
|
|
||||||
|
|
|
@ -1249,7 +1249,7 @@ void schedulerExecCb(SExecResult* pResult, void* param, int32_t code) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQuery, void** res) {
|
void launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQuery, void** res) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
||||||
if (pQuery->pRoot) {
|
if (pQuery->pRoot) {
|
||||||
|
@ -1335,8 +1335,6 @@ SRequestObj* launchQueryImpl(SRequestObj* pRequest, SQuery* pQuery, bool keepQue
|
||||||
*res = pRequest->body.resInfo.execRes.res;
|
*res = pRequest->body.resInfo.execRes.res;
|
||||||
pRequest->body.resInfo.execRes.res = NULL;
|
pRequest->body.resInfo.execRes.res = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pRequest;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t asyncExecSchQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultMeta,
|
static int32_t asyncExecSchQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultMeta,
|
||||||
|
|
|
@ -978,7 +978,7 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
pQuery.msgType = pQuery.pCmdMsg->msgType;
|
pQuery.msgType = pQuery.pCmdMsg->msgType;
|
||||||
pQuery.stableQuery = true;
|
pQuery.stableQuery = true;
|
||||||
|
|
||||||
(void)launchQueryImpl(pRequest, &pQuery, true, NULL); // ignore, because return value is pRequest
|
launchQueryImpl(pRequest, &pQuery, true, NULL); // ignore, because return value is pRequest
|
||||||
|
|
||||||
taosMemoryFree(pCmdMsg.pMsg);
|
taosMemoryFree(pCmdMsg.pMsg);
|
||||||
|
|
||||||
|
@ -1082,7 +1082,7 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
pQuery.msgType = pQuery.pCmdMsg->msgType;
|
pQuery.msgType = pQuery.pCmdMsg->msgType;
|
||||||
pQuery.stableQuery = true;
|
pQuery.stableQuery = true;
|
||||||
|
|
||||||
(void)launchQueryImpl(pRequest, &pQuery, true, NULL); // ignore, because return value is pRequest
|
launchQueryImpl(pRequest, &pQuery, true, NULL); // ignore, because return value is pRequest
|
||||||
taosMemoryFree(pCmdMsg.pMsg);
|
taosMemoryFree(pCmdMsg.pMsg);
|
||||||
if (pRequest->code == TSDB_CODE_SUCCESS) {
|
if (pRequest->code == TSDB_CODE_SUCCESS) {
|
||||||
// ignore the error code
|
// ignore the error code
|
||||||
|
@ -1236,7 +1236,7 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
|
|
||||||
RAW_RETURN_CHECK(rewriteToVnodeModifyOpStmt(pQuery, pBufArray));
|
RAW_RETURN_CHECK(rewriteToVnodeModifyOpStmt(pQuery, pBufArray));
|
||||||
|
|
||||||
(void)launchQueryImpl(pRequest, pQuery, true, NULL);
|
launchQueryImpl(pRequest, pQuery, true, NULL);
|
||||||
if (pRequest->code == TSDB_CODE_SUCCESS) {
|
if (pRequest->code == TSDB_CODE_SUCCESS) {
|
||||||
RAW_RETURN_CHECK(removeMeta(pTscObj, pRequest->tableList, false));
|
RAW_RETURN_CHECK(removeMeta(pTscObj, pRequest->tableList, false));
|
||||||
}
|
}
|
||||||
|
@ -1365,7 +1365,7 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
if (TSDB_CODE_SUCCESS != code) goto end;
|
if (TSDB_CODE_SUCCESS != code) goto end;
|
||||||
RAW_RETURN_CHECK(rewriteToVnodeModifyOpStmt(pQuery, pBufArray));
|
RAW_RETURN_CHECK(rewriteToVnodeModifyOpStmt(pQuery, pBufArray));
|
||||||
|
|
||||||
(void)launchQueryImpl(pRequest, pQuery, true, NULL);
|
launchQueryImpl(pRequest, pQuery, true, NULL);
|
||||||
if (pRequest->code == TSDB_CODE_SUCCESS) {
|
if (pRequest->code == TSDB_CODE_SUCCESS) {
|
||||||
RAW_RETURN_CHECK(removeMeta(pTscObj, pRequest->tableList, false));
|
RAW_RETURN_CHECK(removeMeta(pTscObj, pRequest->tableList, false));
|
||||||
}
|
}
|
||||||
|
@ -1510,7 +1510,7 @@ static int32_t taosAlterTable(TAOS* taos, void* meta, int32_t metaLen) {
|
||||||
if (TSDB_CODE_SUCCESS != code) goto end;
|
if (TSDB_CODE_SUCCESS != code) goto end;
|
||||||
RAW_RETURN_CHECK(rewriteToVnodeModifyOpStmt(pQuery, pArray));
|
RAW_RETURN_CHECK(rewriteToVnodeModifyOpStmt(pQuery, pArray));
|
||||||
|
|
||||||
(void)launchQueryImpl(pRequest, pQuery, true, NULL);
|
launchQueryImpl(pRequest, pQuery, true, NULL);
|
||||||
|
|
||||||
pVgData = NULL;
|
pVgData = NULL;
|
||||||
pArray = NULL;
|
pArray = NULL;
|
||||||
|
@ -1587,7 +1587,7 @@ int taos_write_raw_block_with_fields_with_reqid(TAOS* taos, int rows, char* pDat
|
||||||
RAW_RETURN_CHECK(rawBlockBindData(pQuery, pTableMeta, pData, NULL, fields, numFields, false, NULL, 0));
|
RAW_RETURN_CHECK(rawBlockBindData(pQuery, pTableMeta, pData, NULL, fields, numFields, false, NULL, 0));
|
||||||
RAW_RETURN_CHECK(smlBuildOutput(pQuery, pVgHash));
|
RAW_RETURN_CHECK(smlBuildOutput(pQuery, pVgHash));
|
||||||
|
|
||||||
(void)launchQueryImpl(pRequest, pQuery, true, NULL);
|
launchQueryImpl(pRequest, pQuery, true, NULL);
|
||||||
code = pRequest->code;
|
code = pRequest->code;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
@ -1647,7 +1647,7 @@ int taos_write_raw_block_with_reqid(TAOS* taos, int rows, char* pData, const cha
|
||||||
RAW_RETURN_CHECK(rawBlockBindData(pQuery, pTableMeta, pData, NULL, NULL, 0, false, NULL, 0));
|
RAW_RETURN_CHECK(rawBlockBindData(pQuery, pTableMeta, pData, NULL, NULL, 0, false, NULL, 0));
|
||||||
RAW_RETURN_CHECK(smlBuildOutput(pQuery, pVgHash));
|
RAW_RETURN_CHECK(smlBuildOutput(pQuery, pVgHash));
|
||||||
|
|
||||||
(void)launchQueryImpl(pRequest, pQuery, true, NULL);
|
launchQueryImpl(pRequest, pQuery, true, NULL);
|
||||||
code = pRequest->code;
|
code = pRequest->code;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
@ -1766,7 +1766,7 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) {
|
||||||
|
|
||||||
RAW_RETURN_CHECK(smlBuildOutput(pQuery, pVgHash));
|
RAW_RETURN_CHECK(smlBuildOutput(pQuery, pVgHash));
|
||||||
|
|
||||||
(void)launchQueryImpl(pRequest, pQuery, true, NULL);
|
launchQueryImpl(pRequest, pQuery, true, NULL);
|
||||||
code = pRequest->code;
|
code = pRequest->code;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
@ -1935,7 +1935,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
|
||||||
|
|
||||||
RAW_RETURN_CHECK(smlBuildOutput(pQuery, pVgHash));
|
RAW_RETURN_CHECK(smlBuildOutput(pQuery, pVgHash));
|
||||||
|
|
||||||
(void)launchQueryImpl(pRequest, pQuery, true, NULL);
|
launchQueryImpl(pRequest, pQuery, true, NULL);
|
||||||
code = pRequest->code;
|
code = pRequest->code;
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
|
|
@ -538,7 +538,8 @@ static int32_t smlParseTableName(SArray *tags, char *childTableName, char *tbnam
|
||||||
// handle child table name
|
// handle child table name
|
||||||
if (childTableNameLen == tag->keyLen && strncmp(tag->key, tbnameKey, tag->keyLen) == 0) {
|
if (childTableNameLen == tag->keyLen && strncmp(tag->key, tbnameKey, tag->keyLen) == 0) {
|
||||||
(void)memset(childTableName, 0, TSDB_TABLE_NAME_LEN);
|
(void)memset(childTableName, 0, TSDB_TABLE_NAME_LEN);
|
||||||
(void)strncpy(childTableName, tag->value, (tag->length < TSDB_TABLE_NAME_LEN ? tag->length : TSDB_TABLE_NAME_LEN));
|
(void)strncpy(childTableName, tag->value,
|
||||||
|
(tag->length < TSDB_TABLE_NAME_LEN ? tag->length : TSDB_TABLE_NAME_LEN));
|
||||||
if (tsSmlDot2Underline) {
|
if (tsSmlDot2Underline) {
|
||||||
smlStrReplace(childTableName, strlen(childTableName));
|
smlStrReplace(childTableName, strlen(childTableName));
|
||||||
}
|
}
|
||||||
|
@ -906,8 +907,8 @@ static int32_t smlFindNearestPowerOf2(int32_t length, uint8_t type) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t smlProcessSchemaAction(SSmlHandle *info, SSchema *schemaField, SHashObj *schemaHash, SArray *cols, SArray *checkDumplicateCols,
|
static int32_t smlProcessSchemaAction(SSmlHandle *info, SSchema *schemaField, SHashObj *schemaHash, SArray *cols,
|
||||||
ESchemaAction *action, bool isTag) {
|
SArray *checkDumplicateCols, ESchemaAction *action, bool isTag) {
|
||||||
int32_t code = TSDB_CODE_SUCCESS;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
for (int j = 0; j < taosArrayGetSize(cols); ++j) {
|
for (int j = 0; j < taosArrayGetSize(cols); ++j) {
|
||||||
if (j == 0 && !isTag) continue;
|
if (j == 0 && !isTag) continue;
|
||||||
|
@ -1144,7 +1145,7 @@ static int32_t smlSendMetaMsg(SSmlHandle *info, SName *pName, SArray *pColumns,
|
||||||
pQuery.msgType = pQuery.pCmdMsg->msgType;
|
pQuery.msgType = pQuery.pCmdMsg->msgType;
|
||||||
pQuery.stableQuery = true;
|
pQuery.stableQuery = true;
|
||||||
|
|
||||||
(void)launchQueryImpl(pRequest, &pQuery, true, NULL); // no need to check return value
|
launchQueryImpl(pRequest, &pQuery, true, NULL); // no need to check return value
|
||||||
|
|
||||||
if (pRequest->code == TSDB_CODE_SUCCESS) {
|
if (pRequest->code == TSDB_CODE_SUCCESS) {
|
||||||
code = catalogRemoveTableMeta(info->pCatalog, pName);
|
code = catalogRemoveTableMeta(info->pCatalog, pName);
|
||||||
|
@ -1246,7 +1247,6 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
} else if (code == TSDB_CODE_SUCCESS) {
|
} else if (code == TSDB_CODE_SUCCESS) {
|
||||||
|
|
||||||
if (smlIsPKTable(pTableMeta)) {
|
if (smlIsPKTable(pTableMeta)) {
|
||||||
code = TSDB_CODE_SML_NOT_SUPPORT_PK;
|
code = TSDB_CODE_SML_NOT_SUPPORT_PK;
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -1267,7 +1267,8 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ESchemaAction action = SCHEMA_ACTION_NULL;
|
ESchemaAction action = SCHEMA_ACTION_NULL;
|
||||||
code = smlProcessSchemaAction(info, pTableMeta->schema, hashTmp, sTableData->tags, sTableData->cols, &action, true);
|
code =
|
||||||
|
smlProcessSchemaAction(info, pTableMeta->schema, hashTmp, sTableData->tags, sTableData->cols, &action, true);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -1363,7 +1364,8 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
action = SCHEMA_ACTION_NULL;
|
action = SCHEMA_ACTION_NULL;
|
||||||
code = smlProcessSchemaAction(info, pTableMeta->schema, hashTmp, sTableData->cols, sTableData->tags, &action, false);
|
code =
|
||||||
|
smlProcessSchemaAction(info, pTableMeta->schema, hashTmp, sTableData->cols, sTableData->tags, &action, false);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
@ -1512,7 +1514,8 @@ static int32_t smlInsertMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t smlUpdateMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols, bool isTag, SSmlMsgBuf *msg, SHashObj* checkDuplicate) {
|
static int32_t smlUpdateMeta(SHashObj *metaHash, SArray *metaArray, SArray *cols, bool isTag, SSmlMsgBuf *msg,
|
||||||
|
SHashObj *checkDuplicate) {
|
||||||
for (int i = 0; i < taosArrayGetSize(cols); ++i) {
|
for (int i = 0; i < taosArrayGetSize(cols); ++i) {
|
||||||
SSmlKv *kv = (SSmlKv *)taosArrayGet(cols, i);
|
SSmlKv *kv = (SSmlKv *)taosArrayGet(cols, i);
|
||||||
if (kv == NULL) {
|
if (kv == NULL) {
|
||||||
|
@ -1759,9 +1762,11 @@ static int32_t smlParseLineBottom(SSmlHandle *info) {
|
||||||
if (tableMeta) { // update meta
|
if (tableMeta) { // update meta
|
||||||
uDebug("SML:0x%" PRIx64 " smlParseLineBottom update meta, format:%d, linenum:%d", info->id, info->dataFormat,
|
uDebug("SML:0x%" PRIx64 " smlParseLineBottom update meta, format:%d, linenum:%d", info->id, info->dataFormat,
|
||||||
info->lineNum);
|
info->lineNum);
|
||||||
ret = smlUpdateMeta((*tableMeta)->colHash, (*tableMeta)->cols, elements->colArray, false, &info->msgBuf, (*tableMeta)->tagHash);
|
ret = smlUpdateMeta((*tableMeta)->colHash, (*tableMeta)->cols, elements->colArray, false, &info->msgBuf,
|
||||||
|
(*tableMeta)->tagHash);
|
||||||
if (ret == TSDB_CODE_SUCCESS) {
|
if (ret == TSDB_CODE_SUCCESS) {
|
||||||
ret = smlUpdateMeta((*tableMeta)->tagHash, (*tableMeta)->tags, tinfo->tags, true, &info->msgBuf, (*tableMeta)->colHash);
|
ret = smlUpdateMeta((*tableMeta)->tagHash, (*tableMeta)->tags, tinfo->tags, true, &info->msgBuf,
|
||||||
|
(*tableMeta)->colHash);
|
||||||
}
|
}
|
||||||
if (ret != TSDB_CODE_SUCCESS) {
|
if (ret != TSDB_CODE_SUCCESS) {
|
||||||
uError("SML:0x%" PRIx64 " smlUpdateMeta failed, ret:%d", info->id, ret);
|
uError("SML:0x%" PRIx64 " smlUpdateMeta failed, ret:%d", info->id, ret);
|
||||||
|
@ -1906,7 +1911,7 @@ static int32_t smlInsertData(SSmlHandle *info) {
|
||||||
SAppClusterSummary *pActivity = &info->taos->pAppInfo->summary;
|
SAppClusterSummary *pActivity = &info->taos->pAppInfo->summary;
|
||||||
(void)atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertsReq, 1); // no need to check return code
|
(void)atomic_add_fetch_64((int64_t *)&pActivity->numOfInsertsReq, 1); // no need to check return code
|
||||||
|
|
||||||
(void)launchQueryImpl(info->pRequest, info->pQuery, true, NULL); // no need to check return code
|
launchQueryImpl(info->pRequest, info->pQuery, true, NULL); // no need to check return code
|
||||||
|
|
||||||
uDebug("SML:0x%" PRIx64 " smlInsertData end, format:%d, code:%d,%s", info->id, info->dataFormat, info->pRequest->code,
|
uDebug("SML:0x%" PRIx64 " smlInsertData end, format:%d, code:%d,%s", info->id, info->dataFormat, info->pRequest->code,
|
||||||
tstrerror(info->pRequest->code));
|
tstrerror(info->pRequest->code));
|
||||||
|
@ -2306,14 +2311,17 @@ static void getRawLineLen(char *lines, int len, int32_t *totalRows, int protocol
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid_tbname_key(TAOS *taos, char *lines, int len, int32_t *totalRows,
|
TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid_tbname_key(TAOS *taos, char *lines, int len, int32_t *totalRows,
|
||||||
int protocol, int precision, int32_t ttl, int64_t reqid, char *tbnameKey){
|
int protocol, int precision, int32_t ttl, int64_t reqid,
|
||||||
|
char *tbnameKey) {
|
||||||
getRawLineLen(lines, len, totalRows, protocol);
|
getRawLineLen(lines, len, totalRows, protocol);
|
||||||
return taos_schemaless_insert_inner(taos, NULL, lines, lines + len, *totalRows, protocol, precision, ttl, reqid, tbnameKey);
|
return taos_schemaless_insert_inner(taos, NULL, lines, lines + len, *totalRows, protocol, precision, ttl, reqid,
|
||||||
|
tbnameKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
|
TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
|
||||||
int precision, int32_t ttl, int64_t reqid) {
|
int precision, int32_t ttl, int64_t reqid) {
|
||||||
return taos_schemaless_insert_raw_ttl_with_reqid_tbname_key(taos, lines, len, totalRows, protocol, precision, ttl, reqid, NULL);
|
return taos_schemaless_insert_raw_ttl_with_reqid_tbname_key(taos, lines, len, totalRows, protocol, precision, ttl,
|
||||||
|
reqid, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
TAOS_RES *taos_schemaless_insert_raw_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
|
TAOS_RES *taos_schemaless_insert_raw_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
|
||||||
|
|
|
@ -1216,7 +1216,6 @@ int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) {
|
||||||
|
|
||||||
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_BIND));
|
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_BIND));
|
||||||
|
|
||||||
|
|
||||||
if (pStmt->bInfo.needParse && pStmt->sql.runTimes && pStmt->sql.type > 0 &&
|
if (pStmt->bInfo.needParse && pStmt->sql.runTimes && pStmt->sql.type > 0 &&
|
||||||
STMT_TYPE_MULTI_INSERT != pStmt->sql.type) {
|
STMT_TYPE_MULTI_INSERT != pStmt->sql.type) {
|
||||||
pStmt->bInfo.needParse = false;
|
pStmt->bInfo.needParse = false;
|
||||||
|
@ -1549,7 +1548,7 @@ int stmtExec(TAOS_STMT* stmt) {
|
||||||
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_EXECUTE));
|
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_EXECUTE));
|
||||||
|
|
||||||
if (STMT_TYPE_QUERY == pStmt->sql.type) {
|
if (STMT_TYPE_QUERY == pStmt->sql.type) {
|
||||||
(void)launchQueryImpl(pStmt->exec.pRequest, pStmt->sql.pQuery, true, NULL);
|
launchQueryImpl(pStmt->exec.pRequest, pStmt->sql.pQuery, true, NULL);
|
||||||
} else {
|
} else {
|
||||||
if (pStmt->sql.stbInterlaceMode) {
|
if (pStmt->sql.stbInterlaceMode) {
|
||||||
int64_t startTs = taosGetTimestampUs();
|
int64_t startTs = taosGetTimestampUs();
|
||||||
|
@ -1571,7 +1570,7 @@ int stmtExec(TAOS_STMT* stmt) {
|
||||||
STMT_ERR_RET(qBuildStmtOutput(pStmt->sql.pQuery, pStmt->sql.pVgHash, pStmt->exec.pBlockHash));
|
STMT_ERR_RET(qBuildStmtOutput(pStmt->sql.pQuery, pStmt->sql.pVgHash, pStmt->exec.pBlockHash));
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)launchQueryImpl(pStmt->exec.pRequest, pStmt->sql.pQuery, true, NULL);
|
launchQueryImpl(pStmt->exec.pRequest, pStmt->sql.pQuery, true, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pStmt->exec.pRequest->code && NEED_CLIENT_HANDLE_ERROR(pStmt->exec.pRequest->code)) {
|
if (pStmt->exec.pRequest->code && NEED_CLIENT_HANDLE_ERROR(pStmt->exec.pRequest->code)) {
|
||||||
|
|
|
@ -1645,7 +1645,7 @@ int stmtExec2(TAOS_STMT2* stmt, int* affected_rows) {
|
||||||
__taos_async_fn_t fp = pStmt->options.asyncExecFn;
|
__taos_async_fn_t fp = pStmt->options.asyncExecFn;
|
||||||
|
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
(void)launchQueryImpl(pStmt->exec.pRequest, pStmt->sql.pQuery, true, NULL);
|
launchQueryImpl(pStmt->exec.pRequest, pStmt->sql.pQuery, true, NULL);
|
||||||
|
|
||||||
if (pStmt->exec.pRequest->code && NEED_CLIENT_HANDLE_ERROR(pStmt->exec.pRequest->code)) {
|
if (pStmt->exec.pRequest->code && NEED_CLIENT_HANDLE_ERROR(pStmt->exec.pRequest->code)) {
|
||||||
code = refreshMeta(pStmt->exec.pRequest->pTscObj, pStmt->exec.pRequest);
|
code = refreshMeta(pStmt->exec.pRequest->pTscObj, pStmt->exec.pRequest);
|
||||||
|
|
|
@ -63,13 +63,10 @@ int32_t s3Begin() {
|
||||||
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void s3End() { (void)S3_deinitialize(); }
|
void s3End() { S3_deinitialize(); }
|
||||||
|
|
||||||
int32_t s3Init() { TAOS_RETURN(TSDB_CODE_SUCCESS); /*s3Begin();*/ }
|
int32_t s3Init() { TAOS_RETURN(TSDB_CODE_SUCCESS); /*s3Begin();*/ }
|
||||||
|
|
||||||
void s3CleanUp() { /*s3End();*/
|
|
||||||
}
|
|
||||||
|
|
||||||
static int32_t s3ListBucket(char const *bucketname);
|
static int32_t s3ListBucket(char const *bucketname);
|
||||||
|
|
||||||
static void s3DumpCfgByEp(int8_t epIndex) {
|
static void s3DumpCfgByEp(int8_t epIndex) {
|
||||||
|
@ -506,7 +503,9 @@ S3Status initial_multipart_callback(const char *upload_id, void *callbackData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
S3Status MultipartResponseProperiesCallback(const S3ResponseProperties *properties, void *callbackData) {
|
S3Status MultipartResponseProperiesCallback(const S3ResponseProperties *properties, void *callbackData) {
|
||||||
(void)responsePropertiesCallbackNull(properties, callbackData);
|
if (S3StatusOK != responsePropertiesCallbackNull(properties, callbackData)) {
|
||||||
|
uError("%s failed at line %d to process null callback.", __func__, __LINE__);
|
||||||
|
}
|
||||||
|
|
||||||
MultipartPartData *data = (MultipartPartData *)callbackData;
|
MultipartPartData *data = (MultipartPartData *)callbackData;
|
||||||
int seq = data->seq;
|
int seq = data->seq;
|
||||||
|
@ -517,7 +516,9 @@ S3Status MultipartResponseProperiesCallback(const S3ResponseProperties *properti
|
||||||
}
|
}
|
||||||
|
|
||||||
S3Status MultipartResponseProperiesCallbackWithCp(const S3ResponseProperties *properties, void *callbackData) {
|
S3Status MultipartResponseProperiesCallbackWithCp(const S3ResponseProperties *properties, void *callbackData) {
|
||||||
(void)responsePropertiesCallbackNull(properties, callbackData);
|
if (S3StatusOK != responsePropertiesCallbackNull(properties, callbackData)) {
|
||||||
|
uError("%s failed at line %d to process null callback.", __func__, __LINE__);
|
||||||
|
}
|
||||||
|
|
||||||
MultipartPartData *data = (MultipartPartData *)callbackData;
|
MultipartPartData *data = (MultipartPartData *)callbackData;
|
||||||
int seq = data->seq;
|
int seq = data->seq;
|
||||||
|
@ -950,7 +951,9 @@ _exit:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cp.thefile) {
|
if (cp.thefile) {
|
||||||
(void)cos_cp_close(cp.thefile);
|
if (cos_cp_close(cp.thefile)) {
|
||||||
|
uError("%s failed at line %d to close cp file.", __func__, lino);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (cp.parts) {
|
if (cp.parts) {
|
||||||
taosMemoryFree(cp.parts);
|
taosMemoryFree(cp.parts);
|
||||||
|
@ -1290,7 +1293,10 @@ int32_t s3DeleteObjects(const char *object_name[], int nobject) {
|
||||||
void s3DeleteObjectsByPrefix(const char *prefix) {
|
void s3DeleteObjectsByPrefix(const char *prefix) {
|
||||||
SArray *objectArray = getListByPrefix(prefix);
|
SArray *objectArray = getListByPrefix(prefix);
|
||||||
if (objectArray == NULL) return;
|
if (objectArray == NULL) return;
|
||||||
(void)s3DeleteObjects(TARRAY_DATA(objectArray), TARRAY_SIZE(objectArray));
|
int32_t code = s3DeleteObjects(TARRAY_DATA(objectArray), TARRAY_SIZE(objectArray));
|
||||||
|
if (!code) {
|
||||||
|
uError("%s failed at line %d since %s.", __func__, __LINE__, tstrerror(code));
|
||||||
|
}
|
||||||
taosArrayDestroyEx(objectArray, s3FreeObjectKey);
|
taosArrayDestroyEx(objectArray, s3FreeObjectKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1537,7 +1543,7 @@ int32_t s3Init() {
|
||||||
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
TAOS_RETURN(TSDB_CODE_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void s3CleanUp() { cos_http_io_deinitialize(); }
|
// void s3CleanUp() { cos_http_io_deinitialize(); }
|
||||||
|
|
||||||
static void log_status(cos_status_t *s) {
|
static void log_status(cos_status_t *s) {
|
||||||
cos_warn_log("status->code: %d", s->code);
|
cos_warn_log("status->code: %d", s->code);
|
||||||
|
@ -1961,7 +1967,6 @@ long s3Size(const char *object_name) {
|
||||||
#else
|
#else
|
||||||
|
|
||||||
int32_t s3Init() { return 0; }
|
int32_t s3Init() { return 0; }
|
||||||
void s3CleanUp() {}
|
|
||||||
int32_t s3PutObjectFromFile(const char *file, const char *object) { return 0; }
|
int32_t s3PutObjectFromFile(const char *file, const char *object) { return 0; }
|
||||||
int32_t s3PutObjectFromFile2(const char *file, const char *object, int8_t withcp) { return 0; }
|
int32_t s3PutObjectFromFile2(const char *file, const char *object, int8_t withcp) { return 0; }
|
||||||
int32_t s3PutObjectFromFileOffset(const char *file, const char *object_name, int64_t offset, int64_t size) { return 0; }
|
int32_t s3PutObjectFromFileOffset(const char *file, const char *object_name, int64_t offset, int64_t size) { return 0; }
|
||||||
|
|
|
@ -309,7 +309,7 @@ int32_t cos_cp_dump(SCheckpoint* cp) {
|
||||||
if (!item) {
|
if (!item) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
||||||
}
|
}
|
||||||
cJSON_AddItemToArray(ajson, item);
|
if (!cJSON_AddItemToArray(ajson, item)) goto _exit;
|
||||||
|
|
||||||
if (NULL == cJSON_AddNumberToObject(item, "index", cp->parts[i].index)) {
|
if (NULL == cJSON_AddNumberToObject(item, "index", cp->parts[i].index)) {
|
||||||
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, &lino, _exit);
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
// }
|
// }
|
||||||
// strcpy(tsSnodeAddress, "127.0.0.1");
|
// strcpy(tsSnodeAddress, "127.0.0.1");
|
||||||
// int ret = RUN_ALL_TESTS();
|
// int ret = RUN_ALL_TESTS();
|
||||||
// s3CleanUp();
|
|
||||||
// return ret;
|
// return ret;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue