Merge branch '3.0' into enh/TS-5297-3.0

This commit is contained in:
kailixu 2024-08-31 12:43:09 +08:00
commit ffa62193f8
122 changed files with 2060 additions and 248 deletions

View File

@ -39,7 +39,6 @@ typedef void (*_ref_fn_t)(const void *pObj);
// set the initial reference count value
#define T_REF_INIT_VAL(x, _v) \
do { \
assert(_v >= 0); \
atomic_store_32(&((x)->_ref.val), (_v)); \
} while (0)
@ -64,8 +63,6 @@ typedef void (*_ref_fn_t)(const void *pObj);
} \
} while (0)
#define T_REF_VAL_CHECK(x) assert((x)->_ref.val >= 0);
#define T_REF_VAL_GET(x) (x)->_ref.val
// single writer multiple reader lock

View File

@ -933,7 +933,7 @@ void taos_init_imp(void) {
appInfo.pInstMapByClusterId =
taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), true, HASH_ENTRY_LOCK);
if (NULL == appInfo.pInstMap || NULL == appInfo.pInstMapByClusterId) {
tscError("failed to allocate memory when init appInfo");
(void)printf("failed to allocate memory when init appInfo\n");
tscInitRes = TSDB_CODE_OUT_OF_MEMORY;
return;
}
@ -961,7 +961,7 @@ void taos_init_imp(void) {
if (InitRegexCache() != 0) {
tscInitRes = -1;
tscError("failed to init regex cache");
(void)printf("failed to init regex cache\n");
return;
}

View File

@ -485,27 +485,27 @@ static int32_t taosLoadCfg(SConfig *pCfg, const char **envCmd, const char *input
}
if ((code = cfgLoad(pCfg, CFG_STYPE_APOLLO_URL, apolloUrl)) != 0) {
uError("failed to load from apollo url:%s since %s", apolloUrl, tstrerror(code));
(void)printf("failed to load from apollo url:%s since %s\n", apolloUrl, tstrerror(code));
TAOS_RETURN(code);
}
if ((code = cfgLoad(pCfg, CFG_STYPE_CFG_FILE, cfgFile)) != 0) {
uError("failed to load from cfg file:%s since %s", cfgFile, tstrerror(code));
(void)printf("failed to load from cfg file:%s since %s\n", cfgFile, tstrerror(code));
TAOS_RETURN(code);
}
if ((code = cfgLoad(pCfg, CFG_STYPE_ENV_FILE, envFile)) != 0) {
uError("failed to load from env file:%s since %s", envFile, tstrerror(code));
(void)printf("failed to load from env file:%s since %s\n", envFile, tstrerror(code));
TAOS_RETURN(code);
}
if ((code = cfgLoad(pCfg, CFG_STYPE_ENV_VAR, NULL)) != 0) {
uError("failed to load from global env variables since %s", tstrerror(code));
(void)printf("failed to load from global env variables since %s\n", tstrerror(code));
TAOS_RETURN(code);
}
if ((code = cfgLoad(pCfg, CFG_STYPE_ENV_CMD, envCmd)) != 0) {
uError("failed to load from cmd env variables since %s", tstrerror(code));
(void)printf("failed to load from cmd env variables since %s\n", tstrerror(code));
TAOS_RETURN(code);
}
@ -1648,12 +1648,12 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi
}
if ((code = taosLoadCfg(pCfg, envCmd, cfgDir, envFile, apolloUrl)) != TSDB_CODE_SUCCESS) {
printf("failed to load cfg since %s\n", tstrerror(code));
(void)printf("failed to load cfg since %s\n", tstrerror(code));
goto _exit;
}
if ((code = cfgLoadFromArray(pCfg, pArgs)) != TSDB_CODE_SUCCESS) {
printf("failed to load cfg from array since %s\n", tstrerror(code));
(void)printf("failed to load cfg from array since %s\n", tstrerror(code));
goto _exit;
}
@ -1669,18 +1669,18 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi
TAOS_CHECK_GOTO(taosSetAllDebugFlag(pCfg, pDebugItem->i32), &lino, _exit);
if ((code = taosMulModeMkDir(tsLogDir, 0777, true)) != TSDB_CODE_SUCCESS) {
printf("failed to create dir:%s since %s\n", tsLogDir, tstrerror(code));
(void)printf("failed to create dir:%s since %s\n", tsLogDir, tstrerror(code));
goto _exit;
}
if ((code = taosInitLog(logname, logFileNum, tsc)) != 0) {
printf("failed to init log file since %s\n", tstrerror(code));
(void)printf("failed to init log file since %s\n", tstrerror(code));
goto _exit;
}
_exit:
if (TSDB_CODE_SUCCESS != code) {
printf("failed to create log at %d since %s:", lino, tstrerror(code));
(void)printf("failed to create log at %d since %s\n", lino, tstrerror(code));
}
cfgCleanup(pCfg);
@ -1700,12 +1700,12 @@ int32_t taosReadDataFolder(const char *cfgDir, const char **envCmd, const char *
TAOS_CHECK_GOTO(cfgAddInt32(pCfg, "dDebugFlag", dDebugFlag, 0, 255, CFG_SCOPE_SERVER, CFG_DYN_SERVER) ,NULL, _exit);
if ((code = taosLoadCfg(pCfg, envCmd, cfgDir, envFile, apolloUrl)) != 0) {
printf("failed to load cfg since %s\n", tstrerror(code));
(void)printf("failed to load cfg since %s\n", tstrerror(code));
goto _exit;
}
if ((code = cfgLoadFromArray(pCfg, pArgs)) != 0) {
printf("failed to load cfg from array since %s\n", tstrerror(code));
(void)printf("failed to load cfg from array since %s\n", tstrerror(code));
goto _exit;
}
@ -1769,14 +1769,14 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile
TAOS_CHECK_GOTO(taosAddSystemCfg(tsCfg), &lino, _exit);
if ((code = taosLoadCfg(tsCfg, envCmd, cfgDir, envFile, apolloUrl)) != 0) {
uError("failed to load cfg since %s", tstrerror(code));
(void)printf("failed to load cfg since %s\n", tstrerror(code));
cfgCleanup(tsCfg);
tsCfg = NULL;
TAOS_RETURN(code);
}
if ((code = cfgLoadFromArray(tsCfg, pArgs)) != 0) {
uError("failed to load cfg from array since %s", tstrerror(code));
(void)printf("failed to load cfg from array since %s\n", tstrerror(code));
cfgCleanup(tsCfg);
tsCfg = NULL;
TAOS_RETURN(code);
@ -1798,7 +1798,7 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile
SConfigItem *pItem = cfgGetItem(tsCfg, "debugFlag");
if (NULL == pItem) {
uError("debugFlag not found in cfg");
(void)printf("debugFlag not found in cfg\n");
TAOS_RETURN(TSDB_CODE_CFG_NOT_FOUND);
}
TAOS_CHECK_GOTO(taosSetAllDebugFlag(tsCfg, pItem->i32), &lino, _exit);
@ -1811,7 +1811,7 @@ _exit:
if (TSDB_CODE_SUCCESS != code) {
cfgCleanup(tsCfg);
tsCfg = NULL;
uError("failed to init cfg at %d since %s", lino, tstrerror(code));
(void)printf("failed to init cfg at %d since %s\n", lino, tstrerror(code));
}
TAOS_RETURN(code);

View File

@ -1316,7 +1316,7 @@ static int32_t mndRetrieveArbGroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
static void mndCancelGetNextArbGroup(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_ARBGROUP);
}
int32_t mndGetArbGroupSize(SMnode *pMnode) {

View File

@ -346,7 +346,7 @@ _OVER:
static void mndCancelGetNextCluster(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_CLUSTER);
}
static int32_t mndProcessUptimeTimer(SRpcMsg *pReq) {

View File

@ -1003,7 +1003,7 @@ END:
static void mndCancelGetNextConsumer(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_CONSUMER);
}
const char *mndConsumerStatusName(int status) {

View File

@ -2522,5 +2522,5 @@ static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc
static void mndCancelGetNextDb(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_DB);
}

View File

@ -1814,7 +1814,7 @@ static int32_t mndRetrieveDnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
static void mndCancelGetNextDnode(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_DNODE);
}
// get int32_t value from 'SMCfgDnodeReq'

View File

@ -719,5 +719,5 @@ static int32_t mndRetrieveFuncs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
static void mndCancelGetNextFunc(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_FUNC);
}

View File

@ -935,7 +935,7 @@ _out:
static void mndCancelGetNextMnode(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_MNODE);
}
static int32_t mndProcessAlterMnodeReq(SRpcMsg *pReq) {

View File

@ -582,5 +582,5 @@ static int32_t mndRetrieveQnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
static void mndCancelGetNextQnode(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_QNODE);
}

View File

@ -1520,7 +1520,7 @@ static void mndCancelRetrieveIdx(SMnode *pMnode, void *pIter) {
SSmaAndTagIter *p = pIter;
if (p != NULL) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, p->pSmaIter);
sdbCancelFetchByType(pSdb, p->pSmaIter, SDB_SMA);
sdbCancelFetchByType(pSdb, p->pIdxIter, SDB_IDX);
}
taosMemoryFree(p);
@ -2288,7 +2288,7 @@ static void mndCancelRetrieveTSMA(SMnode *pMnode, void *pIter) {
SSmaAndTagIter *p = pIter;
if (p != NULL) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, p->pSmaIter);
sdbCancelFetchByType(pSdb, p->pSmaIter, SDB_SMA);
}
taosMemoryFree(p);
}

View File

@ -504,5 +504,5 @@ static int32_t mndRetrieveSnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
static void mndCancelGetNextSnode(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_SNODE);
}

View File

