Merge branch '3.0' into feature/TD-13041

This commit is contained in:
wangmm0220 2022-07-14 16:34:04 +08:00
commit bb6ecd6913
144 changed files with 896 additions and 1338 deletions

View File

@ -79,10 +79,16 @@ ENDIF ()
option(
BUILD_SANITIZER
"If build addr2line"
"If build sanitizer"
OFF
)
option(
TDENGINE_3
"TDengine 3.x"
ON
)
option(
BUILD_ADDR2LINE
"If build addr2line"

View File

@ -161,7 +161,6 @@ typedef struct SQueryTableDataCond {
int64_t endVersion;
} SQueryTableDataCond;
void* blockDataDestroy(SSDataBlock* pBlock);
int32_t tEncodeDataBlock(void** buf, const SSDataBlock* pBlock);
void* tDecodeDataBlock(const void* buf, SSDataBlock* pBlock);
@ -169,19 +168,6 @@ int32_t tEncodeDataBlocks(void** buf, const SArray* blocks);
void* tDecodeDataBlocks(const void* buf, SArray** blocks);
void colDataDestroy(SColumnInfoData* pColData);
static FORCE_INLINE void blockDestroyInner(SSDataBlock* pBlock) {
int32_t numOfOutput = taosArrayGetSize(pBlock->pDataBlock);
for (int32_t i = 0; i < numOfOutput; ++i) {
SColumnInfoData* pColInfoData = (SColumnInfoData*)taosArrayGet(pBlock->pDataBlock, i);
colDataDestroy(pColInfoData);
}
taosArrayDestroy(pBlock->pDataBlock);
taosMemoryFreeClear(pBlock->pBlockAgg);
}
static FORCE_INLINE void tDeleteSSDataBlock(SSDataBlock* pBlock) { blockDestroyInner(pBlock); }
//======================================================================================================================
// the following structure shared by parser and executor
typedef struct SColumn {

View File

@ -226,8 +226,12 @@ int32_t blockDataKeepFirstNRows(SSDataBlock* pBlock, size_t n);
int32_t assignOneDataBlock(SSDataBlock* dst, const SSDataBlock* src);
int32_t copyDataBlock(SSDataBlock* dst, const SSDataBlock* src);
SSDataBlock* createOneDataBlock(const SSDataBlock* pDataBlock, bool copyData);
SSDataBlock* createDataBlock();
void* blockDataDestroy(SSDataBlock* pBlock);
void blockDataFreeRes(SSDataBlock* pBlock);
SSDataBlock* createOneDataBlock(const SSDataBlock* pDataBlock, bool copyData);
int32_t blockDataAppendColInfo(SSDataBlock* pBlock, SColumnInfoData* pColInfoData);
SColumnInfoData createColumnInfoData(int16_t type, int32_t bytes, int16_t colId);

View File

@ -340,12 +340,12 @@ static FORCE_INLINE int32_t streamTaskOutput(SStreamTask* pTask, SStreamDataBloc
if (pTask->sinkType == TASK_SINK__TABLE) {
ASSERT(pTask->dispatchType == TASK_DISPATCH__NONE);
pTask->tbSink.tbSinkFunc(pTask, pTask->tbSink.vnode, 0, pBlock->blocks);
taosArrayDestroyEx(pBlock->blocks, (FDelete)tDeleteSSDataBlock);
taosArrayDestroyEx(pBlock->blocks, (FDelete)blockDataFreeRes);
taosFreeQitem(pBlock);
} else if (pTask->sinkType == TASK_SINK__SMA) {
ASSERT(pTask->dispatchType == TASK_DISPATCH__NONE);
pTask->smaSink.smaSink(pTask->smaSink.vnode, pTask->smaSink.smaId, pBlock->blocks);
taosArrayDestroyEx(pBlock->blocks, (FDelete)tDeleteSSDataBlock);
taosArrayDestroyEx(pBlock->blocks, (FDelete)blockDataFreeRes);
taosFreeQitem(pBlock);
} else {
ASSERT(pTask->dispatchType != TASK_DISPATCH__NONE);

View File

@ -22,7 +22,10 @@ extern "C" {
#if defined(_TD_DARWIN_64)
// specific
#ifndef __COMPAR_FN_T
#define __COMPAR_FN_T
typedef int(*__compar_fn_t)(const void *, const void *);
#endif
// for send function in tsocket.c
#if defined(MSG_NOSIGNAL)
@ -41,7 +44,10 @@ extern "C" {
#endif
#if defined(_ALPINE)
#ifndef __COMPAR_FN_T
#define __COMPAR_FN_T
typedef int(*__compar_fn_t)(const void *, const void *);
#endif
void error (int, int, const char *);
#ifndef PTHREAD_MUTEX_RECURSIVE_NP
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
@ -54,7 +60,10 @@ extern "C" {
char *stpncpy (char *dest, const char *src, size_t n);
// specific
#ifndef __COMPAR_FN_T
#define __COMPAR_FN_T
typedef int (*__compar_fn_t)(const void *, const void *);
#endif
#define ssize_t int
#define _SSIZE_T_
#define bzero(ptr, size) memset((ptr), 0, (size))
@ -69,7 +78,6 @@ extern "C" {
char * strsep(char **stringp, const char *delim);
char * getpass(const char *prefix);
char * strndup(const char *s, size_t n);
int gettimeofday(struct timeval *ptv, void *pTimeZone);
// for send function in tsocket.c
#define MSG_NOSIGNAL 0

View File

@ -542,8 +542,10 @@ int32_t blockDataToBuf(char* buf, const SSDataBlock* pBlock) {
}
int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
pBlock->info.rows = *(int32_t*)buf;
int32_t numOfRows = *(int32_t*) buf;
blockDataEnsureCapacity(pBlock, numOfRows);
pBlock->info.rows = numOfRows;
size_t numOfCols = taosArrayGetSize(pBlock->pDataBlock);
const char* pStart = buf + sizeof(uint32_t);
@ -589,6 +591,7 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
return TSDB_CODE_SUCCESS;
}
// todo remove this
int32_t blockDataFromBuf1(SSDataBlock* pBlock, const char* buf, size_t capacity) {
pBlock->info.rows = *(int32_t*)buf;
pBlock->info.groupId = *(uint64_t*)(buf + sizeof(int32_t));
@ -1194,15 +1197,28 @@ int32_t blockDataEnsureCapacity(SSDataBlock* pDataBlock, uint32_t numOfRows) {
return TSDB_CODE_SUCCESS;
}
void blockDataFreeRes(SSDataBlock* pBlock) {
int32_t numOfOutput = taosArrayGetSize(pBlock->pDataBlock);
for (int32_t i = 0; i < numOfOutput; ++i) {
SColumnInfoData* pColInfoData = (SColumnInfoData*)taosArrayGet(pBlock->pDataBlock, i);
colDataDestroy(pColInfoData);
}
taosArrayDestroy(pBlock->pDataBlock);
taosMemoryFreeClear(pBlock->pBlockAgg);
memset(&pBlock->info, 0, sizeof(SDataBlockInfo));
}
void* blockDataDestroy(SSDataBlock* pBlock) {
if (pBlock == NULL) {
return NULL;
}
blockDestroyInner(pBlock);
blockDataFreeRes(pBlock);
taosMemoryFreeClear(pBlock);
return NULL;
}
int32_t assignOneDataBlock(SSDataBlock* dst, const SSDataBlock* src) {
ASSERT(src != NULL);

View File

@ -168,7 +168,12 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
memcpy(pMsg, pRpc, sizeof(SRpcMsg));
dTrace("msg:%p, is created and will put into %s queue, type:%s", pMsg, pWorker->name, TMSG_INFO(pRpc->msgType));
return mmPutMsgToWorker(pMgmt, pWorker, pMsg);
int32_t code = mmPutMsgToWorker(pMgmt, pWorker, pMsg);
if (code != 0) {
dTrace("msg:%p, is freed", pMsg);
taosFreeQitem(pMsg);
}
return code;
}
int32_t mmStartWorker(SMnodeMgmt *pMgmt) {

View File

@ -319,7 +319,7 @@ int32_t tqRetrieveDataBlock(SSDataBlock* pBlock, STqReader* pReader) {
return 0;
FAIL:
tDeleteSSDataBlock(pBlock);
blockDataFreeRes(pBlock);
return -1;
}

View File

@ -209,10 +209,10 @@ static void resetDataBlockScanInfo(SHashObj* pTableMap) {
p->iterInit = false;
p->iiter.hasVal = false;
if (p->iter.iter != NULL) {
tsdbTbDataIterDestroy(p->iter.iter);
p->iter.iter = tsdbTbDataIterDestroy(p->iter.iter);
}
taosArrayDestroy(p->delSkyline);
p->delSkyline = taosArrayDestroy(p->delSkyline);
}
}
@ -224,18 +224,15 @@ static void destroyBlockScanInfo(SHashObj* pTableMap) {
p->iiter.hasVal = false;
if (p->iter.iter != NULL) {
tsdbTbDataIterDestroy(p->iter.iter);
p->iter.iter = NULL;
p->iter.iter = tsdbTbDataIterDestroy(p->iter.iter);
}
if (p->iiter.iter != NULL) {
tsdbTbDataIterDestroy(p->iiter.iter);
p->iiter.iter = NULL;
p->iiter.iter = tsdbTbDataIterDestroy(p->iiter.iter);
}
taosArrayDestroy(p->delSkyline);
taosArrayDestroy(p->pBlockList);
p->delSkyline = NULL;
p->delSkyline = taosArrayDestroy(p->delSkyline);
p->pBlockList = taosArrayDestroy(p->pBlockList);
}
taosHashCleanup(pTableMap);

View File

@ -307,7 +307,6 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
SNode* pTagIndexCond = (SNode*)pListInfo->pTagIndexCond;
if (pScanNode->tableType == TSDB_SUPER_TABLE) {
if (pTagIndexCond) {
///<<<<<<< HEAD
SIndexMetaArg metaArg = {
.metaEx = metaHandle, .idx = tsdbGetIdx(metaHandle), .ivtIdx = tsdbGetIvtIdx(metaHandle), .suid = tableUid};
@ -315,20 +314,9 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
SIdxFltStatus status = SFLT_NOT_INDEX;
code = doFilterTag(pTagIndexCond, &metaArg, res, &status);
if (code != 0 || status == SFLT_NOT_INDEX) {
code = TSDB_CODE_INDEX_REBUILDING;
}
//=======
// SArray* res = taosArrayInit(8, sizeof(uint64_t));
// // code = doFilterTag(pTagIndexCond, &metaArg, res);
// code = TSDB_CODE_INDEX_REBUILDING;
//>>>>>>> dvv
if (code == TSDB_CODE_INDEX_REBUILDING) {
qError("failed to get tableIds from index, reason:%s, suid:%" PRIu64, tstrerror(code), tableUid);
// code = TSDB_CODE_INDEX_REBUILDING;
code = vnodeGetAllTableList(pVnode, tableUid, pListInfo->pTableList);
} else if (code != TSDB_CODE_SUCCESS) {
qError("failed to get tableIds, reason:%s, suid:%" PRIu64, tstrerror(code), tableUid);
taosArrayDestroy(res);
terrno = code;
return code;
} else {
qDebug("success to get tableIds, size:%d, suid:%" PRIu64, (int)taosArrayGetSize(res), tableUid);
}
@ -347,25 +335,25 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
terrno = code;
return code;
}
if (pTagCond) {
int32_t i = 0;
while (i < taosArrayGetSize(pListInfo->pTableList)) {
STableKeyInfo* info = taosArrayGet(pListInfo->pTableList, i);
bool isOk = isTableOk(info, pTagCond, metaHandle);
if (terrno) return terrno;
if (!isOk) {
taosArrayRemove(pListInfo->pTableList, i);
continue;
}
i++;
}
}
} else { // Create one table group.
STableKeyInfo info = {.lastKey = 0, .uid = tableUid, .groupId = 0};
taosArrayPush(pListInfo->pTableList, &info);
}
if (pTagCond) {
int32_t i = 0;
while (i < taosArrayGetSize(pListInfo->pTableList)) {
STableKeyInfo* info = taosArrayGet(pListInfo->pTableList, i);
bool isOk = isTableOk(info, pTagCond, metaHandle);
if (terrno) return terrno;
if (!isOk) {
taosArrayRemove(pListInfo->pTableList, i);
continue;
}
i++;
}
}
pListInfo->pGroupList = taosArrayInit(4, POINTER_BYTES);
if (pListInfo->pGroupList == NULL) {
return TSDB_CODE_OUT_OF_MEMORY;
@ -853,6 +841,9 @@ static STimeWindow doCalculateTimeWindow(int64_t ts, SInterval* pInterval) {
w.ekey = taosTimeAdd(w.skey, pInterval->interval, pInterval->intervalUnit, pInterval->precision) - 1;
} else {
int64_t st = w.skey;
if (pInterval->offset > 0) {
st = taosTimeAdd(st, pInterval->offset, pInterval->offsetUnit, pInterval->precision);
}
if (st > ts) {
st -= ((st - ts + pInterval->sliding - 1) / pInterval->sliding) * pInterval->sliding;

View File

@ -1193,8 +1193,6 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock
}
}
taosArrayDestroy(pBlock->pDataBlock);
ASSERT(pInfo->pRes->pDataBlock != NULL);
// currently only the tbname pseudo column
@ -1202,12 +1200,14 @@ static int32_t setBlockIntoRes(SStreamScanInfo* pInfo, const SSDataBlock* pBlock
int32_t code = addTagPseudoColumnData(&pInfo->readHandle, pInfo->pPseudoExpr, pInfo->numOfPseudoExpr, pInfo->pRes,
GET_TASKID(pTaskInfo));
if (code != TSDB_CODE_SUCCESS) {
blockDataFreeRes((SSDataBlock*) pBlock);
longjmp(pTaskInfo->env, code);
}
}
doFilter(pInfo->pCondition, pInfo->pRes);
blockDataUpdateTsWindow(pInfo->pRes, pInfo->primaryTsIndex);
blockDataFreeRes((SSDataBlock*) pBlock);
return 0;
}

View File

@ -53,8 +53,8 @@ static void setNullRow(SSDataBlock* pBlock, int64_t ts, int32_t rowIndex) {
// the first are always the timestamp column, so start from the second column.
for (int32_t i = 0; i < taosArrayGetSize(pBlock->pDataBlock); ++i) {
SColumnInfoData* p = taosArrayGet(pBlock->pDataBlock, i);
if (p->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
colDataAppend(p, rowIndex, (const char*)&ts, false);
if (p->info.type == TSDB_DATA_TYPE_TIMESTAMP) { // handle timestamp
colDataAppend(p, rowIndex, (const char*)&ts, false);
} else {
colDataAppendNULL(p, rowIndex);
}
@ -71,66 +71,76 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
SPoint point1, point2, point;
int32_t step = GET_FORWARD_DIRECTION_FACTOR(pFillInfo->order);
// set the primary timestamp column value
int32_t index = pFillInfo->numOfCurrent;
SColumnInfoData* pCol0 = taosArrayGet(pBlock->pDataBlock, pFillInfo->tsSlotId);
char* val = colDataGetData(pCol0, index);
// set the primary timestamp value
*(TSKEY*)val = pFillInfo->currentKey;
// set the primary timestamp column value
int32_t index = pFillInfo->numOfCurrent;
// set the other values
if (pFillInfo->type == TSDB_FILL_PREV) {
SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->prev : pFillInfo->next;
for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) {
for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
if (TSDB_COL_IS_TAG(pCol->flag)) {
continue;
}
SGroupKeys* pKey = taosArrayGet(p, i);
SColumnInfoData* pDstColInfoData = taosArrayGet(pBlock->pDataBlock, GET_DEST_SLOT_ID(pCol));
doSetVal(pDstColInfoData, index, pKey);
if (pDstColInfoData->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
colDataAppend(pDstColInfoData, index, (const char*)&pFillInfo->currentKey, false);
} else {
SGroupKeys* pKey = taosArrayGet(p, i);
doSetVal(pDstColInfoData, index, pKey);
}
}
} else if (pFillInfo->type == TSDB_FILL_NEXT) {
SArray* p = FILL_IS_ASC_FILL(pFillInfo) ? pFillInfo->next : pFillInfo->prev;
// todo refactor: start from 0 not 1
for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) {
for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
if (TSDB_COL_IS_TAG(pCol->flag)) {
continue;
}
SGroupKeys* pKey = taosArrayGet(p, i);
SColumnInfoData* pDstColInfoData = taosArrayGet(pBlock->pDataBlock, GET_DEST_SLOT_ID(pCol));
doSetVal(pDstColInfoData, index, pKey);
if (pDstColInfoData->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
colDataAppend(pDstColInfoData, index, (const char*)&pFillInfo->currentKey, false);
} else {
SGroupKeys* pKey = taosArrayGet(p, i);
doSetVal(pDstColInfoData, index, pKey);
}
}
} else if (pFillInfo->type == TSDB_FILL_LINEAR) {
// TODO : linear interpolation supports NULL value
if (outOfBound) {
setNullRow(pBlock, pFillInfo->currentKey, index);
} else {
for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) {
for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
if (TSDB_COL_IS_TAG(pCol->flag)) {
continue;
}
int32_t srcSlotId = GET_SRC_SLOT_ID(pCol);
int32_t dstSlotId = GET_DEST_SLOT_ID(pCol);
SColumnInfoData* pDstCol = taosArrayGet(pBlock->pDataBlock, dstSlotId);
int16_t type = pCol->pExpr->base.resSchema.type;
int16_t type = pDstCol->info.type;
if (type == TSDB_DATA_TYPE_TIMESTAMP) {
colDataAppend(pDstCol, index, (const char*)&pFillInfo->currentKey, false);
continue;
}
SGroupKeys* pKey = taosArrayGet(pFillInfo->prev, i);
if (IS_VAR_DATA_TYPE(type) || type == TSDB_DATA_TYPE_BOOL || pKey->isNull) {
colDataAppendNULL(pDstCol, index);
continue;
}
SGroupKeys* pKey1 = taosArrayGet(pFillInfo->prev, 0);
int64_t prevTs = *(int64_t*)pKey1->pData;
SGroupKeys* pKey1 = taosArrayGet(pFillInfo->prev, pFillInfo->tsSlotId);
int64_t prevTs = *(int64_t*)pKey1->pData;
int32_t srcSlotId = GET_SRC_SLOT_ID(pCol);
SColumnInfoData* pSrcCol = taosArrayGet(pSrcBlock->pDataBlock, srcSlotId);
char* data = colDataGetData(pSrcCol, pFillInfo->index);
@ -148,7 +158,7 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
} else if (pFillInfo->type == TSDB_FILL_NULL) { // fill with NULL
setNullRow(pBlock, pFillInfo->currentKey, index);
} else { // fill with user specified value for each column
for (int32_t i = 1; i < pFillInfo->numOfCols; ++i) {
for (int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
SFillColInfo* pCol = &pFillInfo->pFillCol[i];
if (TSDB_COL_IS_TAG(pCol->flag) /* || IS_VAR_DATA_TYPE(pCol->schema.type)*/) {
continue;
@ -171,6 +181,8 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
colDataAppend(pDst, index, (char*)&v, false);
} else if (pDst->info.type == TSDB_DATA_TYPE_TIMESTAMP) {
colDataAppend(pDst, index, (const char*)&pFillInfo->currentKey, false);
} else { // varchar/nchar data
colDataAppendNULL(pDst, index);
}
}
}
@ -229,8 +241,7 @@ static void copyCurrentRowIntoBuf(SFillInfo* pFillInfo, int32_t rowIndex, SArray
static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t outputRows) {
pFillInfo->numOfCurrent = 0;
// todo make sure the first column is always the primary timestamp column?
SColumnInfoData* pTsCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, 0);
SColumnInfoData* pTsCol = taosArrayGet(pFillInfo->pSrcBlock->pDataBlock, pFillInfo->tsSlotId);
int32_t step = GET_FORWARD_DIRECTION_FACTOR(pFillInfo->order);
bool ascFill = FILL_IS_ASC_FILL(pFillInfo);
@ -264,9 +275,8 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
assert(pFillInfo->currentKey == ts);
if (pFillInfo->type == TSDB_FILL_NEXT && (pFillInfo->index + 1) < pFillInfo->numOfRows) {
++pFillInfo->index;
copyCurrentRowIntoBuf(pFillInfo, pFillInfo->index, pFillInfo->next);
--pFillInfo->index;
int32_t nextRowIndex = pFillInfo->index + 1;
copyCurrentRowIntoBuf(pFillInfo, nextRowIndex, pFillInfo->next);
}
// assign rows to dst buffer

View File

@ -3461,9 +3461,16 @@ void doAddIntoResult(SqlFunctionCtx* pCtx, void* pData, int32_t rowIndex, SSData
}
}
/*
* +------------------------------------+--------------+--------------+
* | null bitmap | | |
* |(n columns, one bit for each column)| src column #1| src column #2|
* +------------------------------------+--------------+--------------+
*/
void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pSrcBlock, STuplePos* pPos) {
SFilePage* pPage = NULL;
// todo refactor: move away
int32_t completeRowSize = pCtx->subsidiaries.num * sizeof(bool);
for (int32_t j = 0; j < pCtx->subsidiaries.num; ++j) {
SqlFunctionCtx* pc = pCtx->subsidiaries.pCtx[j];
@ -3476,12 +3483,15 @@ void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pS
} else {
pPage = getBufPage(pCtx->pBuf, pCtx->curBufPage);
if (pPage->num + completeRowSize > getBufPageSize(pCtx->pBuf)) {
// current page is all used, let's prepare a new buffer page
releaseBufPage(pCtx->pBuf, pPage);
pPage = getNewBufPage(pCtx->pBuf, 0, &pCtx->curBufPage);
pPage->num = sizeof(SFilePage);
}
}
pPos->pageId = pCtx->curBufPage;
pPos->offset = pPage->num;
// keep the current row data, extract method
int32_t offset = 0;
@ -3509,7 +3519,6 @@ void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pS
offset += pCol->info.bytes;
}
pPos->offset = pPage->num;
pPage->num += completeRowSize;
setBufPageDirty(pPage, true);
@ -4839,7 +4848,7 @@ static void doReservoirSample(SqlFunctionCtx* pCtx, SSampleInfo* pInfo, char* da
if (pInfo->numSampled < pInfo->samples) {
sampleAssignResult(pInfo, data, pInfo->numSampled);
if (pCtx->subsidiaries.num > 0) {
saveTupleData(pCtx, index, pCtx->pSrcBlock, pInfo->tuplePos + pInfo->numSampled * sizeof(STuplePos));
saveTupleData(pCtx, index, pCtx->pSrcBlock, &pInfo->tuplePos[pInfo->numSampled]);
}
pInfo->numSampled++;
} else {
@ -4847,7 +4856,7 @@ static void doReservoirSample(SqlFunctionCtx* pCtx, SSampleInfo* pInfo, char* da
if (j < pInfo->samples) {
sampleAssignResult(pInfo, data, j);
if (pCtx->subsidiaries.num > 0) {
copyTupleData(pCtx, index, pCtx->pSrcBlock, pInfo->tuplePos + j * sizeof(STuplePos));
copyTupleData(pCtx, index, pCtx->pSrcBlock, &pInfo->tuplePos[j]);
}
}
}
@ -4885,7 +4894,7 @@ int32_t sampleFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
int32_t currentRow = pBlock->info.rows;
for (int32_t i = 0; i < pInfo->numSampled; ++i) {
colDataAppend(pCol, currentRow + i, pInfo->data + i * pInfo->colBytes, false);
setSelectivityValue(pCtx, pBlock, pInfo->tuplePos + i * sizeof(STuplePos), currentRow + i);
setSelectivityValue(pCtx, pBlock, &pInfo->tuplePos[i], currentRow + i);
}
return pInfo->numSampled;

View File

@ -296,8 +296,8 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
switch (call->callType) {
case TSDB_UDF_CALL_SCALA_PROC: {
tDeleteSSDataBlock(&call->block);
tDeleteSSDataBlock(&subRsp->resultData);
blockDataFreeRes(&call->block);
blockDataFreeRes(&subRsp->resultData);
break;
}
case TSDB_UDF_CALL_AGG_INIT: {
@ -305,7 +305,7 @@ void udfdProcessCallRequest(SUvUdfWork *uvUdf, SUdfRequest *request) {
break;
}
case TSDB_UDF_CALL_AGG_PROC: {
tDeleteSSDataBlock(&call->block);
blockDataFreeRes(&call->block);
freeUdfInterBuf(&subRsp->resultBuf);
break;
}

View File

@ -5954,7 +5954,8 @@ static int32_t buildAddColReq(STranslateContext* pCxt, SAlterTableStmt* pStmt, S
pReq->type = pStmt->dataType.type;
pReq->flags = COL_SMA_ON;
pReq->bytes = pStmt->dataType.bytes;
// pReq->bytes = pStmt->dataType.bytes;
pReq->bytes = calcTypeBytes(pStmt->dataType);
return TSDB_CODE_SUCCESS;
}

View File

@ -116,7 +116,7 @@ void streamFreeQitem(SStreamQueueItem* data) {
blockDataDestroy(((SStreamTrigger*)data)->pBlock);
taosFreeQitem(data);
} else if (type == STREAM_INPUT__DATA_BLOCK || type == STREAM_INPUT__DATA_RETRIEVE) {
taosArrayDestroyEx(((SStreamDataBlock*)data)->blocks, (FDelete)tDeleteSSDataBlock);
taosArrayDestroyEx(((SStreamDataBlock*)data)->blocks, (FDelete)blockDataFreeRes);
taosFreeQitem(data);
} else if (type == STREAM_INPUT__DATA_SUBMIT) {
streamDataSubmitRefDec((SStreamDataSubmit*)data);

View File

@ -313,7 +313,7 @@ int32_t streamDispatch(SStreamTask* pTask, SMsgCb* pMsgCb) {
atomic_store_8(&pTask->outputStatus, TASK_OUTPUT_STATUS__NORMAL);
return -1;
}
taosArrayDestroyEx(pBlock->blocks, (FDelete)tDeleteSSDataBlock);
taosArrayDestroyEx(pBlock->blocks, (FDelete)blockDataFreeRes);
taosFreeQitem(pBlock);
tmsgSendReq(pEpSet, &dispatchMsg);

View File

@ -106,7 +106,7 @@ static SArray* streamExecForQall(SStreamTask* pTask, SArray* pRes) {
qDebug("stream task %d exec end", pTask->taskId);
if (pTask->taskStatus == TASK_STATUS__DROPPING) {
taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock);
taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes);
return NULL;
}
@ -121,7 +121,7 @@ static SArray* streamExecForQall(SStreamTask* pTask, SArray* pRes) {
qRes->blocks = pRes;
if (streamTaskOutput(pTask, qRes) < 0) {
/*streamQueueProcessFail(pTask->inputQueue);*/
taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock);
taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes);
taosFreeQitem(qRes);
return NULL;
}
@ -155,7 +155,7 @@ int32_t streamExec(SStreamTask* pTask, SMsgCb* pMsgCb) {
pRes = streamExecForQall(pTask, pRes);
if (pRes == NULL) goto FAIL;
taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock);
taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes);
atomic_store_8(&pTask->execStatus, TASK_EXEC_STATUS__IDLE);
qDebug("stream exec, return result");
return 0;
@ -163,7 +163,7 @@ int32_t streamExec(SStreamTask* pTask, SMsgCb* pMsgCb) {
continue;
} else if (execStatus == TASK_EXEC_STATUS__EXECUTING) {
ASSERT(taosArrayGetSize(pRes) == 0);
taosArrayDestroyEx(pRes, (FDelete)tDeleteSSDataBlock);
taosArrayDestroyEx(pRes, (FDelete)blockDataFreeRes);
return 0;
} else {
ASSERT(0);

View File

@ -17,7 +17,7 @@
#include "ttime.h"
#define DEFAULT_FALSE_POSITIVE 0.01
#define DEFAULT_BUCKET_SIZE 1024
#define DEFAULT_BUCKET_SIZE 131072
#define ROWS_PER_MILLISECOND 1
#define MAX_NUM_SCALABLE_BF 100000
#define MIN_NUM_SCALABLE_BF 10

View File

@ -382,7 +382,7 @@ class TDDnode:
if self.valgrind == 0:
if platform.system().lower() == 'windows':
cmd = "mintty -h never -w hide %s -c %s" % (
cmd = "mintty -h never %s -c %s" % (
binPath, self.cfgDir)
else:
cmd = "nohup %s -c %s > /dev/null 2>&1 & " % (
@ -391,7 +391,7 @@ class TDDnode:
valgrindCmdline = "valgrind --log-file=\"%s/../log/valgrind.log\" --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes"%self.cfgDir
if platform.system().lower() == 'windows':
cmd = "mintty -h never -w hide %s %s -c %s" % (
cmd = "mintty -h never %s %s -c %s" % (
valgrindCmdline, binPath, self.cfgDir)
else:
cmd = "nohup %s %s -c %s 2>&1 & " % (
@ -518,20 +518,20 @@ class TDDnode:
if self.running != 0:
if platform.system().lower() == 'windows':
os.system("wmic process where \"name='taosd.exe' and CommandLine like '%%dnode%d%%'\" get processId | xargs echo | awk '{print $2}' | xargs taskkill -f -pid"%self.index)
psCmd = "for /f %a in ('wmic process where \"name='taosd.exe' and CommandLine like '%%dnode%d%%'\" get processId ^| xargs echo ^| awk ^'{print $2}^'') do @(ps | grep %a | awk '{print $1}' | xargs kill -INT )" % (self.index)
else:
psCmd = "ps -ef|grep -w %s| grep dnode%d|grep -v grep | awk '{print $2}'" % (toBeKilled,self.index)
processID = subprocess.check_output(
psCmd, shell=True).decode("utf-8")
while(processID):
killCmd = "kill -INT %s > /dev/null 2>&1" % processID
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(
psCmd, shell=True).decode("utf-8")
while(processID):
killCmd = "kill -INT %s > /dev/null 2>&1" % processID
os.system(killCmd)
time.sleep(1)
processID = subprocess.check_output(
psCmd, shell=True).decode("utf-8")
if self.valgrind:
time.sleep(2)
if self.valgrind:
time.sleep(2)
self.running = 0
tdLog.debug("dnode:%d is stopped by kill -INT" % (self.index))

View File

@ -1,21 +0,0 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ============= step1
sql close
print close1
sql connect
print ============= step2
sql close
sql connect
print ============= step3
sql close
sql connect
system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -1,19 +0,0 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 100000
system sh/cfg.sh -n dnode1 -c http -v 1
system sh/cfg.sh -n dnode1 -c mqtt -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql create database mqttdb;
sql create table mqttdb.devices(ts timestamp, value double) tags(name binary(32), model binary(32), serial binary(16), param binary(16), unit binary(16));
sleep 1000
system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -1,32 +0,0 @@
system sh/stop_dnodes.sh
system sh/mv_old_data.sh
print ============== deploy
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
print =============== step1
sql use test
sql select * from m1
print $rows points data are retrieved
if $rows != 7 then
return -1
endi
print =============== step 2
sql select * from t1
print $rows points data are retrieved
if $rows != 7 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT

View File

@ -1,9 +0,0 @@
run general/insert/basic.sim
run general/insert/insert_drop.sim
run general/insert/query_block1_memory.sim
run general/insert/query_block2_memory.sim
run general/insert/query_block1_file.sim
run general/insert/query_block2_file.sim
run general/insert/query_file_memory.sim
run general/insert/query_multi_file.sim
run general/insert/tcp.sim

View File

@ -1,25 +0,0 @@
run general/tag/3.sim
run general/tag/4.sim
run general/tag/5.sim
run general/tag/6.sim
run general/tag/add.sim
run general/tag/bigint.sim
run general/tag/binary_binary.sim
run general/tag/binary.sim
run general/tag/bool_binary.sim
run general/tag/bool_int.sim
run general/tag/bool.sim
run general/tag/change.sim
run general/tag/column.sim
run general/tag/commit.sim
run general/tag/create.sim
run general/tag/delete.sim
run general/tag/double.sim
run general/tag/filter.sim
run general/tag/float.sim
run general/tag/int_binary.sim
run general/tag/int_float.sim
run general/tag/int.sim
run general/tag/set.sim
run general/tag/smallint.sim
run general/tag/tinyint.sim

View File

@ -1,27 +0,0 @@
run general/table/autocreate.sim
run general/table/basic1.sim
run general/table/basic2.sim
run general/table/basic3.sim
run general/table/bigint.sim
run general/table/binary.sim
run general/table/bool.sim
run general/table/column_name.sim
run general/table/column_num.sim
run general/table/column_value.sim
run general/table/column2.sim
run general/table/date.sim
run general/table/db.table.sim
run general/table/delete_reuse1.sim
run general/table/delete_reuse2.sim
run general/table/delete_writing.sim
run general/table/describe.sim
run general/table/double.sim
run general/table/fill.sim
run general/table/float.sim
run general/table/int.sim
run general/table/limit.sim
run general/table/smallint.sim
run general/table/table_len.sim
run general/table/table.sim
run general/table/tinyint.sim
run general/table/vgroup.sim

View File

@ -52,13 +52,22 @@
./test.sh -f tsim/import/replica1.sim
# ---- insert
./test.sh -f tsim/insert/backquote.sim
./test.sh -f tsim/insert/basic.sim
./test.sh -f tsim/insert/basic0.sim
./test.sh -f tsim/insert/basic1.sim
./test.sh -f tsim/insert/backquote.sim
./test.sh -f tsim/insert/null.sim
./test.sh -f tsim/insert/update0.sim
./test.sh -f tsim/insert/commit-merge0.sim
./test.sh -f tsim/insert/insert_drop.sim
./test.sh -f tsim/insert/insert_select.sim
./test.sh -f tsim/insert/null.sim
./test.sh -f tsim/insert/query_block1_file.sim
./test.sh -f tsim/insert/query_block1_memory.sim
./test.sh -f tsim/insert/query_block2_file.sim
./test.sh -f tsim/insert/query_block2_memory.sim
./test.sh -f tsim/insert/query_file_memory.sim
./test.sh -f tsim/insert/query_multi_file.sim
#./test.sh -f tsim/insert/tcp.sim
./test.sh -f tsim/insert/update0.sim
# ---- parser
./test.sh -f tsim/parser/groupby-basic.sim
@ -94,7 +103,33 @@
./test.sh -f tsim/show/basic.sim
# ---- table
./test.sh -f tsim/table/autocreate.sim
./test.sh -f tsim/table/basic1.sim
./test.sh -f tsim/table/basic2.sim
./test.sh -f tsim/table/basic3.sim
./test.sh -f tsim/table/bigint.sim
./test.sh -f tsim/table/binary.sim
./test.sh -f tsim/table/bool.sim
./test.sh -f tsim/table/column_name.sim
./test.sh -f tsim/table/column_num.sim
./test.sh -f tsim/table/column_value.sim
./test.sh -f tsim/table/column2.sim
./test.sh -f tsim/table/createmulti.sim
./test.sh -f tsim/table/date.sim
./test.sh -f tsim/table/db.table.sim
# ./test.sh -f tsim/table/delete_reuse1.sim
# ./test.sh -f tsim/table/delete_reuse2.sim
# ./test.sh -f tsim/table/delete_writing.sim
./test.sh -f tsim/table/describe.sim
./test.sh -f tsim/table/double.sim
./test.sh -f tsim/table/float.sim
./test.sh -f tsim/table/int.sim
./test.sh -f tsim/table/limit.sim
./test.sh -f tsim/table/smallint.sim
./test.sh -f tsim/table/table_len.sim
./test.sh -f tsim/table/table.sim
./test.sh -f tsim/table/tinyint.sim
./test.sh -f tsim/table/vgroup.sim
# ---- stream
./test.sh -f tsim/stream/basic0.sim
@ -114,6 +149,7 @@
# ./test.sh -f tsim/stream/schedSnode.sim
./test.sh -f tsim/stream/windowClose.sim
./test.sh -f tsim/stream/ignoreExpiredData.sim
./test.sh -f tsim/stream/sliding.sim
# ---- transaction
./test.sh -f tsim/trans/lossdata1.sim
@ -227,23 +263,23 @@
./test.sh -f tsim/compress/uncompress.sim
# ---- compute
#./test.sh -f tsim/compute/avg.sim
./test.sh -f tsim/compute/avg.sim
#./test.sh -f tsim/compute/block_dist.sim
#./test.sh -f tsim/compute/bottom.sim
#./test.sh -f tsim/compute/count.sim
#./test.sh -f tsim/compute/diff.sim
#./test.sh -f tsim/compute/diff2.sim
#./test.sh -f tsim/compute/first.sim
#./test.sh -f tsim/compute/interval.sim
./test.sh -f tsim/compute/bottom.sim
./test.sh -f tsim/compute/count.sim
./test.sh -f tsim/compute/diff.sim
./test.sh -f tsim/compute/diff2.sim
./test.sh -f tsim/compute/first.sim
./test.sh -f tsim/compute/interval.sim
#./test.sh -f tsim/compute/last_row.sim
#./test.sh -f tsim/compute/last.sim
#./test.sh -f tsim/compute/leastsquare.sim
#./test.sh -f tsim/compute/max.sim
#./test.sh -f tsim/compute/min.sim
./test.sh -f tsim/compute/last.sim
./test.sh -f tsim/compute/leastsquare.sim
./test.sh -f tsim/compute/max.sim
./test.sh -f tsim/compute/min.sim
#./test.sh -f tsim/compute/null.sim
./test.sh -f tsim/compute/percentile.sim
./test.sh -f tsim/compute/stddev.sim
#./test.sh -f tsim/compute/sum.sim
./test.sh -f tsim/compute/sum.sim
./test.sh -f tsim/compute/top.sim
# ---- field
@ -279,4 +315,32 @@
# ---- wal
./test.sh -f tsim/wal/kill.sim
# ---- tag
./test.sh -f tsim/tag/3.sim
./test.sh -f tsim/tag/4.sim
./test.sh -f tsim/tag/5.sim
#./test.sh -f tsim/tag/6.sim
#./test.sh -f tsim/tag/add.sim
./test.sh -f tsim/tag/bigint.sim
./test.sh -f tsim/tag/binary_binary.sim
./test.sh -f tsim/tag/binary.sim
./test.sh -f tsim/tag/bool_binary.sim
./test.sh -f tsim/tag/bool_int.sim
./test.sh -f tsim/tag/bool.sim
#./test.sh -f tsim/tag/change.sim
#./test.sh -f tsim/tag/column.sim
#./test.sh -f tsim/tag/commit.sim
#./test.sh -f tsim/tag/create.sim
#./test.sh -f tsim/tag/delete.sim
#./test.sh -f tsim/tag/double.sim
#./test.sh -f tsim/tag/filter.sim
#./test.sh -f tsim/tag/float.sim
./test.sh -f tsim/tag/int_binary.sim
./test.sh -f tsim/tag/int_float.sim
./test.sh -f tsim/tag/int.sim
#./test.sh -f tsim/tag/set.sim
./test.sh -f tsim/tag/smallint.sim
./test.sh -f tsim/tag/tinyint.sim
#======================b1-end===============

View File

@ -127,8 +127,8 @@ echo "dataDir $DATA_DIR" >> $TAOS_CFG
echo "logDir $LOG_DIR" >> $TAOS_CFG
echo "debugFlag 0" >> $TAOS_CFG
echo "tmrDebugFlag 131" >> $TAOS_CFG
echo "uDebugFlag 131" >> $TAOS_CFG
echo "rpcDebugFlag 131" >> $TAOS_CFG
echo "uDebugFlag 143" >> $TAOS_CFG
echo "rpcDebugFlag 143" >> $TAOS_CFG
echo "jniDebugFlag 143" >> $TAOS_CFG
echo "qDebugFlag 143" >> $TAOS_CFG
echo "cDebugFlag 143" >> $TAOS_CFG

View File

@ -77,7 +77,10 @@ goto :eof
:check_offline
sleep 1
for /f "tokens=2" %%C in ('wmic process where "name='taosd.exe' and CommandLine like '%%%NODE_NAME%%%'" get processId ^| xargs echo') do (
echo check taosd offline
goto :check_offline
for /f "tokens=1" %%D in ('ps ^| grep %%C') do (
echo kill -INT %%D
echo check taosd offline %NODE_NAME% %%C %%D
goto :check_offline
)
)
goto :eof

View File

@ -24,7 +24,7 @@ for /F "usebackq tokens=*" %%i in (!caseFile!) do (
)
)
)
exit !exitNum!
exit /b !exitNum!
:colorEcho
set timeNow=%time%

View File

@ -660,8 +660,8 @@ endi
print ======= over
sql drop database d1
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -83,10 +83,6 @@ while $i < 10
$i = $i + 1
endw
print ==> sleep 1 seconds to renew cache
sql reset query cache
sleep 1000
print =============== step5
sql select * from $tb order by ts desc
print ===>rows $rows, data $data01

View File

@ -48,9 +48,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
print =============== step3
print ==> sleep 1 seconds to renew cache
sql reset query cache
sleep 1000
print =============== step4
sql create database $db

View File

@ -32,9 +32,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
print =============== step3
print ==> sleep 1 seconds to renew cache
sql reset query cache
sleep 1000
print =============== step4
sql create database $db

View File

@ -57,15 +57,7 @@ $tb = $tbPrefix . $i
sql create database $db
sql use $db
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256)) -x step3
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256))
$count = 0
while $count < $N

View File

@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
@ -69,13 +67,13 @@ endi
print =============== step5
sql select avg(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data11 != 1.000000000 then
if $data10 != 1.000000000 then
return -1
endi
sql select avg(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 9.500000000 then
if $data00 != 9.500000000 then
return -1
endi
@ -84,7 +82,7 @@ $cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select avg(tbcol) as b from $tb where ts <= $ms interval(1m)
print ===> $data01
if $data41 != 4.000000000 then
if $data40 != 4.000000000 then
return -1
endi
if $rows != 5 then
@ -123,14 +121,14 @@ endi
print =============== step9
sql select avg(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1.000000000 then
print ===> $data10
if $data10 != 1.000000000 then
return -1
endi
sql select avg(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 9.500000000 then
if $data00 != 9.500000000 then
return -1
endi
@ -148,9 +146,9 @@ endi
print =============== step11
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select avg(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol
print ===> $data11
if $data11 != 1.000000000 then
sql select avg(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m)
print ===> $data10
if $data10 != 1.000000000 then
return -1
endi
if $rows != 50 then

View File

@ -47,8 +47,6 @@ while $x < $rowNum
$x = $x + 1
endw
sleep 100
print =============== step2
$i = 0
$tb = $tbPrefix . $i

View File

@ -38,15 +38,13 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select bottom(tbcol, 1) from $tb
print ===> $data01
if $data01 != 0 then
print ===> $data00
if $data00 != 0 then
return -1
endi
@ -54,25 +52,25 @@ print =============== step3
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select bottom(tbcol, 1) from $tb where ts > $ms
print ===> $data01
if $data01 != 5 then
print ===> $data00
if $data00 != 5 then
return -1
endi
print =============== step4
sql select bottom(tbcol, 1) as b from $tb
print ===> $data01
if $data01 != 0 then
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step5
sql select bottom(tbcol, 2) as b from $tb
print ===> $data01 $data11
if $data01 != 0 then
print ===> $data00 $data10
if $data00 != 1 then
return -1
endi
if $data11 != 1 then
if $data10 != 0 then
return -1
endi
@ -80,11 +78,11 @@ print =============== step6
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select bottom(tbcol, 2) as b from $tb where ts > $ms
print ===> $data01 $data11
if $data01 != 5 then
print ===> $data00 $data10
if $data00 != 6 then
return -1
endi
if $data11 != 6 then
if $data10 != 5 then
return -1
endi

View File

@ -38,13 +38,10 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select count(*) from $tb
print ===> select count(*) from $tb => $data00
if $data00 != $rowNum then
@ -81,14 +78,14 @@ endi
print =============== step5
sql select count(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 1 then
print ===> $data00
if $data00 != 1 then
return -1
endi
sql select count(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != $rowNum then
print ===> $data00
if $data00 != $rowNum then
return -1
endi
@ -96,8 +93,8 @@ print =============== step6
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select count(tbcol) as b from $tb where ts <= $ms interval(1m)
print ===> $data01
if $data01 != 1 then
print ===> $data00
if $data00 != 1 then
return -1
endi
if $rows != 5 then
@ -149,17 +146,17 @@ endi
print =============== step9
sql select count(tbcol) as b from $mt interval(1m)
print ===> $data01
if $data01 != 10 then
print ===> $data00
if $data00 != 10 then
return -1
endi
if $data11 != 10 then
if $data10 != 10 then
return -1
endi
sql select count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
print ===> $data00
if $data00 != 200 then
return -1
endi
@ -177,9 +174,9 @@ endi
print =============== step11
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select count(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol
sql select count(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m)
print ===> $data01
if $data01 != 1 then
if $data00 != 1 then
return -1
endi
if $rows != 50 then

View File

@ -37,15 +37,13 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select diff(tbcol) from $tb
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
@ -53,23 +51,23 @@ print =============== step3
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select diff(tbcol) from $tb where ts > $ms
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select diff(tbcol) from $tb where ts <= $ms
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
print =============== step4
sql select diff(tbcol) as b from $tb
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi

View File

@ -1,5 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c debugflag -v 131
system sh/exec.sh -n dnode1 -s start
sql connect
@ -39,91 +40,90 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select diff(c1) from $tb
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select diff(c2) from $tb
print ===> $data11
if $data11 != 1.00000 then
print ===> $data10
if $data10 != 1.000000000 then
return -1
endi
sql select diff(c3) from $tb
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select diff(c4) from $tb
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select diff(c5) from $tb
print ===> $data11
if $data11 != 0 then
print ===> $data10
if $data10 != 0 then
return -1
endi
sql select diff(c6) from $tb
print ===> $data11
if $data11 != 1.000000000 then
print ===> $data10
if $data10 != 1.000000000 then
return -1
endi
sql_error select diff(c7) from $tb
sql select diff(c7) from $tb
sql_error select diff(c8) from $tb
sql_error select diff(c9) from $tb
sql_error select diff(ts) from $tb
sql_error select diff(c1), diff(c2) from $tb
#sql_error select 2+diff(c1) from $tb
sql_error select diff(c1+2) from $tb
sql select 2+diff(c1) from $tb
sql select diff(c1+2) from $tb
sql_error select diff(c1) from $tb where ts > 0 and ts < now + 100m interval(10m)
sql_error select diff(c1) from $mt
sql select diff(c1) from $mt
sql_error select diff(diff(c1)) from $tb
sql_error select diff(c1) from m_di_tb1 where c2 like '2%'
print =============== step3
sql select diff(c1) from $tb where c1 > 5
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select diff(c2) from $tb where c2 > 5
print ===> $data11
if $data11 != 1.00000 then
print ===> $data10
if $data10 != 1.000000000 then
return -1
endi
sql select diff(c3) from $tb where c3 > 5
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select diff(c4) from $tb where c4 > 5
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select diff(c5) from $tb where c5 > 5
print ===> $data11
if $data11 != 0 then
print ===> $data10
if $data10 != 0 then
return -1
endi
sql select diff(c6) from $tb where c6 > 5
print ===> $data11
if $data11 != 1.000000000 then
print ===> $data10
if $data10 != 1.000000000 then
return -1
endi
print =============== step4
sql select diff(c1) from $tb where c1 > 5 and c2 < $rowNum
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
@ -131,8 +131,8 @@ sql select diff(c1) from $tb where c9 like '%9' and c1 <= 20
if $rows != 1 then
return -1
endi
print ===> $data11
if $data01 != 10 then
print ===> $data10
if $data00 != 10 then
return -1
endi

View File

@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
@ -68,14 +66,14 @@ endi
print =============== step5
sql select first(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 0 then
print ===> $data00
if $data00 != 0 then
return -1
endi
sql select first(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 0 then
print ===> $data00
if $data00 != 0 then
return -1
endi
@ -83,8 +81,8 @@ print =============== step6
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select first(tbcol) as b from $tb where ts <= $ms interval(1m)
print ===> $data01
if $data41 != 4 then
print ===> $data00
if $data40 != 4 then
return -1
endi
if $rows != 5 then
@ -124,14 +122,14 @@ endi
print =============== step9
sql select first(tbcol) as b from $mt interval(1m)
print select first(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select first(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 0 then
print ===> $data00
if $data00 != 0 then
return -1
endi
@ -149,9 +147,9 @@ endi
print =============== step11
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select first(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
sql select first(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m)
print ===> $data10
if $data10 != 1 then
return -1
endi
print ===> $rows

View File

@ -47,10 +47,10 @@ print ===> $rows
if $rows < $rowNum then
return -1
endi
if $data01 != 1 then
if $data00 != 1 then
return -1
endi
if $data05 != 1 then
if $data04 != 1 then
return -1
endi
@ -65,10 +65,10 @@ endi
if $rows < 3 then
return -1
endi
if $data01 != 1 then
if $data00 != 1 then
return -1
endi
if $data05 != 1 then
if $data04 != 1 then
return -1
endi
@ -87,10 +87,10 @@ endi
if $rows > 22 then
return -1
endi
if $data01 != 1 then
if $data00 != 1 then
return -1
endi
if $data05 != 1 then
if $data04 != 1 then
return -1
endi
@ -109,10 +109,10 @@ endi
if $rows > 50 then
return -1
endi
if $data21 != 1 then
if $data20 != 1 then
return -1
endi
if $data25 != 1 then
if $data24 != 1 then
return -1
endi
@ -125,10 +125,10 @@ endi
if $rows > 22 then
return -1
endi
if $data11 > 15 then
if $data10 > 15 then
return -1
endi
if $data11 < 5 then
if $data10 < 5 then
return -1
endi
@ -143,10 +143,10 @@ endi
if $rows > 7 then
return -1
endi
if $data11 > 15 then
if $data10 > 15 then
return -1
endi
if $data11 < 5 then
if $data10 < 5 then
return -1
endi
@ -165,10 +165,10 @@ endi
if $rows > 22 then
return -1
endi
if $data11 > 15 then
if $data10 > 15 then
return -1
endi
if $data11 < 5 then
if $data10 < 5 then
return -1
endi
@ -186,10 +186,10 @@ endi
if $rows > 50 then
return -1
endi
if $data11 > 15 then
if $data10 > 15 then
return -1
endi
if $data11 < 5 then
if $data10 < 5 then
return -1
endi

View File

@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
@ -69,14 +67,14 @@ endi
print =============== step5
sql select last(tbcol) as b from $tb interval(1m)
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select last(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 19 then
print ===> $data00
if $data00 != 19 then
return -1
endi
@ -85,8 +83,8 @@ $cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select last(tbcol) as b from $tb where ts <= $ms interval(1m)
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
if $rows != 5 then
@ -127,14 +125,14 @@ endi
print =============== step9
sql select last(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select last(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 19 then
print ===> $data00
if $data00 != 19 then
return -1
endi
@ -153,9 +151,9 @@ print =============== step11
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select last(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
sql select last(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m)
print ===> $data10
if $data10 != 1 then
return -1
endi
print ===> $rows

View File

@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
@ -53,6 +51,7 @@ endi
print =============== step3
$cc = 4 * 60000
$ms = 1601481600000 + $cc
print select last_row(tbcol) from $tb where ts <= $ms
sql select last_row(tbcol) from $tb where ts <= $ms
print ===> $data00
if $data00 != 4 then
@ -98,8 +97,6 @@ if $data00 != 4 then
return -1
endi
print =============== step10
sql select last_row(tbcol) as b from $mt group by tgcol
print ===> $data00

View File

@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
@ -65,21 +63,21 @@ endi
print =============== step5
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m)
print ===> $data01
if $data01 != @{slop:1.000000, intercept:1.000000}@ then
print ===> $data00
if $data00 != @{slop:1.000000, intercept:1.000000}@ then
return -1
endi
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d)
print ===> $data01
if $data01 != @{slop:1.000000, intercept:1.000000}@ then
print ===> $data00
if $data00 != @{slop:1.000000, intercept:1.000000}@ then
return -1
endi
print =============== step6
sql select leastsquares(tbcol, 1, 1) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data01 != @{slop:1.000000, intercept:1.000000}@ then
print ===> $data00
if $data00 != @{slop:1.000000, intercept:1.000000}@ then
return -1
endi
print ===> $rows

View File

@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
@ -69,14 +67,14 @@ endi
print =============== step5
sql select max(tbcol) as b from $tb interval(1m)
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select max(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 19 then
print ===> $data00
if $data00 != 19 then
return -1
endi
@ -85,8 +83,8 @@ $cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select max(tbcol) as b from $tb where ts <= $ms interval(1m)
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
if $rows != 5 then
@ -127,14 +125,14 @@ endi
print =============== step9
sql select max(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
print ===> $data10
if $data10 != 1 then
return -1
endi
sql select max(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 19 then
print ===> $data00
if $data00 != 19 then
return -1
endi
@ -153,9 +151,9 @@ print =============== step11
$cc = 4 * 60000
$ms = 1601481600000 + $cc
sql select max(tbcol) as b from $mt where ts <= $ms interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
sql select max(tbcol) as b from $mt where ts <= $ms partition by tgcol interval(1m)
print ===> $data10
if $data10 != 1 then
return -1
endi
print ===> $rows

View File

@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i

View File

@ -100,9 +100,10 @@ if $rows != 1 then
return -1
endi
sql_error select * from $tb where tbcol = NULL
return
sql select * from $tb where tbcol = NULL
if $rows != 0 then
return -1
endi
print =============== step5
sql create table tt using $mt tags( NULL )

View File

@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i

View File

@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i

View File

@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i

View File

@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i

View File

@ -1,9 +1,9 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 50
sql connect
print =============== create database
sql create database `database`
sql create database `DataBase`
@ -184,23 +184,6 @@ print =============== stop and restart taosd
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
sql show databases
print rows: $rows
print $data00 $data01

View File

@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0

View File

@ -32,7 +32,6 @@ if $rows != 3 then
return -1
endi
print =============== insert data, mode1: one row one table in sql
print =============== insert data, mode1: mulit rows one table in sql
#print =============== insert data, mode1: one rows mulit table in sql
@ -41,9 +40,6 @@ sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
sql insert into ct2 values(now+0s, 10, 2.0, 3.0)
sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
#sql insert into ct1 values(now+4s, -14, -2.4, -3.4) ct2 values(now+4s, -14, -2.4, -3.4)
#sql insert into ct1 values(now+5s, -15, -2.5, -3.5)(now+6s, -16, -2.6, -3.6) ct2 values(now+5s, -15, -2.5, -3.5)(now+6s, -16, -2.6, -3.6)
sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0)
#===================================================================
@ -67,16 +63,6 @@ endi
if $data03 != 3.000000000 then
return -1
endi
#if $data41 != -14 then
# return -1
#endi
#if $data42 != -2.40000 then
# return -1
#endi
#if $data43 != -3.400000000 then
# return -1
#endi
print =============== select count(*) from child table
sql select count(*) from ct1
@ -107,10 +93,10 @@ if $data03 != 4 then
endi
#print =============== select first(*)/first(column) from child table
#sql select first(*) from ct1
#print ====> select first(*) from ct1
#print rows: $rows
#print $data00 $data01 $data02 $data03
sql select first(*) from ct1
print ====> select first(*) from ct1
print rows: $rows
print $data00 $data01 $data02 $data03
sql select first(ts), first(c1), first(c2), first(c3) from ct1
print ====> select first(ts), first(c1), first(c2), first(c3) from ct1
@ -217,23 +203,23 @@ if $data32 != -3.300000000 then
return -1
endi
#===================================================================
#===================================================================
#print =============== query data from stb
#sql select * from stb
#if $rows != 4 then
# return -1
#endi
sql select * from stb
print $rows
if $rows != 9 then
return -1
endi
#print =============== select count(*) from supter table
#sql select count(*) from stb
#print $data00 $data01 $data02
#if $rows != 1 then
# return -1
#endi
#if $data00 != 9 then
# return -1
#endi
sql select count(*) from stb
print $data00 $data01 $data02
if $rows != 1 then
return -1
endi
if $data00 != 9 then
return -1
endi
print =============== select count(column) from supter table
sql select ts, c1, c2, c3 from stb
@ -264,49 +250,27 @@ if $data03 != 3.000000000 then
endi
#print =============== select count(column) from supter table
#sql select count(ts), count(c1), count(c2), count(c3) from stb
#print rows: $rows
#print $data00 $data01 $data02 $data03
#print $data10 $data11 $data12 $data13
#print $data20 $data21 $data22 $data23
#print $data30 $data31 $data32 $data33
#if $data00 != 9 then
# return -1
#endi
#if $data01 != 8 then
# return -1
#endi
#if $data02 != 8 then
# return -1
#endi
#if $data03 != 8 then
# return -1
#endi
sql select count(ts), count(c1), count(c2), count(c3) from stb
print rows: $rows
print $data00 $data01 $data02 $data03
if $data00 != 9 then
return -1
endi
if $data01 != 9 then
return -1
endi
if $data02 != 9 then
return -1
endi
if $data03 != 9 then
return -1
endi
#===================================================================
#===================================================================
print =============== stop and restart taosd, then again do query above
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
print =============== query data from child table
sql select * from ct1
print rows: $rows
@ -326,16 +290,6 @@ endi
if $data03 != 3.000000000 then
return -1
endi
#if $data41 != -14 then
# return -1
#endi
#if $data42 != -2.40000 then
# return -1
#endi
#if $data43 != -3.400000000 then
# return -1
#endi
print =============== select count(*) from child table
sql select count(*) from ct1
@ -366,10 +320,10 @@ if $data03 != 4 then
endi
#print =============== select first(*)/first(column) from child table
#sql select first(*) from ct1
#print ====> select first(*) from ct1
#print rows: $rows
#print $data00 $data01 $data02 $data03
sql select first(*) from ct1
print ====> select first(*) from ct1
print rows: $rows
print $data00 $data01 $data02 $data03
sql select first(ts), first(c1), first(c2), first(c3) from ct1
print ====> select first(ts), first(c1), first(c2), first(c3) from ct1
@ -474,24 +428,23 @@ endi
if $data32 != -3.300000000 then
return -1
endi
#===================================================================
#===================================================================
#print =============== query data from stb
#sql select * from stb
#if $rows != 4 then
# return -1
#endi
#===================================================================
print =============== query data from stb
sql select * from stb
if $rows != 9 then
return -1
endi
#print =============== select count(*) from supter table
#sql select count(*) from stb
#print $data00 $data01 $data02
#if $rows != 1 then
# return -1
#endi
#if $data00 != 9 then
# return -1
#endi
print =============== select count(*) from supter table
sql select count(*) from stb
print $data00 $data01 $data02
if $rows != 1 then
return -1
endi
if $data00 != 9 then
return -1
endi
print =============== select count(column) from supter table
sql select ts, c1, c2, c3 from stb
@ -521,20 +474,19 @@ if $data03 != 3.000000000 then
endi
#print =============== select count(column) from supter table
#sql select count(ts), count(c1), count(c2), count(c3) from stb
#print $data00 $data01 $data02 $data03
#if $data00 != 8 then
# return -1
#endi
#if $data01 != 8 then
# return -1
#endi
#if $data02 != 8 then
# return -1
#endi
#if $data03 != 8 then
# return -1
#endi
sql select count(ts), count(c1), count(c2), count(c3) from stb
print $data00 $data01 $data02 $data03
if $data00 != 9 then
return -1
endi
if $data01 != 9 then
return -1
endi
if $data02 != 9 then
return -1
endi
if $data03 != 9 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -1,7 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 50
sql connect
print =============== create database
@ -17,7 +16,6 @@ sql use d1
print =============== create super table, include all type
sql create table if not exists stb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(16), c9 nchar(16), c10 timestamp, c11 tinyint unsigned, c12 smallint unsigned, c13 int unsigned, c14 bigint unsigned) tags (t1 bool, t2 tinyint, t3 smallint, t4 int, t5 bigint, t6 float, t7 double, t8 binary(16), t9 nchar(16), t10 timestamp, t11 tinyint unsigned, t12 smallint unsigned, t13 int unsigned, t14 bigint unsigned)
sql create stable if not exists stb_1 (ts timestamp, i int) tags (j int)
sql create table stb_2 (ts timestamp, i int) tags (j int)
sql create stable stb_3 (ts timestamp, i int) tags (j int)
@ -36,11 +34,6 @@ if $rows != 2 then
return -1
endi
print =============== insert data, mode1: one row one table in sql
print =============== insert data, mode1: mulit rows one table in sql
print =============== insert data, mode1: one rows mulit table in sql
print =============== insert data, mode1: mulit rows mulit table in sql
sql insert into c1 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql insert into c1 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
@ -69,32 +62,15 @@ if $data03 != -2 then
endi
print =============== query data from st, but not support select * from super table, waiting fix
#sql select * from st
#if $rows != 4 then
# return -1
#endi
sql select * from stb
if $rows != 4 then
return -1
endi
print =============== stop and restart taosd
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
print =============== query data
sql select * from c1
print rows: $rows
@ -119,9 +95,9 @@ if $data03 != -2 then
endi
print =============== query data from st, but not support select * from super table, waiting fix
#sql select * from st
#if $rows != 4 then
# return -1
#endi
sql select * from stb
if $rows != 4 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -1,7 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 50
sql connect
print =============== create database
@ -64,23 +63,6 @@ reboot_and_check:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
print =============== insert duplicated records to memory - loop $reboot_max - $reboot_cnt
sql use db
sql insert into ct1 values ('2022-05-01 18:30:27.001', 0.0);

View File

@ -1,10 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$tbNum = 10
@ -19,7 +15,7 @@ $stb = stb
sql drop database $db -x step1
step1:
sql create database $db ctime 30
sql create database $db
print ====== create tables
sql use $db
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
@ -43,13 +39,9 @@ print ====== tables created
print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
sql reset query cache
sleep 1000
sql use $db
sql drop table tb5
$i = 0
@ -69,13 +61,9 @@ endw
print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
sql reset query cache
sleep 1000
sql use $db
sql create table tb5 using $stb tags(5)

View File

@ -1,7 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 50
sql connect
print =============== create database
@ -211,66 +210,48 @@ endi
#===================================================================
#print =============== query data from stb
#sql select * from stb
#print ===>
#print ===> rows: $rows
#print ===> rows0: $data00 $data01 $data02 $data03 $data04
#if $rows != 4 then
# return -1
#endi
sql select * from stb
print ===>
print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 12 then
return -1
endi
#print =============== select count(*) from supter table
#sql select count(*) from stb
#print $data00 $data01 $data02
#if $rows != 1 then
# return -1
#endi
#if $data00 != 12 then
# return -1
#endi
sql select count(*) from stb
print $data00 $data01 $data02
if $rows != 1 then
return -1
endi
if $data00 != 12 then
return -1
endi
#print =============== select count(column) from supter table
#sql select count(ts), count(c1), count(c2), count(c3) from stb
#print $data00 $data01 $data02 $data03
#if $data00 != 12 then
# return -1
#endi
#if $data01 != 8 then
# return -1
#endi
#if $data02 != 8 then
# return -1
#endi
#if $data03 != 8 then
# return -1
#endi
sql select count(ts), count(c1), count(c2), count(c3) from stb
print $data00 $data01 $data02 $data03
if $data00 != 12 then
return -1
endi
if $data01 != 8 then
return -1
endi
if $data02 != 8 then
return -1
endi
if $data03 != 8 then
return -1
endi
#===================================================================
#===================================================================
print =============== stop and restart taosd, then again do query above
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
print ===> waiting dnode ready
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
#===================================================================
#===================================================================
#===================================================================
print =============== query data from child table
sql select * from ct1
print ===> select * from ct1
@ -292,15 +273,15 @@ endi
if $data03 != 3.000000000 then
return -1
endi
#if $data41 != -14 then
# return -1
#endi
#if $data42 != -2.40000 then
# return -1
#endi
#if $data43 != -3.400000000 then
# return -1
#endi
if $data41 != 12 then
return -1
endi
if $data42 != 2.20000 then
return -1
endi
if $data43 != NULL then
return -1
endi
print =============== select count(*) from child table
sql select count(*) from ct1
@ -435,40 +416,39 @@ if $data92 != 3.600000000 then
return -1
endi
#===================================================================
#===================================================================
#print =============== query data from stb
#sql select * from stb
#print ===>
#print ===> rows: $rows
#print ===> rows0: $data00 $data01 $data02 $data03 $data04
#if $rows != 4 then
# return -1
#endi
#print =============== select count(*) from supter table
#sql select count(*) from stb
#print $data00 $data01 $data02
#if $rows != 1 then
# return -1
#endi
#if $data00 != 12 then
# return -1
#endi
print =============== query data from stb
sql select * from stb
print ===>
print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 12 then
return -1
endi
print =============== select count(*) from supter table
sql select count(*) from stb
print $data00 $data01 $data02
if $rows != 1 then
return -1
endi
if $data00 != 12 then
return -1
endi
#print =============== select count(column) from supter table
#sql select count(ts), count(c1), count(c2), count(c3) from stb
#print $data00 $data01 $data02 $data03
#if $data00 != 12 then
# return -1
#endi
#if $data01 != 8 then
# return -1
#endi
#if $data02 != 8 then
# return -1
#endi
#if $data03 != 8 then
# return -1
#endi
print =============== select count(column) from supter table
sql select count(ts), count(c1), count(c2), count(c3) from stb
print $data00 $data01 $data02 $data03
if $data00 != 12 then
return -1
endi
if $data01 != 8 then
return -1
endi
if $data02 != 8 then
return -1
endi
if $data03 != 8 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -190,7 +185,7 @@ clear:
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -175,7 +170,7 @@ clear:
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -19,15 +14,7 @@ sql drop database -x step1
step1:
sql create database $db
sql use $db
$x = 0
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $tb (ts timestamp, speed int) -x create1
sql create table $tb (ts timestamp, speed int)
#commit to file will trigger if insert 82 rows
$N = 82
@ -204,7 +191,7 @@ clear:
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -167,7 +162,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -20,14 +15,7 @@ step1:
sql create database $db
sql use $db
$x = 0
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $tb (ts timestamp, speed int) -x create1
sql create table $tb (ts timestamp, speed int)
#commit to file will trigger if insert 82 rows
@ -202,7 +190,7 @@ clear:
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -20,14 +15,7 @@ step1:
sql create database $db
sql use $db
$x = 0
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $tb (ts timestamp, speed int) -x create1
sql create table $tb (ts timestamp, speed int)
$N = 20000
@ -49,7 +37,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,10 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c debugflag -v 131
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql create database d1;

View File

@ -17,10 +17,10 @@ sql use test
sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create stream streams1 trigger at_once into streamt as select _wstartts, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstartts, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
sql create stream stream_t1 trigger at_once into streamtST as select _wstartts, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
sql create stream stream_t2 trigger at_once watermark 1d into streamtST2 as select _wstartts, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
sql create stream stream_t1 trigger at_once into streamtST as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
sql create stream stream_t2 trigger at_once watermark 1d into streamtST2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
sql insert into t1 values(1648791210000,1,2,3,1.0);
sql insert into t1 values(1648791216000,2,2,3,1.1);

View File

@ -1,13 +1,12 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print =============== create database
sql create database db
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi

View File

@ -213,23 +213,6 @@ endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
print =============== query data
sql select * from c1
print rows: $rows

View File

@ -1,7 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print =============== one table
@ -21,11 +20,11 @@ endi
print =============== show
sql show databases
if $data02 != 2 then
if $data22 != 2 then
return -1
endi
if $data03 != 1 then
if $data24 != 1 then
return -1
endi
@ -34,7 +33,7 @@ if $data00 != 2 then
return -1
endi
if $data01 != 2 then
if $data01 != d1 then
return -1
endi

View File

@ -1,13 +1,12 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print =============== create database
sql create database db
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -66,7 +63,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -56,7 +53,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -85,7 +82,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print =============== step1
@ -19,7 +16,7 @@ endi
sql drop database db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -79,7 +76,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -78,7 +75,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -68,7 +65,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,13 +1,12 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
print =============== create database
sql create database db
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -27,18 +24,18 @@ if $data00 != @17-01-01 08:00:00.001@ then
endi
print =============== step2
sql insert into $tb values ('2017-08-28 00:23:46.429+ 1a', 2)
#sql insert into $tb values ('2017-08-28 00:23:46cd .429', 2)
sql_error insert into $tb values ('2017-08-28 00:23:46.429+ 1a', 2)
sql_error insert into $tb values ('2017-08-28 00:23:46cd .429', 2)
sql select ts from $tb
if $rows != 2 then
if $rows != 1 then
return -1
endi
print =============== step3
#sql insert into $tb values ('1970-01-01 08:00:00.000', 3)
#sql insert into $tb values ('1970-01-01 08:00:00.000', 3)
sql_error insert into $tb values ('1970-01-01 08:00:00.000', 3)
sql_error insert into $tb values ('1970-01-01 08:00:00.000', 3)
sql select ts from $tb
if $rows != 2 then
if $rows != 1 then
return -1
endi
@ -57,7 +54,7 @@ print =============== step5
sql_error insert into $tb values ('9999-12-31 213:59:59.999', 13)
sql select ts from $tb
print $rows
if $rows != 8 then
if $rows != 7 then
return -1
endi
@ -65,7 +62,7 @@ print =============== step6
sql_error insert into $tb values ('9999-12-99 23:59:59.999', 13)
sql select ts from $tb
if $rows != 8 then
if $rows != 7 then
return -1
endi
@ -83,7 +80,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -40,7 +37,7 @@ sql drop table $table
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -42,7 +39,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -91,7 +88,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -91,7 +88,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -27,12 +24,10 @@ if $data01 != NULL then
endi
print =============== step2
sql insert into $tb values (now+1m, -2147483648) -x step2
return -1
step2:
sql insert into $tb values (now+1m, NULL)
sql insert into $tb values (now+1m, -2147483648)
sql insert into $tb values (now+2m, NULL)
sql select * from $tb order by ts desc
if $rows != 2 then
if $rows != 3 then
return -1
endi
if $data01 != NULL then
@ -40,9 +35,9 @@ if $data01 != NULL then
endi
print =============== step3
sql insert into $tb values (now+2m, 2147483647)
sql insert into $tb values (now+3m, 2147483647)
sql select * from $tb order by ts desc
if $rows != 3 then
if $rows != 4 then
return -1
endi
if $data01 != 2147483647 then
@ -50,12 +45,10 @@ if $data01 != 2147483647 then
endi
print =============== step4
sql insert into $tb values (now+3m, 2147483648) -x step4
return -1
step4:
sql insert into $tb values (now+3m, NULL)
sql_error insert into $tb values (now+4m, 2147483648)
sql insert into $tb values (now+5m, NULL)
sql select * from $tb order by ts desc
if $rows != 4 then
if $rows != 5 then
return -1
endi
if $data01 != NULL then
@ -63,10 +56,10 @@ if $data01 != NULL then
endi
print =============== step5
sql_error insert into $tb values (now+4m, a2)
sql insert into $tb values (now+4m, 0)
sql_error insert into $tb values (now+6m, a2)
sql insert into $tb values (now+7m, 0)
sql select * from $tb order by ts desc
if $rows != 5 then
if $rows != 6 then
return -1
endi
if $data01 != 0 then
@ -74,19 +67,8 @@ if $data01 != 0 then
endi
print =============== step6
sql_error insert into $tb values (now+5m, 2a)
sql insert into $tb values (now+5m, 2)
sql select * from $tb order by ts desc
if $rows != 6 then
return -1
endi
if $data01 != 2 then
return -1
endi
print =============== step7
sql_error insert into $tb values (now+6m, 2a'1)
sql insert into $tb values (now+6m, 2)
sql_error insert into $tb values (now+8m, 2a)
sql insert into $tb values (now+9m, 2)
sql select * from $tb order by ts desc
if $rows != 7 then
return -1
@ -95,18 +77,19 @@ if $data01 != 2 then
return -1
endi
print =============== step8
sql insert into $tb values (now+8m, "NULL")
print =============== step7
sql_error insert into $tb values (now+10m, 2a'1)
sql insert into $tb values (now+11m, 2)
sql select * from $tb order by ts desc
if $rows != 8 then
return -1
endi
if $data01 != NULL then
if $data01 != 2 then
return -1
endi
print =============== step9
sql insert into $tb values (now+9m, 'NULL')
print =============== step8
sql insert into $tb values (now+12m, "NULL")
sql select * from $tb order by ts desc
if $rows != 9 then
return -1
@ -115,19 +98,29 @@ if $data01 != NULL then
return -1
endi
print =============== step10
sql insert into $tb values (now+10m, -123)
print =============== step9
sql insert into $tb values (now+13m, 'NULL')
sql select * from $tb order by ts desc
if $rows != 10 then
return -1
endi
if $data01 != NULL then
return -1
endi
print =============== step10
sql insert into $tb values (now+14m, -123)
sql select * from $tb order by ts desc
if $rows != 11 then
return -1
endi
if $data01 != -123 then
return -1
endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,11 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 129
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 8
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ============================ dnode1 start
@ -17,10 +12,10 @@ $db = $dbPrefix . $i
$tb = $tbPrefix . $i
print =================== step 0
sql create database $db
sql create database $db vgroups 8
sql use $db
sql show vgroups
if $rows != 0 then
if $rows != 8 then
return -1
endi
@ -87,7 +82,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -28,12 +25,10 @@ if $data01 != NULL then
endi
print =============== step2
sql insert into $tb values (now+1m, -32768) -x step2
return -1
step2:
sql insert into $tb values (now+1m, NULL)
sql insert into $tb values (now+1m, -32768)
sql insert into $tb values (now+2m, NULL)
sql select * from $tb order by ts desc
if $rows != 2 then
if $rows != 3 then
return -1
endi
if $data01 != NULL then
@ -41,9 +36,9 @@ if $data01 != NULL then
endi
print =============== step3
sql insert into $tb values (now+2m, 32767)
sql insert into $tb values (now+3m, 32767)
sql select * from $tb order by ts desc
if $rows != 3 then
if $rows != 4 then
return -1
endi
if $data01 != 32767 then
@ -51,12 +46,12 @@ if $data01 != 32767 then
endi
print =============== step4
sql insert into $tb values (now+3m, 32768) -x step4
sql insert into $tb values (now+4m, 32768) -x step4
return -1
step4:
sql insert into $tb values (now+3m, NULL)
sql insert into $tb values (now+5m, NULL)
sql select * from $tb order by ts desc
if $rows != 4 then
if $rows != 5 then
return -1
endi
if $data01 != NULL then
@ -64,10 +59,10 @@ if $data01 != NULL then
endi
print =============== step5
sql_error insert into $tb values (now+4m, a2)
sql insert into $tb values (now+4m, 0)
sql_error insert into $tb values (now+6m, a2)
sql insert into $tb values (now+7m, 0)
sql select * from $tb order by ts desc
if $rows != 5 then
if $rows != 6 then
return -1
endi
if $data01 != 0 then
@ -75,19 +70,8 @@ if $data01 != 0 then
endi
print =============== step6
sql_error insert into $tb values (now+5m, 2a)
sql insert into $tb values (now+5m, 2)
sql select * from $tb order by ts desc
if $rows != 6 then
return -1
endi
if $data01 != 2 then
return -1
endi
print =============== step7
sql_error insert into $tb values (now+6m, 2a'1)
sql insert into $tb values (now+6m, 2)
sql_error insert into $tb values (now+8m, 2a)
sql insert into $tb values (now+9m, 2)
sql select * from $tb order by ts desc
if $rows != 7 then
return -1
@ -96,9 +80,20 @@ if $data01 != 2 then
return -1
endi
print =============== step7
sql_error insert into $tb values (now+10m, 2a'1)
sql insert into $tb values (now+11m, 2)
sql select * from $tb order by ts desc
if $rows != 8 then
return -1
endi
if $data01 != 2 then
return -1
endi
return
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ============================ dnode1 start
@ -200,16 +197,15 @@ if $data01 != 7 then
endi
print =============== step10
$i = 1
$tb = $tbPrefix . $i
sql create table $tb (ts timestamp, val tinyint, val2 tinyint)
sql_error create table $tb (ts timestamp, val tinyint, val2 tinyint)
sql show tables
if $rows != 7 then
return -1
endi
print =============== step11
sql create table $tb (ts timestamp, val float, val2 double)
sql_error create table $tb (ts timestamp, val float, val2 double)
sql show tables
if $rows != 7 then
return -1
@ -217,7 +213,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -98,7 +95,7 @@ step8:
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
$i = 0
@ -27,12 +24,10 @@ if $data01 != NULL then
endi
print =============== step2
sql insert into $tb values (now+1m, -128) -x step2
return -1
step2:
sql insert into $tb values (now+1m, NULL)
sql insert into $tb values (now+1m, -128)
sql insert into $tb values (now+2m, NULL)
sql select * from $tb order by ts desc
if $rows != 2 then
if $rows != 3 then
return -1
endi
if $data01 != NULL then
@ -40,9 +35,9 @@ if $data01 != NULL then
endi
print =============== step3
sql insert into $tb values (now+2m, 127)
sql insert into $tb values (now+3m, 127)
sql select * from $tb order by ts desc
if $rows != 3 then
if $rows != 4 then
return -1
endi
if $data01 != 127 then
@ -50,12 +45,12 @@ if $data01 != 127 then
endi
print =============== step4
sql insert into $tb values (now+3m, 128) -x step4
sql insert into $tb values (now+4m, 128) -x step4
return -1
step4:
sql insert into $tb values (now+3m, NULL)
sql insert into $tb values (now+5m, NULL)
sql select * from $tb
if $rows != 4 then
if $rows != 5 then
return -1
endi
if $data01 != NULL then
@ -63,10 +58,10 @@ if $data01 != NULL then
endi
print =============== step5
sql_error insert into $tb values (now+4m, a2)
sql insert into $tb values (now+4m, 0)
sql_error insert into $tb values (now+6m, a2)
sql insert into $tb values (now+7m, 0)
sql select * from $tb order by ts desc
if $rows != 5 then
if $rows != 6 then
return -1
endi
if $data01 != 0 then
@ -74,19 +69,8 @@ if $data01 != 0 then
endi
print =============== step6
sql_error insert into $tb values (now+5m, 2a)
sql insert into $tb values (now+5m, 2)
sql select * from $tb order by ts desc
if $rows != 6 then
return -1
endi
if $data01 != 2 then
return -1
endi
print =============== step7
sql_error insert into $tb values (now+6m, 2a'1)
sql insert into $tb values (now+6m, 2)
sql_error insert into $tb values (now+8m, 2a)
sql insert into $tb values (now+9m, 2)
sql select * from $tb order by ts desc
if $rows != 7 then
return -1
@ -95,9 +79,20 @@ if $data01 != 2 then
return -1
endi
print =============== step7
sql_error insert into $tb values (now+10m, 2a'1)
sql insert into $tb values (now+11m, 2)
sql select * from $tb order by ts desc
if $rows != 8 then
return -1
endi
if $data01 != 2 then
return -1
endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,12 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ============================ dnode1 start
$i = 0
@ -16,10 +12,10 @@ $db = $dbPrefix . $i
$tb = $tbPrefix . $i
print =================== step 1
sql create database $db
sql create database $db vgroups 4
sql use $db
sql show vgroups
if $rows != 0 then
if $rows != 4 then
return -1
endi
@ -28,7 +24,7 @@ sql create table table2 (ts timestamp, speed int)
sql create table table3 (ts timestamp, speed int)
sql create table table4 (ts timestamp, speed int)
sql show vgroups
if $rows != 1 then
if $rows != 4 then
return -1
endi
@ -37,7 +33,7 @@ sql create table table6 (ts timestamp, speed int)
sql create table table7 (ts timestamp, speed int)
sql create table table8 (ts timestamp, speed int)
sql show vgroups
if $rows != 2 then
if $rows != 4 then
return -1
endi
@ -46,7 +42,7 @@ sql create table table10 (ts timestamp, speed int)
sql create table table11 (ts timestamp, speed int)
sql create table table12 (ts timestamp, speed int)
sql show vgroups
if $rows != 3 then
if $rows != 4 then
return -1
endi
@ -58,7 +54,7 @@ endi
sql drop table table13
sql show vgroups
if $rows != 3 then
if $rows != 4 then
return -1
endi
@ -72,10 +68,10 @@ print =================== step 2
$i = 1
$db = $dbPrefix . $i
sql create database $db
sql create database $db vgroups 2
sql use $db
sql show vgroups
if $rows != 0 then
if $rows != 2 then
return -1
endi
@ -88,13 +84,13 @@ $db = $dbPrefix . $i
sql use $db
sql create table table2 (ts timestamp, speed int)
sql show vgroups
if $rows != 1 then
if $rows != 2 then
return -1
endi
sql drop table table2
sql show vgroups
if $rows != 0 then
if $rows != 2 then
return -1
endi
@ -104,7 +100,7 @@ sql create table table3 (ts timestamp, speed int)
sql create table table4 (ts timestamp, speed int)
sql drop table table1
sql show vgroups
if $rows != 1 then
if $rows != 2 then
return -1
endi
@ -133,7 +129,7 @@ sql create database $db
sql use $db
sql show databases
if $rows != 5 then
if $rows != 7 then
return -1
endi
@ -144,7 +140,7 @@ while $i < 5
$i = $i + 1
endw
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,9 +1,6 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
print ======================== dnode1 start
@ -494,28 +491,28 @@ if $data00 != 25 then
endi
print =============== step19
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,13 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql reset query cache
print ======================== dnode1 start
@ -681,34 +675,34 @@ if $data00 != 25 then
endi
print =============== step24
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 interval(1d) group by tgcol4
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

View File

@ -1,13 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql reset query cache
print ======================== dnode1 start
@ -798,40 +792,40 @@ endi
print =============== step27
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol1
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol2
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 interval(1d) group by tgcol3
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 interval(1d) group by tgcol4
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 interval(1d) group by tgcol5
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 partition by tgcol5 interval(1d)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
if $data00 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi

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