@ -3832,7 +3832,7 @@ static int32_t mndRetrieveStbCol(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
static void mndCancelGetNextStb(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_STB);
}
const char *mndGetStbStr(const char *src) {

View File

@ -1651,7 +1651,7 @@ static int32_t mndRetrieveStream(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
static void mndCancelGetNextStream(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_STREAM);
}
static int32_t mndRetrieveStreamTask(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rowsCapacity) {
@ -1723,7 +1723,7 @@ static int32_t mndRetrieveStreamTask(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
static void mndCancelGetNextStreamTask(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_STREAM);
}
static int32_t mndProcessPauseStreamReq(SRpcMsg *pReq) {

View File

@ -1484,5 +1484,5 @@ END:
void mndCancelGetNextSubscribe(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_SUBSCRIBE);
}

View File

@ -934,7 +934,7 @@ END:
static void mndCancelGetNextTopic(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_TOPIC);
}
bool mndTopicExistsForDb(SMnode *pMnode, SDbObj *pDb) {

View File

@ -1997,5 +1997,5 @@ static int32_t mndRetrieveTrans(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBl
static void mndCancelGetNextTrans(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_TRANS);
}

View File

@ -2772,7 +2772,7 @@ _exit:
static void mndCancelGetNextUser(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_USER);
}
static int32_t mndLoopHash(SHashObj *hash, char *priType, SSDataBlock *pBlock, int32_t *pNumOfRows, SSdb *pSdb,
@ -3124,7 +3124,7 @@ _exit:
static void mndCancelGetNextPrivileges(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_USER);
}
int32_t mndValidateUserAuthInfo(SMnode *pMnode, SUserAuthVersion *pUsers, int32_t numOfUses, void **ppRsp,

View File

@ -1077,7 +1077,7 @@ static int32_t mndRetrieveVgroups(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *p
static void mndCancelGetNextVgroup(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_VGROUP);
}
static bool mndGetVnodesNumFp(SMnode *pMnode, void *pObj, void *p1, void *p2, void *p3) {
@ -1212,7 +1212,7 @@ static int32_t mndRetrieveVnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
static void mndCancelGetNextVnode(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_VGROUP);
}
static int32_t mndAddVnodeToVgroup(SMnode *pMnode, STrans *pTrans, SVgObj *pVgroup, SArray *pArray) {

View File

@ -99,5 +99,5 @@ int32_t mndRetrieveView(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int
void mndCancelGetNextView(SMnode *pMnode, void *pIter) {
SSdb *pSdb = pMnode->pSdb;
sdbCancelFetch(pSdb, pIter);
sdbCancelFetchByType(pSdb, pIter, SDB_VIEW);
}

View File

@ -242,7 +242,12 @@ static int32_t sdbDeleteRow(SSdb *pSdb, SHashObj *hash, SSdbRaw *pRaw, SSdbRow *
(void)atomic_add_fetch_32(&pOldRow->refCount, 1);
sdbPrintOper(pSdb, pOldRow, "delete");
TAOS_CHECK_RETURN(taosHashRemove(hash, pOldRow->pObj, keySize));
if (taosHashRemove(hash, pOldRow->pObj, keySize) != 0) {
sdbUnLock(pSdb, type);
sdbFreeRow(pSdb, pRow, false);
terrno = TSDB_CODE_SDB_OBJ_NOT_THERE;
return terrno;
}
pSdb->tableVer[pOldRow->type]++;
sdbUnLock(pSdb, type);

View File

@ -2258,6 +2258,7 @@ static int32_t lastIterOpen(SFSLastIter *iter, STFileSet *pFileSet, STsdb *pTsdb
int32_t code = 0;
destroySttBlockReader(pr->pLDataIterArray, NULL);
pr->pLDataIterArray = taosArrayInit(4, POINTER_BYTES);
if (pr->pLDataIterArray == NULL) return terrno;
SMergeTreeConf conf = {
.uid = uid,

View File

@ -723,6 +723,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
while (1) {
int32_t code = getNextBrinRecord(&iter, &pRecord);
if (code != TSDB_CODE_SUCCESS) {
clearBrinBlockIter(&iter);
return code;
}
@ -757,12 +758,14 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
if (!(pRecord->suid == pReader->info.suid && uid == pRecord->uid)) {
tsdbError("tsdb failed at: %s:%d", __func__, __LINE__);
clearBrinBlockIter(&iter);
return TSDB_CODE_INTERNAL_ERROR;
}
STableBlockScanInfo* pScanInfo = NULL;
code = getTableBlockScanInfo(pReader->status.pTableMap, uid, &pScanInfo, pReader->idStr);
if (code != TSDB_CODE_SUCCESS) {
clearBrinBlockIter(&iter);
return code;
}
@ -807,6 +810,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
if (pScanInfo->pBlockList == NULL) {
pScanInfo->pBlockList = taosArrayInit(4, sizeof(SFileDataBlockInfo));
if (pScanInfo->pBlockList == NULL) {
clearBrinBlockIter(&iter);
return TSDB_CODE_OUT_OF_MEMORY;
}
}
@ -814,6 +818,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
if (pScanInfo->pBlockIdxList == NULL) {
pScanInfo->pBlockIdxList = taosArrayInit(4, sizeof(STableDataBlockIdx));
if (pScanInfo->pBlockIdxList == NULL) {
clearBrinBlockIter(&iter);
return TSDB_CODE_OUT_OF_MEMORY;
}
}
@ -822,6 +827,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
recordToBlockInfo(&blockInfo, pRecord);
void* p1 = taosArrayPush(pScanInfo->pBlockList, &blockInfo);
if (p1 == NULL) {
clearBrinBlockIter(&iter);
return TSDB_CODE_OUT_OF_MEMORY;
}
@ -840,6 +846,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
} else {
STableBlockScanInfo** p = taosArrayGetLast(pTableScanInfoList);
if (p == NULL) {
clearBrinBlockIter(&iter);
return TSDB_CODE_INVALID_PARA;
}
@ -849,6 +856,7 @@ static int32_t loadFileBlockBrinInfo(STsdbReader* pReader, SArray* pIndexList, S
}
if (p1 == NULL) {
clearBrinBlockIter(&iter);
return TSDB_CODE_OUT_OF_MEMORY;
}
}

View File

@ -254,17 +254,17 @@ static int32_t getSortedBlockData(SSortHandle* pHandle, SSDataBlock* pDataBlock,
SSortOperatorInfo* pInfo, SSDataBlock** pResBlock) {
QRY_OPTR_CHECK(pResBlock);
blockDataCleanup(pDataBlock);
int32_t lino = 0;
int32_t code = 0;
SSDataBlock* p = NULL;
int32_t code = tsortGetSortedDataBlock(pHandle, &p);
code = tsortGetSortedDataBlock(pHandle, &p);
if (p == NULL || (code != 0)) {
return code;
}
code = blockDataEnsureCapacity(p, capacity);
if (code) {
return code;
}
QUERY_CHECK_CODE(code, lino, _error);
STupleHandle* pTupleHandle;
while (1) {
@ -273,51 +273,40 @@ static int32_t getSortedBlockData(SSortHandle* pHandle, SSDataBlock* pDataBlock,
} else {
code = tsortNextTuple(pHandle, &pTupleHandle);
}
if (pTupleHandle == NULL || code != 0) {
lino = __LINE__;
break;
}
code = appendOneRowToDataBlock(p, pTupleHandle);
if (code) {
return code;
}
QUERY_CHECK_CODE(code, lino, _error);
if (p->info.rows >= capacity) {
break;
}
}
if (TSDB_CODE_SUCCESS != code) {
return code;
}
QUERY_CHECK_CODE(code, lino, _error);
if (p->info.rows > 0) {
code = blockDataEnsureCapacity(pDataBlock, capacity);
if (code) {
return code;
}
QUERY_CHECK_CODE(code, lino, _error);
// todo extract function to handle this
int32_t numOfCols = taosArrayGetSize(pColMatchInfo);
for (int32_t i = 0; i < numOfCols; ++i) {
SColMatchItem* pmInfo = taosArrayGet(pColMatchInfo, i);
if (pmInfo == NULL) {
return terrno;
}
QUERY_CHECK_NULL(pmInfo, code, lino, _error, terrno);
SColumnInfoData* pSrc = taosArrayGet(p->pDataBlock, pmInfo->srcSlotId);
if (pSrc == NULL) {
return terrno;
}
QUERY_CHECK_NULL(pSrc, code, lino, _error, terrno);
SColumnInfoData* pDst = taosArrayGet(pDataBlock->pDataBlock, pmInfo->dstSlotId);
if (pDst == NULL) {
return terrno;
}
QUERY_CHECK_NULL(pDst, code, lino, _error, terrno);
code = colDataAssign(pDst, pSrc, p->info.rows, &pDataBlock->info);
if (code) {
return code;
}
QUERY_CHECK_CODE(code, lino, _error);
}
pDataBlock->info.dataLoad = 1;
@ -329,6 +318,12 @@ static int32_t getSortedBlockData(SSortHandle* pHandle, SSDataBlock* pDataBlock,
blockDataDestroy(p);
*pResBlock = (pDataBlock->info.rows > 0) ? pDataBlock : NULL;
return code;
_error:
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
blockDataDestroy(p);
return code;
}
int32_t loadNextDataBlock(void* param, SSDataBlock** ppBlock) {
@ -384,13 +379,13 @@ int32_t doOpenSortOperator(SOperatorInfo* pOperator) {
code = tsortOpen(pInfo->pSortHandle);
if (code != TSDB_CODE_SUCCESS) {
T_LONG_JMP(pTaskInfo->env, code);
pTaskInfo->code = code;
} else {
pOperator->cost.openCost = (taosGetTimestampUs() - pInfo->startTs) / 1000.0;
pOperator->status = OP_RES_TO_RETURN;
OPTR_SET_OPENED(pOperator);
}
pOperator->cost.openCost = (taosGetTimestampUs() - pInfo->startTs) / 1000.0;
pOperator->status = OP_RES_TO_RETURN;
OPTR_SET_OPENED(pOperator);
return code;
}
@ -735,6 +730,7 @@ int32_t doGroupSort(SOperatorInfo* pOperator, SSDataBlock** pResBlock) {
qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
T_LONG_JMP(pOperator->pTaskInfo->env, code);
}
code = getGroupSortedBlockData(pInfo->pCurrSortHandle, pInfo->binfo.pRes, pOperator->resultInfo.capacity,
pInfo->matchInfo.pList, pInfo, &pBlock);
if (pBlock != NULL && (code == 0)) {

View File

@ -286,23 +286,19 @@ int32_t tsortCreateSortHandle(SArray* pSortInfo, int32_t type, int32_t pageSize,
SSDataBlock* pBlock, const char* idstr, uint64_t pqMaxRows, uint32_t pqMaxTupleLength,
uint32_t pqSortBufSize, SSortHandle** pHandle) {
int32_t code = 0;
*pHandle = NULL;
int32_t lino = 0;
QRY_OPTR_CHECK(pHandle);
SSortHandle* pSortHandle = taosMemoryCalloc(1, sizeof(SSortHandle));
if (pSortHandle == NULL) {
return TSDB_CODE_OUT_OF_MEMORY;
}
QUERY_CHECK_NULL(pSortHandle, code, lino, _err, terrno);
pSortHandle->type = type;
pSortHandle->pageSize = pageSize;
pSortHandle->numOfPages = numOfPages;
pSortHandle->pSortInfo = taosArrayDup(pSortInfo, NULL);
if (pSortHandle->pSortInfo == NULL) {
return terrno;
}
QUERY_CHECK_NULL(pSortHandle->pSortInfo, code, lino, _err, terrno);
pSortHandle->loops = 0;
pSortHandle->pqMaxTupleLength = pqMaxTupleLength;
if (pqMaxRows != 0) {
pSortHandle->pqSortBufSize = pqSortBufSize;
@ -312,18 +308,13 @@ int32_t tsortCreateSortHandle(SArray* pSortInfo, int32_t type, int32_t pageSize,
pSortHandle->forceUsePQSort = false;
if (pBlock != NULL) {
code = createOneDataBlock(pBlock, false, &pSortHandle->pDataBlock);
if (code) {
goto _err;
}
QUERY_CHECK_CODE(code, lino, _err);
}
pSortHandle->mergeLimit = -1;
pSortHandle->pOrderedSource = taosArrayInit(4, POINTER_BYTES);
if (pSortHandle->pOrderedSource == NULL) {
code = terrno;
goto _err;
}
QUERY_CHECK_NULL(pSortHandle->pOrderedSource, code, lino, _err, terrno);
pSortHandle->cmpParam.orderInfo = pSortInfo;
pSortHandle->cmpParam.cmpGroupId = false;
@ -346,17 +337,17 @@ int32_t tsortCreateSortHandle(SArray* pSortInfo, int32_t type, int32_t pageSize,
if (idstr != NULL) {
pSortHandle->idStr = taosStrdup(idstr);
if (pSortHandle->idStr == NULL) {
code = TSDB_CODE_OUT_OF_MEMORY;
goto _err;
}
QUERY_CHECK_NULL(pSortHandle->idStr, code, lino, _err, terrno);
}
*pHandle = pSortHandle;
return code;
_err:
tsortDestroySortHandle(pSortHandle);
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
if (pSortHandle) {
tsortDestroySortHandle(pSortHandle);
}
return code;
}

View File

@ -2426,8 +2426,12 @@ static int32_t translateToIso8601(SFunctionNode* pFunc, char* pErrBuf, int32_t l
// param1
if (numOfParams == 2) {
SValueNode* pValue = (SValueNode*)nodesListGetNode(pFunc->pParameterList, 1);
SNode* pNode = (SNode*)nodesListGetNode(pFunc->pParameterList, 1);
if (QUERY_NODE_VALUE != nodeType(pNode)) {
return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, "Not supported timzone format");
}
SValueNode* pValue = (SValueNode*)pNode;
if (!validateTimezoneFormat(pValue)) {
return buildFuncErrMsg(pErrBuf, len, TSDB_CODE_FUNC_FUNTION_ERROR, "Invalid timzone format");
}

View File

@ -1089,6 +1089,8 @@ void nodesDestroyNode(SNode* pNode) {
if (pStmt->destroyParseFileCxt) {
pStmt->destroyParseFileCxt(&pStmt->pParFileCxt);
}
(void)taosCloseFile(&pStmt->fp);
break;
}
case QUERY_NODE_CREATE_DATABASE_STMT:

View File

@ -2254,7 +2254,7 @@ static int32_t parseDataFromFileImpl(SInsertParseContext* pCxt, SVnodeModifyOpSt
static int32_t parseDataFromFile(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStmt, SToken* pFilePath,
SRowsDataContext rowsDataCxt) {
char filePathStr[TSDB_FILENAME_LEN] = {0};
char filePathStr[PATH_MAX] = {0};
if (TK_NK_STRING == pFilePath->type) {
(void)trimString(pFilePath->z, pFilePath->n, filePathStr, sizeof(filePathStr));
} else {

View File

@ -5113,7 +5113,7 @@ int32_t fltOptimizeNodes(SFilterInfo *pInfo, SNode **pNode, SFltTreeStat *pStat)
FLT_ERR_JRET(fltSclCollectOperators(*pNode, sclOpList));
SArray *colRangeList = taosArrayInit(16, sizeof(SFltSclColumnRange));
if (NULL == colRangeList) {
FLT_ERR_RET(terrno);
FLT_ERR_JRET(terrno);
}
FLT_ERR_JRET(fltSclProcessCNF(sclOpList, colRangeList));
pInfo->sclCtx.fltSclRange = colRangeList;

View File

@ -766,6 +766,9 @@ static int32_t tlrtrim(char *input, char *remInput, char *output, int32_t inputT
if (remLen == 0 || remLen > orgLen) {
(void)memcpy(varDataVal(output), orgStr, orgLen);
varDataSetLen(output, orgLen);
if (needFree) {
taosMemoryFree(remStr);
}
return TSDB_CODE_SUCCESS;
}

View File

@ -585,12 +585,18 @@ void getCheckRspStatus(STaskCheckInfo* pInfo, int64_t el, int32_t* numOfReady, i
} else { // TASK_DOWNSTREAM_NOT_READY
if (p->rspTs == 0) { // not response yet
if (el >= CHECK_NOT_RSP_DURATION) { // not receive info for 10 sec.
(void)taosArrayPush(pTimeoutList, &p->taskId);
void* px = taosArrayPush(pTimeoutList, &p->taskId);
if (px == NULL) {
stError("s-task:%s failed to record time out task:0x%x", id, p->taskId);
}
} else { // el < CHECK_NOT_RSP_DURATION
(*numOfNotRsp) += 1; // do nothing and continue waiting for their rsp
}
} else {
(void)taosArrayPush(pNotReadyList, &p->taskId);
void* px = taosArrayPush(pNotReadyList, &p->taskId);
if (px == NULL) {
stError("s-task:%s failed to record not ready task:0x%x", id, p->taskId);
}
}
}
}

View File

@ -973,7 +973,10 @@ void checkpointTriggerMonitorFn(void* param, void* tmrId) {
if (!recved) { // make sure the inputQ is opened for not recv upstream checkpoint-trigger message
streamTaskOpenUpstreamInput(pTask, pInfo->taskId);
(void)taosArrayPush(pNotSendList, pInfo);
void* px = taosArrayPush(pNotSendList, pInfo);
if (px == NULL) {
stError("s-task:%s failed to record not send info, code: out of memory", id);
}
}
}

View File

@ -474,7 +474,10 @@ static void addDispatchEntry(SDispatchMsgInfo* pMsgInfo, int32_t nodeId, int64_t
streamMutexLock(&pMsgInfo->lock);
}
(void)taosArrayPush(pMsgInfo->pSendInfo, &entry);
void* p = taosArrayPush(pMsgInfo->pSendInfo, &entry);
if (p == NULL) {
stError("failed to add dispatch info");
}
if (lock) {
streamMutexUnlock(&pMsgInfo->lock);
@ -671,8 +674,8 @@ int32_t streamSearchAndAddBlock(SStreamTask* pTask, SStreamDispatchReq* pReqs, S
memcpy(bln.parTbName, pDataBlock->info.parTbName, strlen(pDataBlock->info.parTbName));
// failed to put into name buffer, no need to do anything
if (tSimpleHashGetSize(pTask->pNameMap) < MAX_BLOCK_NAME_NUM) {
(void)tSimpleHashPut(pTask->pNameMap, &groupId, sizeof(int64_t), &bln, sizeof(SBlockName));
if (tSimpleHashGetSize(pTask->pNameMap) < MAX_BLOCK_NAME_NUM) { // allow error, and do nothing
int32_t code = tSimpleHashPut(pTask->pNameMap, &groupId, sizeof(int64_t), &bln, sizeof(SBlockName));
}
}
@ -914,9 +917,13 @@ static void checkpointReadyMsgSendMonitorFn(void* param, void* tmrId) {
continue;
}
(void)taosArrayPush(pNotRspList, &pInfo->upstreamTaskId);
stDebug("s-task:%s vgId:%d level:%d checkpoint-ready rsp from upstream:0x%x not confirmed yet", id, vgId,
pTask->info.taskLevel, pInfo->upstreamTaskId);
void* p = taosArrayPush(pNotRspList, &pInfo->upstreamTaskId);
if (p == NULL) {
stError("s-task:%s vgId:%d failed to record not rsp task, code: out of memory", id, vgId);
} else {
stDebug("s-task:%s vgId:%d level:%d checkpoint-ready rsp from upstream:0x%x not confirmed yet", id, vgId,
pTask->info.taskLevel, pInfo->upstreamTaskId);
}
}
int32_t checkpointId = pActiveInfo->activeId;
@ -1100,8 +1107,17 @@ int32_t streamAddBlockIntoDispatchMsg(const SSDataBlock* pBlock, SStreamDispatch
payloadLen += sizeof(SRetrieveTableRsp);
(void)taosArrayPush(pReq->dataLen, &payloadLen);
(void)taosArrayPush(pReq->data, &buf);
void* px = taosArrayPush(pReq->dataLen, &payloadLen);
if (px == NULL) {
taosMemoryFree(buf);
return terrno;
}
px = taosArrayPush(pReq->data, &buf);
if (px == NULL) {
taosMemoryFree(buf);
return terrno;
}
pReq->totalLen += dataStrLen;
return 0;
@ -1221,8 +1237,12 @@ int32_t streamAddCheckpointSourceRspMsg(SStreamCheckpointSourceReq* pReq, SRpcHa
pTask->id.idStr, pReady->checkpointId, pReady->transId, pReq->transId, pReq->checkpointId);
}
} else {
(void)taosArrayPush(pActiveInfo->pReadyMsgList, &info);
stDebug("s-task:%s add checkpoint source rsp msg, total:%d", pTask->id.idStr, size + 1);
void* px = taosArrayPush(pActiveInfo->pReadyMsgList, &info);
if (px != NULL) {
stDebug("s-task:%s add checkpoint source rsp msg, total:%d", pTask->id.idStr, size + 1);
} else {
stError("s-task:%s failed to add readyMsg, code: out of memory", pTask->id.idStr);
}
}
streamMutexUnlock(&pActiveInfo->lock);
@ -1259,7 +1279,12 @@ int32_t streamAddCheckpointReadyMsg(SStreamTask* pTask, int32_t upstreamTaskId,
SActiveCheckpointInfo* pActiveInfo = pTask->chkInfo.pActiveInfo;
streamMutexLock(&pActiveInfo->lock);
(void)taosArrayPush(pActiveInfo->pReadyMsgList, &info);
void* px = taosArrayPush(pActiveInfo->pReadyMsgList, &info);
if (px == NULL) {
streamMutexUnlock(&pActiveInfo->lock);
stError("s-task:%s failed to add readyMsg info, code: out of memory", pTask->id.idStr);
return terrno;
}
int32_t numOfRecv = taosArrayGetSize(pActiveInfo->pReadyMsgList);
int32_t total = streamTaskGetNumOfUpstream(pTask);

View File

@ -845,7 +845,7 @@ int32_t streamMetaUnregisterTask(SStreamMeta* pMeta, int64_t streamId, int32_t t
(void)atomic_sub_fetch_32(&pMeta->numOfStreamTasks, 1);
}
(void)taosHashRemove(pMeta->pTasksMap, &id, sizeof(id));
int32_t code = taosHashRemove(pMeta->pTasksMap, &id, sizeof(id));
doRemoveIdFromList(pMeta->pTaskList, (int32_t)taosArrayGetSize(pMeta->pTaskList), &pTask->id);
(void)streamMetaRemoveTask(pMeta, &id);
@ -1013,7 +1013,10 @@ void streamMetaLoadAllTasks(SStreamMeta* pMeta) {
tFreeStreamTask(pTask);
STaskId id = streamTaskGetTaskId(pTask);
(void)taosArrayPush(pRecycleList, &id);
void* px = taosArrayPush(pRecycleList, &id);
if (px == NULL) {
stError("s-task:0x%x failed record the task into recycle list due to out of memory", taskId);
}
int32_t total = taosArrayGetSize(pRecycleList);
stDebug("s-task:0x%x is already dropped, add into recycle list, total:%d", taskId, total);
@ -1034,7 +1037,10 @@ void streamMetaLoadAllTasks(SStreamMeta* pMeta) {
continue;
}
(void)taosArrayPush(pMeta->pTaskList, &pTask->id);
void* px = taosArrayPush(pMeta->pTaskList, &pTask->id);
if (px == NULL) {
stFatal("s-task:0x%x failed to add into task list due to out of memory", pTask->id.taskId);
}
} else {
// todo this should replace the existed object put by replay creating stream task msg from mnode
stError("s-task:0x%x already added into table meta by replaying WAL, need check", pTask->id.taskId);
@ -1044,7 +1050,7 @@ void streamMetaLoadAllTasks(SStreamMeta* pMeta) {
if (taosHashPut(pMeta->pTasksMap, &id, sizeof(id), &pTask, POINTER_BYTES) != 0) {
stError("s-task:0x%x failed to put into hashTable, code:%s, continue", pTask->id.taskId, tstrerror(terrno));
(void)taosArrayPop(pMeta->pTaskList);
void* px = taosArrayPop(pMeta->pTaskList);
tFreeStreamTask(pTask);
continue;
}

View File

@ -191,7 +191,7 @@ static int32_t doHandleWaitingEvent(SStreamTaskSM* pSM, const char* pEventName,
GET_EVT_NAME(pEvtInfo->event), pSM->current.name);
// remove it
(void) taosArrayPop(pSM->pWaitingEventList);
void* px = taosArrayPop(pSM->pWaitingEventList);
STaskStateTrans* pNextTrans = streamTaskFindTransform(pSM->current.state, pEvtInfo->event);
ASSERT(pSM->pActiveTrans == NULL && pNextTrans != NULL);

View File

@ -507,6 +507,7 @@ static bool httpFailFastShoudIgnoreMsg(SHashObj* pTable, char* server, int16_t p
}
}
static void httpFailFastMayUpdate(SHashObj* pTable, char* server, int16_t port, int8_t succ) {
int32_t code = 0;
char buf[256] = {0};
sprintf(buf, "%s:%d", server, port);
@ -514,7 +515,9 @@ static void httpFailFastMayUpdate(SHashObj* pTable, char* server, int16_t port,
(void)taosHashRemove(pTable, buf, strlen(buf));
} else {
int32_t st = taosGetTimestampSec();
(void)taosHashPut(pTable, buf, strlen(buf), &st, sizeof(st));
if ((code = taosHashPut(pTable, buf, strlen(buf), &st, sizeof(st))) != 0) {
tError("http-report failed to update conn status, dst:%s, reason:%s", buf, tstrerror(code));
}
}
return;
}

View File

@ -332,6 +332,21 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) {
transQueueClear(&conn->cliMsgs);
memset(&conn->ctx, 0, sizeof(conn->ctx));
}
void cliResetTimer(SCliThrd* pThrd, SCliConn* conn) {
if (conn->timer) {
if (uv_is_active((uv_handle_t*)conn->timer)) {
tDebug("%s conn %p stop timer", CONN_GET_INST_LABEL(conn), conn);
(void)uv_timer_stop(conn->timer);
}
if (taosArrayPush(pThrd->timerList, &conn->timer) == NULL) {
tError("failed to push timer %p to list, reason:%s", conn->timer, tstrerror(TSDB_CODE_OUT_OF_MEMORY));
conn->timer = NULL;
return;
}
conn->timer->data = NULL;
conn->timer = NULL;
}
}
bool cliMaySendCachedMsg(SCliConn* conn) {
if (!transQueueEmpty(&conn->cliMsgs)) {
SCliMsg* pCliMsg = NULL;
@ -376,15 +391,7 @@ void cliHandleResp(SCliConn* conn) {
SCliThrd* pThrd = conn->hostThrd;
STrans* pTransInst = pThrd->pTransInst;
if (conn->timer) {
if (uv_is_active((uv_handle_t*)conn->timer)) {
tDebug("%s conn %p stop timer", CONN_GET_INST_LABEL(conn), conn);
(void)uv_timer_stop(conn->timer);
}
(void)taosArrayPush(pThrd->timerList, &conn->timer);
conn->timer->data = NULL;
conn->timer = NULL;
}
cliResetTimer(pThrd, conn);
STransMsgHead* pHead = NULL;
@ -593,8 +600,8 @@ void cliConnTimeout(uv_timer_t* handle) {
(void)uv_timer_stop(handle);
handle->data = NULL;
(void)taosArrayPush(pThrd->timerList, &conn->timer);
conn->timer = NULL;
cliResetTimer(pThrd, conn);
cliMayUpdateFqdnCache(pThrd->fqdn2ipCache, conn->dstAddr);
cliHandleFastFail(conn, UV_ECANCELED);
@ -643,13 +650,16 @@ void* destroyConnPool(SCliThrd* pThrd) {
}
static SCliConn* getConnFromPool(SCliThrd* pThrd, char* key, bool* exceed) {
int32_t code = 0;
void* pool = pThrd->pool;
STrans* pTranInst = pThrd->pTransInst;
size_t klen = strlen(key);
SConnList* plist = taosHashGet((SHashObj*)pool, key, klen);
if (plist == NULL) {
SConnList list = {0};
(void)taosHashPut((SHashObj*)pool, key, klen, (void*)&list, sizeof(list));
if ((code = taosHashPut((SHashObj*)pool, key, klen, (void*)&list, sizeof(list))) != 0) {
return NULL;
}
plist = taosHashGet(pool, key, klen);
SMsgList* nList = taosMemoryCalloc(1, sizeof(SMsgList));
@ -686,13 +696,17 @@ static SCliConn* getConnFromPool(SCliThrd* pThrd, char* key, bool* exceed) {
}
static SCliConn* getConnFromPool2(SCliThrd* pThrd, char* key, SCliMsg** pMsg) {
int32_t code = 0;
void* pool = pThrd->pool;
STrans* pTransInst = pThrd->pTransInst;
size_t klen = strlen(key);
SConnList* plist = taosHashGet((SHashObj*)pool, key, klen);
if (plist == NULL) {
SConnList list = {0};
(void)taosHashPut((SHashObj*)pool, key, klen, (void*)&list, sizeof(list));
if ((code = taosHashPut((SHashObj*)pool, key, klen, (void*)&list, sizeof(list))) != 0) {
tError("failed to put key %s to pool, reason:%s", key, tstrerror(code));
return NULL;
}
plist = taosHashGet(pool, key, klen);
SMsgList* nList = taosMemoryCalloc(1, sizeof(SMsgList));
@ -805,12 +819,8 @@ static void addConnToPool(void* pool, SCliConn* conn) {
}
SCliThrd* thrd = conn->hostThrd;
if (conn->timer != NULL) {
(void)uv_timer_stop(conn->timer);
(void)taosArrayPush(thrd->timerList, &conn->timer);
conn->timer->data = NULL;
conn->timer = NULL;
}
cliResetTimer(thrd, conn);
if (T_REF_VAL_GET(conn) > 1) {
transUnrefCliHandle(conn);
}
@ -1053,12 +1063,7 @@ static void cliDestroyConn(SCliConn* conn, bool clear) {
transDQCancel(pThrd->timeoutQueue, conn->task);
conn->task = NULL;
}
if (conn->timer != NULL) {
(void)uv_timer_stop(conn->timer);
conn->timer->data = NULL;
(void)taosArrayPush(pThrd->timerList, &conn->timer);
conn->timer = NULL;
}
cliResetTimer(pThrd, conn);
if (clear) {
if (!uv_is_closing((uv_handle_t*)conn->stream)) {
@ -1073,12 +1078,7 @@ static void cliDestroy(uv_handle_t* handle) {
}
SCliConn* conn = handle->data;
SCliThrd* pThrd = conn->hostThrd;
if (conn->timer != NULL) {
(void)uv_timer_stop(conn->timer);
(void)taosArrayPush(pThrd->timerList, &conn->timer);
conn->timer->data = NULL;
conn->timer = NULL;
}
cliResetTimer(pThrd, conn);
(void)atomic_sub_fetch_32(&pThrd->connCount, 1);
@ -1385,10 +1385,7 @@ static void cliHandleBatchReq(SCliBatch* pBatch, SCliThrd* pThrd) {
uint32_t ipaddr = 0;
if ((code = cliGetIpFromFqdnCache(pThrd->fqdn2ipCache, pList->ip, &ipaddr)) != 0) {
(void)uv_timer_stop(conn->timer);
conn->timer->data = NULL;
(void)taosArrayPush(pThrd->timerList, &conn->timer);
conn->timer = NULL;
cliResetTimer(pThrd, conn);
cliHandleFastFail(conn, code);
return;
}
@ -1421,10 +1418,7 @@ static void cliHandleBatchReq(SCliBatch* pBatch, SCliThrd* pThrd) {
ret = uv_tcp_connect(&conn->connReq, (uv_tcp_t*)(conn->stream), (const struct sockaddr*)&addr, cliConnCb);
if (ret != 0) {
(void)uv_timer_stop(conn->timer);
conn->timer->data = NULL;
(void)taosArrayPush(pThrd->timerList, &conn->timer);
conn->timer = NULL;
cliResetTimer(pThrd, conn);
cliMayUpdateFqdnCache(pThrd->fqdn2ipCache, conn->dstAddr);
cliHandleFastFail(conn, -1);
@ -1502,7 +1496,10 @@ static void cliHandleFastFail(SCliConn* pConn, int status) {
}
} else {
SFailFastItem item = {.count = 1, .timestamp = cTimestamp};
(void)taosHashPut(pThrd->failFastCache, pConn->dstAddr, strlen(pConn->dstAddr), &item, sizeof(SFailFastItem));
int32_t code = taosHashPut(pThrd->failFastCache, pConn->dstAddr, strlen(pConn->dstAddr), &item, sizeof(SFailFastItem));
if (code != 0) {
tError("failed to put fail-fast item to cache, reason:%s", tstrerror(code));
}
}
}
} else {
@ -1522,10 +1519,7 @@ void cliConnCb(uv_connect_t* req, int status) {
if (pConn->timer == NULL) {
timeout = true;
} else {
(void)uv_timer_stop(pConn->timer);
pConn->timer->data = NULL;
(void)taosArrayPush(pThrd->timerList, &pConn->timer);
pConn->timer = NULL;
cliResetTimer(pThrd, pConn);
}
STUB_RAND_NETWORK_ERR(status);
@ -1870,11 +1864,7 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
uint32_t ipaddr;
int32_t code = cliGetIpFromFqdnCache(pThrd->fqdn2ipCache, fqdn, &ipaddr);
if (code != 0) {
(void)uv_timer_stop(conn->timer);
conn->timer->data = NULL;
(void)taosArrayPush(pThrd->timerList, &conn->timer);
conn->timer = NULL;
cliResetTimer(pThrd, conn);
cliHandleExcept(conn, code);
return;
}
@ -1910,10 +1900,7 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
ret = uv_tcp_connect(&conn->connReq, (uv_tcp_t*)(conn->stream), (const struct sockaddr*)&addr, cliConnCb);
if (ret != 0) {
(void)uv_timer_stop(conn->timer);
conn->timer->data = NULL;
(void)taosArrayPush(pThrd->timerList, &conn->timer);
conn->timer = NULL;
cliResetTimer(pThrd, conn);
cliMayUpdateFqdnCache(pThrd->fqdn2ipCache, conn->dstAddr);
cliHandleFastFail(conn, ret);
@ -2377,7 +2364,9 @@ static int32_t createThrdObj(void* trans, SCliThrd** ppThrd) {
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
}
(void)uv_timer_init(pThrd->loop, timer);
(void)taosArrayPush(pThrd->timerList, &timer);
if (taosArrayPush(pThrd->timerList, &timer) == NULL) {
TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_MEMORY, NULL, _end);
}
}
pThrd->pool = createConnPool(4);

View File

@ -375,11 +375,10 @@ void transCtxMerge(STransCtx* dst, STransCtx* src) {
STransCtxVal* sVal = (STransCtxVal*)iter;
key = taosHashGetKey(sVal, &klen);
// STransCtxVal* dVal = taosHashGet(dst->args, key, klen);
// if (dVal) {
// dst->freeFunc(dVal->val);
// }
(void)taosHashPut(dst->args, key, klen, sVal, sizeof(*sVal));
int32_t code = taosHashPut(dst->args, key, klen, sVal, sizeof(*sVal));
if (code != 0) {
tError("failed to put val to hash, reason:%s", tstrerror(code));
}
iter = taosHashIterate(src->args, iter);
}
taosHashCleanup(src->args);
@ -453,7 +452,9 @@ bool transQueuePush(STransQueue* queue, void* arg) {
if (queue->q == NULL) {
return true;
}
(void)taosArrayPush(queue->q, &arg);
if (taosArrayPush(queue->q, &arg) == NULL) {
return false;
}
if (taosArrayGetSize(queue->q) > 1) {
return false;
}

View File

@ -787,9 +787,6 @@ void taosTrashcanEmpty(SCacheObj *pCacheObj, bool force) {
STrashElem *pElem = pCacheObj->pTrash;
while (pElem) {
T_REF_VAL_CHECK(pElem->pData);
// A S S E R T(pElem->next != pElem && pElem->prev != pElem);
if (force || (T_REF_VAL_GET(pElem->pData) == 0)) {
uDebug("cache:%s, key:%p, %p removed from trashcan. numOfElem in trashcan:%d", pCacheObj->name, pElem->pData->key,
pElem->pData->data, pCacheObj->numOfElemsInTrash - 1);

View File

@ -385,10 +385,6 @@ int32_t cfgSetItem(SConfig *pCfg, const char *name, const char *value, ECfgSrcTy
(void)taosThreadMutexUnlock(&pCfg->lock);
}
if (code != 0){
uError("cfg:%s, type:%s src:%s value:%s failed since %s", pItem->name, cfgDtypeStr(pItem->dtype),
cfgStypeStr(stype), value, tstrerror(code));
}
TAOS_RETURN(code);
}
@ -1000,7 +996,7 @@ int32_t cfgLoadFromEnvFile(SConfig *pConfig, const char *envFile) {
const char *filepath = ".env";
if (envFile != NULL && strlen(envFile) > 0) {
if (!taosCheckExistFile(envFile)) {
uError("failed to load env file:%s", envFile);
(void)printf("failed to load env file:%s\n", envFile);
TAOS_RETURN(TSDB_CODE_NOT_FOUND);
}
filepath = envFile;
@ -1075,7 +1071,7 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) {
uInfo("failed to load from cfg file %s since %s, use default parameters", filepath, tstrerror(code));
TAOS_RETURN(TSDB_CODE_SUCCESS);
} else {
uError("failed to load from cfg file %s since %s", filepath, tstrerror(code));
(void)printf("failed to load from cfg file %s since %s\n", filepath, tstrerror(code));
TAOS_RETURN(code);
}
}
@ -1117,7 +1113,10 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) {
}
code = cfgSetItem(pConfig, name, newValue, CFG_STYPE_CFG_FILE, true);
if (TSDB_CODE_SUCCESS != code && TSDB_CODE_CFG_NOT_FOUND != code) break;
if (TSDB_CODE_SUCCESS != code && TSDB_CODE_CFG_NOT_FOUND != code) {
(void)printf("cfg:%s, value:%s failed since %s\n", name,newValue, tstrerror(code));
break;
}
} else {
(void)paGetToken(value + vlen + 1, &value2, &vlen2);
if (vlen2 != 0) {
@ -1131,7 +1130,10 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) {
}
code = cfgSetItem(pConfig, name, value, CFG_STYPE_CFG_FILE, true);
if (TSDB_CODE_SUCCESS != code && TSDB_CODE_CFG_NOT_FOUND != code) break;
if (TSDB_CODE_SUCCESS != code && TSDB_CODE_CFG_NOT_FOUND != code) {
(void)printf("cfg:%s, value:%s failed since %s\n", name, value, tstrerror(code));
break;
}
}
if (strcasecmp(name, "dataDir") == 0) {
@ -1154,7 +1156,7 @@ int32_t cfgLoadFromCfgFile(SConfig *pConfig, const char *filepath) {
uInfo("load from cfg file %s success", filepath);
TAOS_RETURN(TSDB_CODE_SUCCESS);
} else {
uError("failed to load from cfg file %s since %s", filepath, tstrerror(code));
(void)printf("failed to load from cfg file %s since %s\n", filepath, tstrerror(code));
TAOS_RETURN(code);
}
}
@ -1236,7 +1238,7 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
char *p = strchr(url, ':');
if (p == NULL) {
uError("fail to load apoll url: %s, unknown format", url);
(void)printf("fail to load apoll url: %s, unknown format\n", url);
TAOS_RETURN(TSDB_CODE_INVALID_PARA);
}
p++;
@ -1244,7 +1246,7 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
if (strncmp(url, "jsonFile", 8) == 0) {
char *filepath = p;
if (!taosCheckExistFile(filepath)) {
uError("failed to load json file:%s", filepath);
(void)printf("failed to load json file:%s\n", filepath);
TAOS_RETURN(TSDB_CODE_NOT_FOUND);
}
@ -1256,7 +1258,7 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
char *buf = taosMemoryMalloc(fileSize + 1);
if (!buf) {
(void)taosCloseFile(&pFile);
uError("load json file error: %s, failed to alloc memory", filepath);
(void)printf("load json file error: %s, failed to alloc memory\n", filepath);
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
}
@ -1264,7 +1266,7 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
(void)taosLSeekFile(pFile, 0, SEEK_SET);
if (taosReadFile(pFile, buf, fileSize) <= 0) {
(void)taosCloseFile(&pFile);
uError("load json file error: %s", filepath);
(void)printf("load json file error: %s\n", filepath);
taosMemoryFreeClear(buf);
TAOS_RETURN(TSDB_CODE_INVALID_DATA_FMT);
}
@ -1273,7 +1275,7 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
if (NULL == pJson) {
const char *jsonParseError = tjsonGetError();
if (jsonParseError != NULL) {
uError("load json file parse error: %s", jsonParseError);
(void)printf("load json file parse error: %s\n", jsonParseError);
}
taosMemoryFreeClear(buf);
TAOS_CHECK_EXIT(TSDB_CODE_INVALID_DATA_FMT);
@ -1341,7 +1343,7 @@ int32_t cfgLoadFromApollUrl(SConfig *pConfig, const char *url) {
// } else if (strncmp(url, "jsonUrl", 7) == 0) {
// } else if (strncmp(url, "etcdUrl", 7) == 0) {
} else {
uError("Unsupported url: %s", url);
(void)printf("Unsupported url: %s\n", url);
TAOS_RETURN(TSDB_CODE_INVALID_PARA);
}
@ -1353,7 +1355,7 @@ _exit:
taosMemoryFree(cfgLineBuf);
tjsonDelete(pJson);
if (code != 0) {
uError("failed to load from apollo url:%s at line %d since %s", url, lino, tstrerror(code));
(void)printf("failed to load from apollo url:%s at line %d since %s\n", url, lino, tstrerror(code));
}
TAOS_RETURN(code);
}

View File

@ -72,11 +72,23 @@ int32_t getThreadLocalGeosCtx(SGeosContext **ppCtx) {
}
int32_t code = 0, lino = 0;
if (atomic_val_compare_exchange_8(&tlGeosCtxKeyInited, 0, 1) == 0) {
int8_t old;
int32_t nLoops = 0;
while (1) {
old = atomic_val_compare_exchange_8(&tlGeosCtxKeyInited, 0, 2);
if (old != 2) break;
if (++nLoops > 1000) {
(void)sched_yield();
nLoops = 0;
}
}
if (old == 0) {
if ((taosThreadKeyCreate(&tlGeosCtxKey, destroyThreadLocalGeosCtx)) != 0) {
atomic_store_8(&tlGeosCtxKeyInited, 0);
TAOS_CHECK_EXIT(TAOS_SYSTEM_ERROR(errno));
}
atomic_store_8(&tlGeosCtxKeyInited, 1);
}
SGeosContext *tlGeosCtxObj = (SGeosContext *)taosMemoryCalloc(1, sizeof(SGeosContext));

View File

@ -206,7 +206,7 @@ int32_t taosInitSlowLog() {
(void)taosUmaskFile(0);
tsLogObj.slowHandle->pFile = taosOpenFile(name, TD_FILE_CREATE | TD_FILE_WRITE | TD_FILE_APPEND);
if (tsLogObj.slowHandle->pFile == NULL) {
printf("\nfailed to open slow log file:%s, reason:%s\n", name, strerror(errno));
(void)printf("\nfailed to open slow log file:%s, reason:%s\n", name, strerror(errno));
return TAOS_SYSTEM_ERROR(errno);
}
@ -529,7 +529,7 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) {
processLogFileName(logName, maxFileNum);
char name[PATH_MAX + 50] = "\0";
sprintf(name, "%s.%d", tsLogObj.logName, tsLogObj.flag);
(void)sprintf(name, "%s.%d", tsLogObj.logName, tsLogObj.flag);
(void)taosThreadMutexInit(&tsLogObj.logMutex, NULL);
(void)taosUmaskFile(0);
@ -538,7 +538,7 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) {
tsLogObj.logHandle->pFile = taosOpenFile(name, TD_FILE_CREATE | TD_FILE_WRITE);
if (tsLogObj.logHandle->pFile == NULL) {
printf("\nfailed to open log file:%s, reason:%s\n", name, strerror(errno));
(void)printf("\nfailed to open log file:%s, reason:%s\n", name, strerror(errno));
return TAOS_SYSTEM_ERROR(errno);
}
(void)taosLockLogFile(tsLogObj.logHandle->pFile);
@ -546,18 +546,18 @@ static int32_t taosInitNormalLog(const char *logName, int32_t maxFileNum) {
// only an estimate for number of lines
int64_t filesize = 0;
if (taosFStatFile(tsLogObj.logHandle->pFile, &filesize, NULL) < 0) {
printf("\nfailed to fstat log file:%s, reason:%s\n", name, strerror(errno));
(void)printf("\nfailed to fstat log file:%s, reason:%s\n", name, strerror(errno));
return TAOS_SYSTEM_ERROR(errno);
}
tsLogObj.lines = (int32_t)(filesize / 60);
(void)taosLSeekFile(tsLogObj.logHandle->pFile, 0, SEEK_END);
sprintf(name, "==================================================\n");
(void)sprintf(name, "==================================================\n");
(void)taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name));
sprintf(name, " new log file \n");
(void)sprintf(name, " new log file \n");
(void)taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name));
sprintf(name, "==================================================\n");
(void)sprintf(name, "==================================================\n");
(void)taosWriteFile(tsLogObj.logHandle->pFile, name, (uint32_t)strlen(name));
return 0;

View File

@ -455,9 +455,7 @@ static void taosLockList(int64_t *lockedBy) {
static void taosUnlockList(int64_t *lockedBy) {
int64_t tid = taosGetSelfPthreadId();
if (atomic_val_compare_exchange_64(lockedBy, tid, 0) != tid) {
ASSERTS(false, "atomic_val_compare_exchange_64 tid failed");
}
(void)atomic_val_compare_exchange_64(lockedBy, tid, 0);
}
static void taosInitRefModule(void) { (void)taosThreadMutexInit(&tsRefMutex, NULL); }

View File

@ -46,4 +46,67 @@
228
117
112
110
110
116
116
39
108
120
108
120
108
116
104
116
116
104
108
120
108
120
108
116
104
116
116
104
110
228
117
112
110
110
97
228
110
97
110
228
117
112
110
110
97
228
110
97
110
112
110
112
228
117
112
112
112
112
110
112
110
112
228
117
112
112
112
112

1 104
46 228
47 117
48 112
49 110
50 116
51 116
52 39
53 108
54 120
55 108
56 120
57 108
58 116
59 104
60 116
61 116
62 104
63 108
64 120
65 108
66 120
67 108
68 116
69 104
70 116
71 116
72 104
73 110
74 228
75 117
76 112
77 110
78 110
79 97
80 228
81 110
82 97
83 110
84 228
85 117
86 112
87 110
88 110
89 97
90 228
91 110
92 97
93 110
94 112
95 110
96 112
97 228
98 117
99 112
100 112
101 112
102 112
103 110
104 112
105 110
106 112
107 228
108 117
109 112
110 112
111 112
112 112

View File

@ -36,4 +36,8 @@ MMMMM
NNNNN
OOOOO
PPPPP
QQQQQ
QQQQQ
M
MM
{
M{

1 M
36 NNNNN
37 OOOOO
38 PPPPP
39 QQQQQ
40 M
41 MM
42 {
43 M{

View File

@ -46,4 +46,48 @@
10
6
7
5
5
4
2
6
5
5
10
6
7
5
5
5
10
5
5
5
10
6
7
5
5
5
10
5
5
5
6
5
5
10
6
7
6
7
5
5
6
5
5
10
6
7
6
7
5

1 5
46 10
47 6
48 7
49 5
50 4
51 2
52 6
53 5
54 5
55 10
56 6
57 7
58 5
59 5
60 5
61 10
62 5
63 5
64 5
65 10
66 6
67 7
68 5
69 5
70 5
71 10
72 5
73 5
74 5
75 6
76 5
77 5
78 10
79 6
80 7
81 6
82 7
83 5
84 5
85 6
86 5
87 5
88 10
89 6
90 7
91 6
92 7
93 5

View File

@ -73,4 +73,27 @@
6
6
6
6
6
4
4
2
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6

1 4
73 6
74 6
75 6
76 6
77 4
78 4
79 2
80 6
81 6
82 6
83 6
84 6
85 6
86 6
87 6
88 6
89 6
90 6
91 6
92 6
93 6
94 6
95 6
96 6
97 6
98 6
99 6

View File

@ -42,4 +42,25 @@
57.295779513082323
81.028468454139556
99.239201175922574
114.591559026164646
114.591559026164646
180
610.200029957721426
491.254034090376820
561.212164701962479
643.603479905018958
613.408634263739941
487.472513516777667
549.810284033650078
628.076328902558998
643.202411196955836
592.266466706882511
610.200029957721426
491.254034090376820
561.212164701962479
643.603479905018958
613.408634263739941
487.472513516777667
549.810284033650078
628.076328902558998
643.202411196955836
592.266466706882511

1 0.000000000000000
42 57.295779513082323
43 81.028468454139556
44 99.239201175922574
45 114.591559026164646
46 180
47 610.200029957721426
48 491.254034090376820
49 561.212164701962479
50 643.603479905018958
51 613.408634263739941
52 487.472513516777667
53 549.810284033650078
54 628.076328902558998
55 643.202411196955836
56 592.266466706882511
57 610.200029957721426
58 491.254034090376820
59 561.212164701962479
60 643.603479905018958
61 613.408634263739941
62 487.472513516777667
63 549.810284033650078
64 628.076328902558998
65 643.202411196955836
66 592.266466706882511

View File

@ -41,4 +41,26 @@
4.113250378782928
5.652233674034091
7.389056098930650
3814279.104760214220732
3814279.104760214220732
7.38905609893065
1.6487212707001282
42192.578453635847836
5292.258432380726845
17943.802618770550907
75583.992598717435612
44622.804904812772293
4954.246535954979663
14705.836248958077704
57641.604897186582093
75056.754435561466380
30853.327779395312973
42192.578453635847836
5292.258432380726845
17943.802618770550907
75583.992598717435612
44622.804904812772293
4954.246535954979663
14705.836248958077704
57641.604897186582093
75056.754435561466380
30853.327779395312973

1 1.000000000000000
41 4.113250378782928
42 5.652233674034091
43 7.389056098930650
44 3814279.104760214220732
45 7.38905609893065
46 1.6487212707001282
47 42192.578453635847836
48 5292.258432380726845
49 17943.802618770550907
50 75583.992598717435612
51 44622.804904812772293
52 4954.246535954979663
53 14705.836248958077704
54 57641.604897186582093
55 75056.754435561466380
56 30853.327779395312973
57 42192.578453635847836
58 5292.258432380726845
59 17943.802618770550907
60 75583.992598717435612
61 44622.804904812772293
62 4954.246535954979663
63 14705.836248958077704
64 57641.604897186582093
65 75056.754435561466380
66 30853.327779395312973

View File

@ -38,4 +38,26 @@
1.005052538742381
1.098612288668110
-0.226079864157595
2.000000000000000
2.000000000000000
2.302585092994046
1.144729885849400
2.365559856336680
2.148734409997751
2.281872059185575
2.418855857000369
2.370804362614190
2.141006941277850
2.261346315560232
2.394434736880126
2.418232501568406
2.335729681253415
2.365559856336680
2.148734409997751
2.281872059185575
2.418855857000369
2.370804362614190
2.141006941277850
2.261346315560232
2.394434736880126
2.418232501568406
2.335729681253415

1 4.605170185988092
38 1.005052538742381
39 1.098612288668110
40 -0.226079864157595
41 2.000000000000000
42 2.302585092994046
43 1.144729885849400
44 2.365559856336680
45 2.148734409997751
46 2.281872059185575
47 2.418855857000369
48 2.370804362614190
49 2.141006941277850
50 2.261346315560232
51 2.394434736880126
52 2.418232501568406
53 2.335729681253415
54 2.365559856336680
55 2.148734409997751
56 2.281872059185575
57 2.418855857000369
58 2.370804362614190
59 2.141006941277850
60 2.261346315560232
61 2.394434736880126
62 2.418232501568406
63 2.335729681253415

View File

@ -48,3 +48,25 @@
3.310891102586806e+00
3.350522322288470e+00
3.215120509901375e+00
1
1
0
1
2
0
1
2
0
1
2
0
0
1
2
0
1
2
0
1
2
0

1 1.550000000000001
48 3.310891102586806e+00
49 3.350522322288470e+00
50 3.215120509901375e+00
51 1
52 1
53 0
54 1
55 2
56 0
57 1
58 2
59 0
60 1
61 2
62 0
63 0
64 1
65 2
66 0
67 1
68 2
69 0
70 1
71 2
72 0

View File

@ -24,4 +24,5 @@
3.141592653589793
9.869604401089358
1.772453850905516
3
3
3.141592653589793

1 3.141592653589793
24 3.141592653589793
25 9.869604401089358
26 1.772453850905516
27 3
28 3.141592653589793

View File

@ -90,3 +90,87 @@
1
1
1.000000000000000e+00
1
0
1
1
0
0
0
0
4
0
0
0
0
0
0
0
0
0
4
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
4
0
0
0
0
0
0
0
4
0
4
0
0
0
0
0
0
0
4
0
4
0
0
5
0
0
0
0
0
0
4
0
0
5
0
0
0
0
0
0

1 1
90 1
91 1
92 1.000000000000000e+00
93 1
94 0
95 1
96 1
97 0
98 0
99 0
100 0
101 4
102 0
103 0
104 0
105 0
106 0
107 0
108 0
109 0
110 0
111 4
112 0
113 0
114 0
115 0
116 0
117 0
118 0
119 0
120 0
121 0
122 0
123 0
124 0
125 0
126 0
127 0
128 0
129 0
130 0
131 0
132 0
133 0
134 0
135 0
136 0
137 4
138 0
139 0
140 0
141 0
142 0
143 0
144 0
145 4
146 0
147 4
148 0
149 0
150 0
151 0
152 0
153 0
154 0
155 4
156 0
157 4
158 0
159 0
160 5
161 0
162 0
163 0
164 0
165 0
166 0
167 4
168 0
169 0
170 5
171 0
172 0
173 0
174 0
175 0
176 0

View File

@ -42,4 +42,25 @@
0.017453292519943
0.024682682989769
0.030229989403904
0.034906585039887
0.034906585039887
3.141592653589793
0.185877558679493
0.149644536324422
0.170955001564425
0.196052831414414
0.186854955444309
0.148492619284422
0.167481790094528
0.191322990739406
0.195930658899406
0.180414682914441
0.185877558679493
0.149644536324422
0.170955001564425
0.196052831414414
0.186854955444309
0.148492619284422
0.167481790094528
0.191322990739406
0.195930658899406
0.180414682914441

1 0.000000000000000
42 0.017453292519943
43 0.024682682989769
44 0.030229989403904
45 0.034906585039887
46 3.141592653589793
47 0.185877558679493
48 0.149644536324422
49 0.170955001564425
50 0.196052831414414
51 0.186854955444309
52 0.148492619284422
53 0.167481790094528
54 0.191322990739406
55 0.195930658899406
56 0.180414682914441
57 0.185877558679493
58 0.149644536324422
59 0.170955001564425
60 0.196052831414414
61 0.186854955444309
62 0.148492619284422
63 0.167481790094528
64 0.191322990739406
65 0.195930658899406
66 0.180414682914441

View File

@ -56,4 +56,106 @@ var1
var1var1
var1var1var1
var1var1var1var1
var1var1var1var1var1
var1var1var1var1var1
taos
taostaos
lililililili
xxx
lililililili
xxx
lililililili
taostaostaos
hahahahahaha
taostaostaos
taostaostaos
hahahahahaha
lililililili
xxx
lililililili
xxx
lililililili
taostaostaos
hahahahahaha
taostaostaos
taostaostaos
hahahahahaha
novelnovelnovel
一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
updateupdateupdate
prisionprisionprision
novelnovelnovel
novelnovelnovel
againagainagain
一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
novelnovelnovel
againagainagain
novelnovelnovel
一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
updateupdateupdate
prisionprisionprision
novelnovelnovel
novelnovelnovel
againagainagain
一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
novelnovelnovel
againagainagain
novelnovelnovel
personpersonperson
novelnovelnovel
plateplateplate
一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
updateupdateupdate
prisionprisionprision
personpersonperson
prisionprisionprision
plateplateplate
novelnovelnovel
personpersonperson
novelnovelnovel
plateplateplate
一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
updateupdateupdate
prisionprisionprision
personpersonperson
prisionprisionprision
plateplateplate
lili
x
lili
x
lili
taos
haha
taos
taos
haha
lili
x
lili
x
lili
taos
haha
taos
taos
haha
novel
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novel
again
novel
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novel
again

1 hello
56 var1var1
57 var1var1var1
58 var1var1var1var1
59 var1var1var1var1var1
60 taos
61 taostaos
62 lililililili
63 xxx
64 lililililili
65 xxx
66 lililililili
67 taostaostaos
68 hahahahahaha
69 taostaostaos
70 taostaostaos
71 hahahahahaha
72 lililililili
73 xxx
74 lililililili
75 xxx
76 lililililili
77 taostaostaos
78 hahahahahaha
79 taostaostaos
80 taostaostaos
81 hahahahahaha
82 novelnovelnovel
83 一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
84 updateupdateupdate
85 prisionprisionprision
86 novelnovelnovel
87 novelnovelnovel
88 againagainagain
89 一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
90 novelnovelnovel
91 againagainagain
92 novelnovelnovel
93 一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
94 updateupdateupdate
95 prisionprisionprision
96 novelnovelnovel
97 novelnovelnovel
98 againagainagain
99 一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
100 novelnovelnovel
101 againagainagain
102 novelnovelnovel
103 personpersonperson
104 novelnovelnovel
105 plateplateplate
106 一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
107 updateupdateupdate
108 prisionprisionprision
109 personpersonperson
110 prisionprisionprision
111 plateplateplate
112 novelnovelnovel
113 personpersonperson
114 novelnovelnovel
115 plateplateplate
116 一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十
117 updateupdateupdate
118 prisionprisionprision
119 personpersonperson
120 prisionprisionprision
121 plateplateplate
122 lili
123 x
124 lili
125 x
126 lili
127 taos
128 haha
129 taos
130 taos
131 haha
132 lili
133 x
134 lili
135 x
136 lili
137 taos
138 haha
139 taos
140 taos
141 haha
142 novel
143 一二三四五六七八九十
144 update
145 prision
146 novel
147 novel
148 again
149 一二三四五六七八九十
150 novel
151 again
152 novel
153 一二三四五六七八九十
154 update
155 prision
156 novel
157 novel
158 again
159 一二三四五六七八九十
160 novel
161 again

View File

@ -368,4 +368,109 @@ e二三四五六七abcdefghijk213124123
一二三四五六七abcdefghijk213124123
一二三四五六七abcdefghijk213124123
一二三四五六七abcdefghijk213124123
一二三四五六七abcdefghijk213124123
一二三四五六七abcdefghijk213124123
eebbccdd
aabbccdd
南京
北南
南京taos
novel
一二三四五六七八九十
update
prision
novtl
novel
again
一二三四五六七八九十
novel
again
novel
一二三四五六七八九十
update
prision
novtl
novel
again
一二三四五六七八九十
novel
again
novtl
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novtl
again
novtl
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novtl
again
novel
person
novel
plate
一二三四五六七八九十
update
prision
person
prision
plate
novel
person
novel
plate
一二三四五六七八九十
update
prision
person
prision
plate
novtl
person
novel
platt
一二三四五六七八九十
update
prision
person
prision
plate
novtl
person
novel
platt
一二三四五六七八九十
update
prision
person
prision
plate
novel
一二三四五六七八九十
update
prision
nov一二三四五六七八九十l
novel
again
一二三四五六七八九十
novel
again
novel
一二三四五六七八九十
update
prision
nov一二三四五六七八九十l
novel
again
一二三四五六七八九十
novel
again

1 bbbb
368 一二三四五六七abcdefghijk213124123
369 一二三四五六七abcdefghijk213124123
370 一二三四五六七abcdefghijk213124123
371 一二三四五六七abcdefghijk213124123
372 eebbccdd
373 aabbccdd
374 南京
375 北南
376 南京taos
377 novel
378 一二三四五六七八九十
379 update
380 prision
381 novtl
382 novel
383 again
384 一二三四五六七八九十
385 novel
386 again
387 novel
388 一二三四五六七八九十
389 update
390 prision
391 novtl
392 novel
393 again
394 一二三四五六七八九十
395 novel
396 again
397 novtl
398 一二三四五六七八九十
399 update
400 prision
401 novel
402 novel
403 again
404 一二三四五六七八九十
405 novtl
406 again
407 novtl
408 一二三四五六七八九十
409 update
410 prision
411 novel
412 novel
413 again
414 一二三四五六七八九十
415 novtl
416 again
417 novel
418 person
419 novel
420 plate
421 一二三四五六七八九十
422 update
423 prision
424 person
425 prision
426 plate
427 novel
428 person
429 novel
430 plate
431 一二三四五六七八九十
432 update
433 prision
434 person
435 prision
436 plate
437 novtl
438 person
439 novel
440 platt
441 一二三四五六七八九十
442 update
443 prision
444 person
445 prision
446 plate
447 novtl
448 person
449 novel
450 platt
451 一二三四五六七八九十
452 update
453 prision
454 person
455 prision
456 plate
457 novel
458 一二三四五六七八九十
459 update
460 prision
461 nov一二三四五六七八九十l
462 novel
463 again
464 一二三四五六七八九十
465 novel
466 again
467 novel
468 一二三四五六七八九十
469 update
470 prision
471 nov一二三四五六七八九十l
472 novel
473 again
474 一二三四五六七八九十
475 novel
476 again

View File

@ -62,4 +62,33 @@
9.6000004
11.0000000
11.1999998
10.3000002
10.3000002
10.55
10.55
10.6
11
11
10
0
-10.6
99
11
9
10
11
11
9
10
11
11
10
11
9
10
11
11
9
10
11
11
10

1 10.550000000000001
62 9.6000004
63 11.0000000
64 11.1999998
65 10.3000002
66 10.55
67 10.55
68 10.6
69 11
70 11
71 10
72 0
73 -10.6
74 99
75 11
76 9
77 10
78 11
79 11
80 9
81 10
82 11
83 11
84 10
85 11
86 9
87 10
88 11
89 11
90 9
91 10
92 11
93 11
94 10

View File

@ -43,4 +43,28 @@
1.000000000000000
1.000000000000000
1.000000000000000
0
0
1
1
-1
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

1 0
43 1.000000000000000
44 1.000000000000000
45 1.000000000000000
46 0
47 1
48 1
49 -1
50 -1
51 1
52 1
53 1
54 1
55 1
56 1
57 1
58 1
59 1
60 1
61 1
62 1
63 1
64 1
65 1
66 1
67 1
68 1
69 1
70 1

View File

@ -30,4 +30,8 @@
8.077747210701755
8.077747210701755
8.077747210701755
8.077747210701755
8.077747210701755
2886.751331514371941
2886.751331514371941
1.154339668872967
1.154339668872967

1 1.154339668872968
30 8.077747210701755
31 8.077747210701755
32 8.077747210701755
33 8.077747210701755
34 2886.751331514371941
35 2886.751331514371941
36 1.154339668872967
37 1.154339668872967

View File

@ -445,4 +445,51 @@ bc一二三abc一二三a
rision
rision
bc一二三abc一二三a
二三123321三二一
二三123321三二一
dengine
e
tde
dengine
e
中国
中国t
novel
perso
novel
plate
一二三四五
updat
prisi
perso
prisi
plate
novel
perso
novel
plate
一二三四五
updat
prisi
perso
prisi
plate
novel
一二三四五
updat
prisi
novel
novel
again
一二三四五
novel
again
novel
一二三四五
updat
prisi
novel
novel
again
一二三四五
novel
again

1 Hello.World!
445 rision
446 rision
447 bc一二三abc一二三a
448 二三123321三二一
449 dengine
450 e
451 tde
452 dengine
453 e
454 中国
455 中国t
456 novel
457 perso
458 novel
459 plate
460 一二三四五
461 updat
462 prisi
463 perso
464 prisi
465 plate
466 novel
467 perso
468 novel
469 plate
470 一二三四五
471 updat
472 prisi
473 perso
474 prisi
475 plate
476 novel
477 一二三四五
478 updat
479 prisi
480 novel
481 novel
482 again
483 一二三四五
484 novel
485 again
486 novel
487 一二三四五
488 updat
489 prisi
490 novel
491 novel
492 again
493 一二三四五
494 novel
495 again

View File

@ -188,4 +188,108 @@ a一二三a一二三bbcfp
一二三123321三二一
一二三123321三二一
一二三123321三二一
一二三123321三二一
一二三123321三二一
www.taosdata
taosdata.com
中国.科学
北京。涛思
novel
一二三四五六七八九十
update
prision
novel
novel
ag
一二三四五六七八九十
novel
ag
novel
一二三四五六七八九十
update
prision
novel
novel
ag
一二三四五六七八九十
novel
ag
novel
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novel
again
novel
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novel
again
novel
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novel
again
novel
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novel
again
novel
person
novel
plate
一二三四五六七八九十
update
prision
person
prision
plate
novel
person
novel
plate
一二三四五六七八九十
update
prision
person
prision
plate
novel
person
novel
plate
一二三四五六七八九十
update
prision
person
prision
plate
novel
person
novel
plate
一二三四五六七八九十
update
prision
person
prision
plate

1 1abcd;2abcd
188 一二三123321三二一
189 一二三123321三二一
190 一二三123321三二一
191 一二三123321三二一
192 www.taosdata
193 taosdata.com
194 中国.科学
195 北京。涛思
196 novel
197 一二三四五六七八九十
198 update
199 prision
200 novel
201 novel
202 ag
203 一二三四五六七八九十
204 novel
205 ag
206 novel
207 一二三四五六七八九十
208 update
209 prision
210 novel
211 novel
212 ag
213 一二三四五六七八九十
214 novel
215 ag
216 novel
217 一二三四五六七八九十
218 update
219 prision
220 novel
221 novel
222 again
223 一二三四五六七八九十
224 novel
225 again
226 novel
227 一二三四五六七八九十
228 update
229 prision
230 novel
231 novel
232 again
233 一二三四五六七八九十
234 novel
235 again
236 novel
237 一二三四五六七八九十
238 update
239 prision
240 novel
241 novel
242 again
243 一二三四五六七八九十
244 novel
245 again
246 novel
247 一二三四五六七八九十
248 update
249 prision
250 novel
251 novel
252 again
253 一二三四五六七八九十
254 novel
255 again
256 novel
257 person
258 novel
259 plate
260 一二三四五六七八九十
261 update
262 prision
263 person
264 prision
265 plate
266 novel
267 person
268 novel
269 plate
270 一二三四五六七八九十
271 update
272 prision
273 person
274 prision
275 plate
276 novel
277 person
278 novel
279 plate
280 一二三四五六七八九十
281 update
282 prision
283 person
284 prision
285 plate
286 novel
287 person
288 novel
289 plate
290 一二三四五六七八九十
291 update
292 prision
293 person
294 prision
295 plate

View File

@ -295,4 +295,40 @@
372
372
372
372
372
-10
31536000
3000
43200
720
30
4
2592000000
2592000
2592000
60
60
79774389
-79774389
79774389
-79774389
-220769589123
-220766589123
-220763589123
-220760589123
-220757589123
-220754589123
-220751589123
-220748589123
-220745589123
-220742589123
-220769589123
-220766589123
-220763589123
-220760589123
-220757589123
-220754589123
-220751589123
-220748589123
-220745589123
-220742589123

1 -1000
295 372
296 372
297 372
298 372
299 -10
300 31536000
301 3000
302 43200
303 720
304 30
305 4
306 2592000000
307 2592000
308 2592000
309 60
310 60
311 79774389
312 -79774389
313 79774389
314 -79774389
315 -220769589123
316 -220766589123
317 -220763589123
318 -220760589123
319 -220757589123
320 -220754589123
321 -220751589123
322 -220748589123
323 -220745589123
324 -220742589123
325 -220769589123
326 -220766589123
327 -220763589123
328 -220760589123
329 -220757589123
330 -220754589123
331 -220751589123
332 -220748589123
333 -220745589123
334 -220742589123

View File

@ -353,4 +353,101 @@ bbcfp三a
三abbcfp三a
三abbcfp三a
三abbcfp三a
三abbcfp三a
三abbcfp三a
A
涛思
b bbb
aaa
aaa abab aaaa
abab aaaa
京涛思数据科技有限公司北
bei京涛思数据科技有限公司北
aaa abab aaaa
aaa abab
aaa abab
北京涛思数据科技有限公司
北京涛思数据科技有限公司bei
aaa abab aaaa
aaa abab aaaa
abab
京涛思数据科技有限公司
novel
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novel
again
novel
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novel
again
novel
person
novel
plate
一二三四五六七八九十
update
prision
person
prision
plate
novel
person
novel
plate
一二三四五六七八九十
update
prision
person
prision
plate
novel
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novel
again
novel
一二三四五六七八九十
update
prision
novel
novel
again
一二三四五六七八九十
novel
again
novel
person
novel
plat
一二三四五六七八九十
update
prision
person
prision
plate
novel
person
novel
plat
一二三四五六七八九十
update
prision
person
prision
plate

1 foo
353 三abbcfp三a
354 三abbcfp三a
355 三abbcfp三a
356 三abbcfp三a
357 A
358 涛思
359 b bbb
360 aaa
361 aaa abab aaaa
362 abab aaaa
363 京涛思数据科技有限公司北
364 bei京涛思数据科技有限公司北
365 aaa abab aaaa
366 aaa abab
367 aaa abab
368 北京涛思数据科技有限公司
369 北京涛思数据科技有限公司bei
370 aaa abab aaaa
371 aaa abab aaaa
372 abab
373 京涛思数据科技有限公司
374 novel
375 一二三四五六七八九十
376 update
377 prision
378 novel
379 novel
380 again
381 一二三四五六七八九十
382 novel
383 again
384 novel
385 一二三四五六七八九十
386 update
387 prision
388 novel
389 novel
390 again
391 一二三四五六七八九十
392 novel
393 again
394 novel
395 person
396 novel
397 plate
398 一二三四五六七八九十
399 update
400 prision
401 person
402 prision
403 plate
404 novel
405 person
406 novel
407 plate
408 一二三四五六七八九十
409 update
410 prision
411 person
412 prision
413 plate
414 novel
415 一二三四五六七八九十
416 update
417 prision
418 novel
419 novel
420 again
421 一二三四五六七八九十
422 novel
423 again
424 novel
425 一二三四五六七八九十
426 update
427 prision
428 novel
429 novel
430 again
431 一二三四五六七八九十
432 novel
433 again
434 novel
435 person
436 novel
437 plat
438 一二三四五六七八九十
439 update
440 prision
441 person
442 prision
443 plate
444 novel
445 person
446 novel
447 plat
448 一二三四五六七八九十
449 update
450 prision
451 person
452 prision
453 plate

View File

@ -79,4 +79,51 @@
9.5000000
10.8999996
11.1999998
10.3000002
10.3000002
99.99
99.99
99.9
99
90
0
99
10.6
8.5
9.7
11.2
10.7
8.5
9.5
10.9
11.2
10.3
10.6
8.5
9.7
11.2
10.7
8.5
9.5
10.9
11.2
10.3
10.6
8.5
9.7
11.2
10.7
8.5
9.5
10.9
11.2
10.3
10.6
8.5
9.7
11.2
10.7
8.5
9.5
10.9
11.2
10.3

1 10.550000000000001
79 9.5000000
80 10.8999996
81 11.1999998
82 10.3000002
83 99.99
84 99.99
85 99.9
86 99
87 90
88 0
89 99
90 10.6
91 8.5
92 9.7
93 11.2
94 10.7
95 8.5
96 9.5
97 10.9
98 11.2
99 10.3
100 10.6
101 8.5
102 9.7
103 11.2
104 10.7
105 8.5
106 9.5
107 10.9
108 11.2
109 10.3
110 10.6
111 8.5
112 9.7
113 11.2
114 10.7
115 8.5
116 9.5
117 10.9
118 11.2
119 10.3
120 10.6
121 8.5
122 9.7
123 11.2
124 10.7
125 8.5
126 9.5
127 10.9
128 11.2
129 10.3

View File

@ -30,4 +30,8 @@
65.250000000000000
65.250000000000000
65.250000000000000
65.250000000000000
65.250000000000000
8333333.250000000000000
8333333.250000000000000
1.332500071133751
1.332500071133751

1 1.332500071133753
30 65.250000000000000
31 65.250000000000000
32 65.250000000000000
33 65.250000000000000
34 8333333.250000000000000
35 8333333.250000000000000
36 1.332500071133751
37 1.332500071133751

View File

@ -140,4 +140,35 @@
28
28
28
28
28
0
0
0
52
52
0
0
52
52
3
52
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28

1 0
140 28
141 28
142 28
143 28
144 0
145 0
146 0
147 52
148 52
149 0
150 0
151 52
152 52
153 3
154 52
155 28
156 28
157 28
158 28
159 28
160 28
161 28
162 28
163 28
164 28
165 28
166 28
167 28
168 28
169 28
170 28
171 28
172 28
173 28
174 28

View File

@ -73,4 +73,28 @@
4
4
4
4
4
2
2
0
2
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4

1 2
73 4
74 4
75 4
76 4
77 2
78 2
79 0
80 2
81 4
82 4
83 4
84 4
85 4
86 4
87 4
88 4
89 4
90 4
91 4
92 4
93 4
94 4
95 4
96 4
97 4
98 4
99 4
100 4

View File

@ -73,4 +73,27 @@
28
28
28
28
28
1
4
29
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28
28

1 1
73 28
74 28
75 28
76 28
77 1
78 4
79 29
80 28
81 28
82 28
83 28
84 28
85 28
86 28
87 28
88 28
89 28
90 28
91 28
92 28
93 28
94 28
95 28
96 28
97 28
98 28
99 28

View File

@ -0,0 +1,5 @@
select ascii();
select ascii(123);
select ascii(1);
select ascii(2);
select ascii(1.5);

View File

@ -14,4 +14,13 @@ select ASCII(concat(nch1,var1)) from ts_4893.meters order by ts limit 5;
select ASCII(cast(nch1 as varchar)) from ts_4893.meters order by ts limit 5;
select pow(ASCII(nch1), 2) from ts_4893.meters order by ts limit 5;
select sqrt(ASCII(nch1)) from ts_4893.meters order by ts limit 5;
select cast(ASCII(nch1) as int) from ts_4893.meters order by ts limit 5;
select cast(ASCII(nch1) as int) from ts_4893.meters order by ts limit 5;
select ascii('taos');
select ascii('t');
select ascii('\'');
select ascii(name) from ts_4893.d0 order by ts limit 10;
select ascii(name) from ts_4893.meters order by ts limit 10;
select ascii(nch1) from ts_4893.d0 order by ts limit 10;
select ascii(nch1) from ts_4893.meters order by ts limit 10;
select ascii(var1) from ts_4893.d0 order by ts limit 10;
select ascii(var1) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1 @@
select char();

View File

@ -9,3 +9,7 @@ select cast(CHAR(49) as int);
select CHAR(id + 77) from ts_4893.meters order by ts limit 5;;
select CONCAT(CHAR(id + 77),CHAR(id + 77),CHAR(id + 77)) from ts_4893.meters limit 5;
select CHAR(id+77, id+77, id+77, id+77, id+77) from ts_4893.meters limit 5;
select char(77);
select char(77 * 256 + 77);
select char('123');
select char(77, NULL, '123');

View File

@ -0,0 +1,5 @@
select char_length();
select char_length('tao's');
select char_length(123.45);
select char_length(123.45.67);
select char_length('a', 'b');

View File

@ -14,4 +14,12 @@ select CHAR_LENGTH(concat(nch1,var1)) from ts_4893.meters order by ts limit 5;
select CHAR_LENGTH(cast(nch1 as varchar)) from ts_4893.meters order by ts limit 5;
select pow(CHAR_LENGTH(nch1), 2) from ts_4893.meters order by ts limit 5;
select sqrt(CHAR_LENGTH(nch1)) from ts_4893.meters order by ts limit 5;
select cast(CHAR_LENGTH(nch1) as int) from ts_4893.meters order by ts limit 5;
select cast(CHAR_LENGTH(nch1) as int) from ts_4893.meters order by ts limit 5;
select char_length('taos');
select char_length('涛思');
select char_length('涛思taos');
select char_length('tao\'s');
select char_length(nch1) from ts_4893.d0 limit 10;
select char_length(nch1) from ts_4893.meters limit 10;
select char_length(var1) from ts_4893.d0 limit 10;
select char_length(var1) from ts_4893.meters limit 10;

View File

@ -0,0 +1,2 @@
select dayofweek();
select dayofweek('2020-01-01',1);

View File

@ -10,4 +10,9 @@ select DAYOFWEEK('2000-01-06 00:00:00');
select DAYOFWEEK('2000-01-06 00:00:00') from ts_4893.meters order by ts limit 10;
select DAYOFWEEK(1725095657);
select DAYOFWEEK(1725095657) from ts_4893.meters order by ts limit 10;
select DAYOFWEEK(ts) from ts_4893.meters order by ts limit 10;
select DAYOFWEEK(ts) from ts_4893.meters order by ts limit 10;
select dayofweek('2020-01-01');
select dayofweek(1721020666);
select dayofweek(1721020666229);
select dayofweek(ts) from ts_4893.d0 order by ts limit 10;
select dayofweek(ts) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,2 @@
select degrees();
select degrees('abc');

View File

@ -26,4 +26,7 @@ select abs(DEGREES(10));
select pow(DEGREES(10), 2);
select sqrt(DEGREES(10));
select cast(DEGREES(10) as int);
select DEGREES(sqrt(id)) from ts_4893.meters order by ts limit 5;
select DEGREES(sqrt(id)) from ts_4893.meters order by ts limit 5;
select degrees(pi());
select degrees(current) from ts_4893.d0 order by ts limit 10;
select degrees(current) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,2 @@
select exp();
select exp('1');

View File

@ -25,4 +25,8 @@ select pow(EXP(10), 2);
select sqrt(EXP(10));
select cast(EXP(10) as int);
select EXP(sqrt(id)) from ts_4893.meters order by ts limit 5;
select EXP(EXP(EXP(EXP(0))));
select EXP(EXP(EXP(EXP(0))));
select exp(2);
select exp(0.5);
select exp(current) from ts_4893.d0 order by ts limit 10;
select exp(current) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,2 @@
select ln();
select ln('1');

View File

@ -22,4 +22,8 @@ select sqrt(LN(10));
select cast(LN(10) as int);
select LN(sqrt(id) + 1) from ts_4893.meters order by ts limit 5;
select LN(LN(LN(LN(10000))));
select LN(EXP(2));
select LN(EXP(2));
select ln(10);
select ln(pi());
select ln(current) from ts_4893.d0 order by ts limit 10;
select ln(current) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,6 @@
select mod();
select mod(, 2);
select mod(10, );
select mod(10, 'a');
select mod('abc', 3);
select mod(10, 3, 1);

View File

@ -11,4 +11,8 @@ select MOD(MOD(MOD(MOD(MOD(MOD(MOD(123456789.123456789, -1), -2), -3), -4), -5),
select MOD(87654321.123456789, id + 1) from ts_4893.meters order by ts limit 10;
select MOD(current, id + 1) from ts_4893.meters order by ts limit 10;
select MOD(current, 1) from ts_4893.meters order by ts limit 10;
select MOD(sqrt(current), abs(id + 1)) from ts_4893.meters order by ts limit 10;
select MOD(sqrt(current), abs(id + 1)) from ts_4893.meters order by ts limit 10;
select mod(10, -3);
select mod(10, 3);
select mod(id, 3) from ts_4893.d0 order by ts limit 10;
select mod(id, 3) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,2 @@
select pi('111');
select pi(123);

View File

@ -16,4 +16,5 @@ select pi() + id from ts_4893.meters order by ts limit 5;
select abs(pi());
select pow(pi(), 2);
select sqrt(pi());
select cast(pi() as int);
select cast(pi() as int);
select pi();

View File

@ -0,0 +1,5 @@
select position('t' in);
select position(in 'taos');
select position(1 in 2213);
select position(1 in '2213');
select position('1' in 2213);

View File

@ -25,4 +25,16 @@ select POSITION(var2 IN 'abcdefghijklmn') from ts_4893.meters where POSITION(var
select POSITION(nch2 IN '一二三四五六七八九十') from ts_4893.meters where POSITION(nch2 IN '一二三四五六七八九十') != 0 order by ts limit 5;
select POSITION(var2 IN '一二三四五六七八九十') from ts_4893.meters where POSITION(var2 IN '一二三四五六七八九十') != 0 order by ts limit 5;
select ABS(POSITION('aaa' IN 'aaaaaaaaa'));
select POW(POSITION('aaa' IN 'aaaaaaaaa'), 2);
select POW(POSITION('aaa' IN 'aaaaaaaaa'), 2);
select position('t' in 'taos');
select position('ustc' in 'taos');
select position('' in '');
select position('' in 'taos');
select position(nch2 in nch1) from ts_4893.d0 order by ts limit 10;
select position(nch2 in nch1) from ts_4893.meters order by ts limit 10;
select position(nch2 in var1) from ts_4893.d0 order by ts limit 10;
select position(nch2 in var1) from ts_4893.meters order by ts limit 10;
select position(var2 in nch1) from ts_4893.d0 order by ts limit 10;
select position(var2 in nch1) from ts_4893.meters order by ts limit 10;
select position(var2 in var1) from ts_4893.d0 order by ts limit 10;
select position(var2 in var1) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,2 @@
select radians();
select radians('abc');

View File

@ -26,4 +26,7 @@ select abs(RADIANS(10));
select pow(RADIANS(10), 2);
select sqrt(RADIANS(10));
select cast(RADIANS(10) as int);
select RADIANS(sqrt(id)) from ts_4893.meters order by ts limit 5;
select RADIANS(sqrt(id)) from ts_4893.meters order by ts limit 5;
select radians(180);
select radians(current) from ts_4893.d0 order by ts limit 10;
select radians(current) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,11 @@
select repeat();
select repeat('taos', );
select repeat(, 3);
select repeat('taos');
select repeat(1);
select repeat(taos, 1);
select repeat(123, 2);
select repeat('taos', 1.5);
select repeat('taos', 1.4);
select repeat('taos', 12, 3);
select repeat(id, 3) from ts_4893.meters;

View File

@ -16,4 +16,16 @@ select position(var1 in repeat(nch1,6)) from ts_4893.meters where nch1 = var1 or
select repeat(nch1, id) from ts_4893.meters where id > 0 order by ts limit 5;
select repeat(var1, id) from ts_4893.meters where id > 0 order by ts limit 5;
select repeat('nch1', id) from ts_4893.meters where id > 0 order by ts limit 5;
select repeat('var1', id) from ts_4893.meters where id > 0 order by ts limit 5;
select repeat('var1', id) from ts_4893.meters where id > 0 order by ts limit 5;
select repeat('taos', 1);
select repeat('taos', 2);
select repeat(name, 3) from ts_4893.d0 order by ts limit 10;
select repeat(name, 3) from ts_4893.meters order by ts limit 10;
select repeat(nch1, 3) from ts_4893.d0 order by ts limit 10;
select repeat(nch1, 3) from ts_4893.meters order by ts limit 10;
select repeat(var1, 3) from ts_4893.d0 order by ts limit 10;
select repeat(var1, 3) from ts_4893.meters order by ts limit 10;
select repeat(name, groupid) from ts_4893.d0 order by ts limit 10;
select repeat(name, groupid) from ts_4893.meters order by ts limit 10;
select repeat(nch1, groupid) from ts_4893.d0 order by ts limit 10;
select repeat(nch1, groupid) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,7 @@
select replace();
select replace('aabbccdd', , 'ee');
select replace('aabbccdd', 'aa', );
select replace(, 'aa', 'ee');
select replace(123345, 1, 'ee');
select replace('aabbccdd', 1, 'ee');
select replace('aabbccdd', 'a', 1);

View File

@ -80,4 +80,19 @@ select replace('一二三四五六七abcdefghijk213124123', var2, 'var2') from t
select replace('一二三四五六七abcdefghijk213124123', var2, 'var2') from ts_4893.meters where position(var2 IN '一二三四五六七abcdefghijk213124123') = 0 order by ts limit 5;
select replace('一二三四五六七abcdefghijk213124123', var2, nch2) from ts_4893.meters order by ts limit 5;
select replace('一二三四五六七abcdefghijk213124123', var2, nch2) from ts_4893.meters where position(var2 IN '一二三四五六七abcdefghijk213124123') != 0 order by ts limit 5;
select replace('一二三四五六七abcdefghijk213124123', var2, nch2) from ts_4893.meters where position(var2 IN '一二三四五六七abcdefghijk213124123') = 0 order by ts limit 5;
select replace('一二三四五六七abcdefghijk213124123', var2, nch2) from ts_4893.meters where position(var2 IN '一二三四五六七abcdefghijk213124123') = 0 order by ts limit 5;
select replace('aabbccdd','aa', 'ee');
select replace('aabbccdd','AA', 'ee');
select replace('北京','北' , '南');
select replace('北京','京' , '南');
select replace('北京taos','北' , '南');
select replace(nch1, nch2, 't') from ts_4893.d0 order by ts limit 10;
select replace(nch1, nch2, 't') from ts_4893.meters order by ts limit 10;
select replace(nch1, var2, 't') from ts_4893.d0 order by ts limit 10;
select replace(nch1, var2, 't') from ts_4893.meters order by ts limit 10;
select replace(var1, nch2, 't') from ts_4893.d0 order by ts limit 10;
select replace(var1, nch2, 't') from ts_4893.meters order by ts limit 10;
select replace(var1, var2, 't') from ts_4893.d0 order by ts limit 10;
select replace(var1, var2, 't') from ts_4893.meters order by ts limit 10;
select replace(nch1, nch2, var1) from ts_4893.d0 order by ts limit 10;
select replace(nch1, nch2, var1) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,5 @@
select round();
select round(10, );
select round(, 2);
select round('abc', 2);
select round(123.23, 'a');

View File

@ -17,3 +17,14 @@ select ROUND(current) from ts_4893.meters order by ts limit 20;
select ROUND(87654321.123456789, id) from ts_4893.meters order by ts limit 10;
select ROUND(current, id) from ts_4893.meters order by ts limit 10;
select ROUND(current, 1) from ts_4893.meters order by ts limit 10;
select round(10.55, 3);
select round(10.55, 2);
select round(10.55, 1);
select round(10.55, 0);
select round(10.55);
select round(10.55, -1);
select round(10.55, -10);
select round(-10.55, 1);
select round(99, 1);
select round(current) from ts_4893.d0 order by ts limit 10;
select round(current) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,3 @@
select sign();
select sign('abc');
select sign(10, 1);

View File

@ -27,4 +27,10 @@ select pow(SIGN(10), 2);
select sqrt(SIGN(10));
select cast(SIGN(10) as int);
select SIGN(sqrt(id)) from ts_4893.meters order by ts limit 5;
select SIGN(SIGN(SIGN(SIGN(0))));
select SIGN(SIGN(SIGN(SIGN(0))));
select sign(1);
select sign(10);
select sign(-1);
select sign(-10);
select sign(current) from ts_4893.d0 order by ts limit 10;
select sign(current) from ts_4893.meters order by ts limit 10;

View File

@ -0,0 +1,8 @@
select stddev_pop() from ts_4893.d0;
select stddev_pop(ts) from ts_4893.d0;
select stddev_pop(name) from ts_4893.d0;
select stddev_pop(id, current) from ts_4893.d0;
select stddev_pop() from ts_4893.meters;
select stddev_pop(ts) from ts_4893.meters;
select stddev_pop(name) from ts_4893.meters;
select stddev_pop(id, current) from ts_4893.meters;

Some files were not shown because too many files have changed in this diff Show More