merge with develop branch
This commit is contained in:
commit
7a04516abb
|
@ -175,7 +175,7 @@ SSqlExpr* tscSqlExprAppend(SQueryInfo* pQueryInfo, int16_t functionId, SColumnIn
|
||||||
|
|
||||||
SSqlExpr* tscSqlExprUpdate(SQueryInfo* pQueryInfo, int32_t index, int16_t functionId, int16_t srcColumnIndex, int16_t type,
|
SSqlExpr* tscSqlExprUpdate(SQueryInfo* pQueryInfo, int32_t index, int16_t functionId, int16_t srcColumnIndex, int16_t type,
|
||||||
int16_t size);
|
int16_t size);
|
||||||
int32_t tscSqlExprNumOfExprs(SQueryInfo* pQueryInfo);
|
size_t tscSqlExprNumOfExprs(SQueryInfo* pQueryInfo);
|
||||||
|
|
||||||
SSqlExpr* tscSqlExprGet(SQueryInfo* pQueryInfo, int32_t index);
|
SSqlExpr* tscSqlExprGet(SQueryInfo* pQueryInfo, int32_t index);
|
||||||
void tscSqlExprCopy(SArray* dst, const SArray* src, uint64_t uid, bool deepcopy);
|
void tscSqlExprCopy(SArray* dst, const SArray* src, uint64_t uid, bool deepcopy);
|
||||||
|
|
|
@ -84,7 +84,7 @@ typedef struct SSqlExpr {
|
||||||
int16_t functionId; // function id in aAgg array
|
int16_t functionId; // function id in aAgg array
|
||||||
int16_t resType; // return value type
|
int16_t resType; // return value type
|
||||||
int16_t resBytes; // length of return value
|
int16_t resBytes; // length of return value
|
||||||
int16_t interBytes; // inter result buffer size
|
int32_t interBytes; // inter result buffer size
|
||||||
int16_t numOfParams; // argument value of each function
|
int16_t numOfParams; // argument value of each function
|
||||||
tVariant param[3]; // parameters are not more than 3
|
tVariant param[3]; // parameters are not more than 3
|
||||||
int32_t offset; // sub result column value of arithmetic expression.
|
int32_t offset; // sub result column value of arithmetic expression.
|
||||||
|
@ -320,7 +320,7 @@ typedef struct SSqlObj {
|
||||||
tsem_t rspSem;
|
tsem_t rspSem;
|
||||||
SSqlCmd cmd;
|
SSqlCmd cmd;
|
||||||
SSqlRes res;
|
SSqlRes res;
|
||||||
uint8_t numOfSubs;
|
uint16_t numOfSubs;
|
||||||
struct SSqlObj **pSubs;
|
struct SSqlObj **pSubs;
|
||||||
struct SSqlObj * prev, *next;
|
struct SSqlObj * prev, *next;
|
||||||
} SSqlObj;
|
} SSqlObj;
|
||||||
|
|
|
@ -57,6 +57,7 @@ void doAsyncQuery(STscObj* pObj, SSqlObj* pSql, void (*fp)(), void* param, const
|
||||||
}
|
}
|
||||||
|
|
||||||
pSql->sqlstr = realloc(pSql->sqlstr, sqlLen + 1);
|
pSql->sqlstr = realloc(pSql->sqlstr, sqlLen + 1);
|
||||||
|
|
||||||
if (pSql->sqlstr == NULL) {
|
if (pSql->sqlstr == NULL) {
|
||||||
tscError("%p failed to malloc sql string buffer", pSql);
|
tscError("%p failed to malloc sql string buffer", pSql);
|
||||||
tscQueueAsyncError(fp, param, TSDB_CODE_CLI_OUT_OF_MEMORY);
|
tscQueueAsyncError(fp, param, TSDB_CODE_CLI_OUT_OF_MEMORY);
|
||||||
|
@ -165,7 +166,7 @@ static void tscProcessAsyncRetrieveImpl(void *param, TAOS_RES *tres, int numOfRo
|
||||||
SSqlRes *pRes = &pSql->res;
|
SSqlRes *pRes = &pSql->res;
|
||||||
|
|
||||||
if ((pRes->qhandle == 0 || numOfRows != 0) && pCmd->command < TSDB_SQL_LOCAL) {
|
if ((pRes->qhandle == 0 || numOfRows != 0) && pCmd->command < TSDB_SQL_LOCAL) {
|
||||||
if (pRes->qhandle == 0) {
|
if (pRes->qhandle == 0 && numOfRows != 0) {
|
||||||
tscError("qhandle is NULL");
|
tscError("qhandle is NULL");
|
||||||
} else {
|
} else {
|
||||||
pRes->code = numOfRows;
|
pRes->code = numOfRows;
|
||||||
|
|
|
@ -153,7 +153,7 @@ typedef struct SRateInfo {
|
||||||
|
|
||||||
|
|
||||||
int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionId, int32_t param, int16_t *type,
|
int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionId, int32_t param, int16_t *type,
|
||||||
int16_t *bytes, int16_t *interBytes, int16_t extLength, bool isSuperTable) {
|
int16_t *bytes, int32_t *interBytes, int16_t extLength, bool isSuperTable) {
|
||||||
if (!isValidDataType(dataType, dataBytes)) {
|
if (!isValidDataType(dataType, dataBytes)) {
|
||||||
tscError("Illegal data type %d or data type length %d", dataType, dataBytes);
|
tscError("Illegal data type %d or data type length %d", dataType, dataBytes);
|
||||||
return TSDB_CODE_INVALID_SQL;
|
return TSDB_CODE_INVALID_SQL;
|
||||||
|
@ -478,7 +478,7 @@ int32_t count_load_data_info(SQLFunctionCtx *pCtx, TSKEY start, TSKEY end, int32
|
||||||
if (colId == PRIMARYKEY_TIMESTAMP_COL_INDEX) {
|
if (colId == PRIMARYKEY_TIMESTAMP_COL_INDEX) {
|
||||||
return BLK_DATA_NO_NEEDED;
|
return BLK_DATA_NO_NEEDED;
|
||||||
} else {
|
} else {
|
||||||
return BLK_DATA_FILEDS_NEEDED;
|
return BLK_DATA_STATIS_NEEDED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -690,7 +690,7 @@ static void sum_func_second_merge(SQLFunctionCtx *pCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t precal_req_load_info(SQLFunctionCtx *pCtx, TSKEY start, TSKEY end, int32_t colId) {
|
static int32_t precal_req_load_info(SQLFunctionCtx *pCtx, TSKEY start, TSKEY end, int32_t colId) {
|
||||||
return BLK_DATA_FILEDS_NEEDED;
|
return BLK_DATA_STATIS_NEEDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t data_req_load_info(SQLFunctionCtx *pCtx, TSKEY start, TSKEY end, int32_t colId) {
|
static int32_t data_req_load_info(SQLFunctionCtx *pCtx, TSKEY start, TSKEY end, int32_t colId) {
|
||||||
|
@ -1848,13 +1848,14 @@ static void last_row_function(SQLFunctionCtx *pCtx) {
|
||||||
pResInfo->hasResult = DATA_SET_FLAG;
|
pResInfo->hasResult = DATA_SET_FLAG;
|
||||||
|
|
||||||
SLastrowInfo *pInfo = (SLastrowInfo *)pResInfo->interResultBuf;
|
SLastrowInfo *pInfo = (SLastrowInfo *)pResInfo->interResultBuf;
|
||||||
pInfo->ts = pCtx->param[0].i64Key;
|
pInfo->ts = pCtx->ptsList[0];
|
||||||
|
|
||||||
pInfo->hasResult = DATA_SET_FLAG;
|
pInfo->hasResult = DATA_SET_FLAG;
|
||||||
|
|
||||||
// set the result to final result buffer
|
// set the result to final result buffer
|
||||||
if (pResInfo->superTableQ) {
|
if (pResInfo->superTableQ) {
|
||||||
SLastrowInfo *pInfo1 = (SLastrowInfo *)(pCtx->aOutputBuf + pCtx->inputBytes);
|
SLastrowInfo *pInfo1 = (SLastrowInfo *)(pCtx->aOutputBuf + pCtx->inputBytes);
|
||||||
pInfo1->ts = pCtx->param[0].i64Key;
|
pInfo1->ts = pCtx->ptsList[0];
|
||||||
pInfo1->hasResult = DATA_SET_FLAG;
|
pInfo1->hasResult = DATA_SET_FLAG;
|
||||||
|
|
||||||
DO_UPDATE_TAG_COLUMNS(pCtx, pInfo1->ts);
|
DO_UPDATE_TAG_COLUMNS(pCtx, pInfo1->ts);
|
||||||
|
@ -1904,12 +1905,12 @@ static void valuePairAssign(tValuePair *dst, int16_t type, const char *val, int6
|
||||||
memcpy(dst->pTags, pTags, (size_t)pTagInfo->tagsLen);
|
memcpy(dst->pTags, pTags, (size_t)pTagInfo->tagsLen);
|
||||||
} else { // the tags are dumped from the ctx tag fields
|
} else { // the tags are dumped from the ctx tag fields
|
||||||
for (int32_t i = 0; i < pTagInfo->numOfTagCols; ++i) {
|
for (int32_t i = 0; i < pTagInfo->numOfTagCols; ++i) {
|
||||||
SQLFunctionCtx* __ctx = pTagInfo->pTagCtxList[i];
|
SQLFunctionCtx* ctx = pTagInfo->pTagCtxList[i];
|
||||||
if (__ctx->functionId == TSDB_FUNC_TS_DUMMY) {
|
if (ctx->functionId == TSDB_FUNC_TS_DUMMY) {
|
||||||
__ctx->tag = (tVariant) {.nType = TSDB_DATA_TYPE_BIGINT, .i64Key = tsKey};
|
ctx->tag = (tVariant) {.nType = TSDB_DATA_TYPE_BIGINT, .i64Key = tsKey};
|
||||||
}
|
}
|
||||||
|
|
||||||
tVariantDump(&pTagInfo->pTagCtxList[i]->tag, dst->pTags + size, pTagInfo->pTagCtxList[i]->tag.nType);
|
tVariantDump(&ctx->tag, dst->pTags + size, ctx->tag.nType, true);
|
||||||
size += pTagInfo->pTagCtxList[i]->outputBytes;
|
size += pTagInfo->pTagCtxList[i]->outputBytes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2226,7 +2227,6 @@ static STopBotInfo *getTopBotOutputInfo(SQLFunctionCtx *pCtx) {
|
||||||
static void buildTopBotStruct(STopBotInfo *pTopBotInfo, SQLFunctionCtx *pCtx) {
|
static void buildTopBotStruct(STopBotInfo *pTopBotInfo, SQLFunctionCtx *pCtx) {
|
||||||
char *tmp = (char *)pTopBotInfo + sizeof(STopBotInfo);
|
char *tmp = (char *)pTopBotInfo + sizeof(STopBotInfo);
|
||||||
pTopBotInfo->res = (tValuePair**) tmp;
|
pTopBotInfo->res = (tValuePair**) tmp;
|
||||||
|
|
||||||
tmp += POINTER_BYTES * pCtx->param[0].i64Key;
|
tmp += POINTER_BYTES * pCtx->param[0].i64Key;
|
||||||
|
|
||||||
size_t size = sizeof(tValuePair) + pCtx->tagInfo.tagsLen;
|
size_t size = sizeof(tValuePair) + pCtx->tagInfo.tagsLen;
|
||||||
|
@ -2981,14 +2981,7 @@ static void tag_project_function(SQLFunctionCtx *pCtx) {
|
||||||
assert(pCtx->inputBytes == pCtx->outputBytes);
|
assert(pCtx->inputBytes == pCtx->outputBytes);
|
||||||
|
|
||||||
for (int32_t i = 0; i < pCtx->size; ++i) {
|
for (int32_t i = 0; i < pCtx->size; ++i) {
|
||||||
char* output = pCtx->aOutputBuf;
|
tVariantDump(&pCtx->tag, pCtx->aOutputBuf, pCtx->outputType, true);
|
||||||
|
|
||||||
if (pCtx->tag.nType == TSDB_DATA_TYPE_BINARY || pCtx->tag.nType == TSDB_DATA_TYPE_NCHAR) {
|
|
||||||
varDataSetLen(output, pCtx->tag.nLen);
|
|
||||||
tVariantDump(&pCtx->tag, varDataVal(output), pCtx->outputType);
|
|
||||||
} else {
|
|
||||||
tVariantDump(&pCtx->tag, output, pCtx->outputType);
|
|
||||||
}
|
|
||||||
|
|
||||||
pCtx->aOutputBuf += pCtx->outputBytes;
|
pCtx->aOutputBuf += pCtx->outputBytes;
|
||||||
}
|
}
|
||||||
|
@ -2997,13 +2990,7 @@ static void tag_project_function(SQLFunctionCtx *pCtx) {
|
||||||
static void tag_project_function_f(SQLFunctionCtx *pCtx, int32_t index) {
|
static void tag_project_function_f(SQLFunctionCtx *pCtx, int32_t index) {
|
||||||
INC_INIT_VAL(pCtx, 1);
|
INC_INIT_VAL(pCtx, 1);
|
||||||
|
|
||||||
char* output = pCtx->aOutputBuf;
|
tVariantDump(&pCtx->tag, pCtx->aOutputBuf, pCtx->tag.nType, true);
|
||||||
if (pCtx->tag.nType == TSDB_DATA_TYPE_BINARY || pCtx->tag.nType == TSDB_DATA_TYPE_NCHAR) {
|
|
||||||
*(int16_t*) output = pCtx->tag.nLen;
|
|
||||||
output += VARSTR_HEADER_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
tVariantDump(&pCtx->tag, output, pCtx->tag.nType);
|
|
||||||
pCtx->aOutputBuf += pCtx->outputBytes;
|
pCtx->aOutputBuf += pCtx->outputBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3016,30 +3003,12 @@ static void tag_project_function_f(SQLFunctionCtx *pCtx, int32_t index) {
|
||||||
*/
|
*/
|
||||||
static void tag_function(SQLFunctionCtx *pCtx) {
|
static void tag_function(SQLFunctionCtx *pCtx) {
|
||||||
SET_VAL(pCtx, 1, 1);
|
SET_VAL(pCtx, 1, 1);
|
||||||
|
tVariantDump(&pCtx->tag, pCtx->aOutputBuf, pCtx->tag.nType, true);
|
||||||
char* output = pCtx->aOutputBuf;
|
|
||||||
|
|
||||||
// todo refactor to dump length presented string(var string)
|
|
||||||
if (pCtx->tag.nType == TSDB_DATA_TYPE_BINARY || pCtx->tag.nType == TSDB_DATA_TYPE_NCHAR) {
|
|
||||||
*(int16_t*) output = pCtx->tag.nLen;
|
|
||||||
output += VARSTR_HEADER_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
tVariantDump(&pCtx->tag, output, pCtx->tag.nType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tag_function_f(SQLFunctionCtx *pCtx, int32_t index) {
|
static void tag_function_f(SQLFunctionCtx *pCtx, int32_t index) {
|
||||||
SET_VAL(pCtx, 1, 1);
|
SET_VAL(pCtx, 1, 1);
|
||||||
|
tVariantDump(&pCtx->tag, pCtx->aOutputBuf, pCtx->tag.nType, true);
|
||||||
char* output = pCtx->aOutputBuf;
|
|
||||||
|
|
||||||
// todo refactor to dump length presented string(var string)
|
|
||||||
if (pCtx->tag.nType == TSDB_DATA_TYPE_BINARY || pCtx->tag.nType == TSDB_DATA_TYPE_NCHAR) {
|
|
||||||
*(int16_t*) output = pCtx->tag.nLen;
|
|
||||||
output += VARSTR_HEADER_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
tVariantDump(&pCtx->tag, output, pCtx->tag.nType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void copy_function(SQLFunctionCtx *pCtx) {
|
static void copy_function(SQLFunctionCtx *pCtx) {
|
||||||
|
@ -3853,15 +3822,15 @@ void twa_function_finalizer(SQLFunctionCtx *pCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* param[1]: default value/previous value of specified timestamp
|
|
||||||
* param[2]: next value of specified timestamp
|
|
||||||
* param[3]: denotes if the result is a precious result or interpolation results
|
|
||||||
*
|
*
|
||||||
* @param pCtx
|
* @param pCtx
|
||||||
*/
|
*/
|
||||||
static void interp_function(SQLFunctionCtx *pCtx) {
|
static void interp_function(SQLFunctionCtx *pCtx) {
|
||||||
// at this point, the value is existed, return directly
|
// at this point, the value is existed, return directly
|
||||||
if (pCtx->param[3].i64Key == 1) {
|
SResultInfo *pResInfo = GET_RES_INFO(pCtx);
|
||||||
|
SInterpInfoDetail* pInfo = pResInfo->interResultBuf;
|
||||||
|
|
||||||
|
if (pCtx->size == 1) {
|
||||||
char *pData = GET_INPUT_CHAR(pCtx);
|
char *pData = GET_INPUT_CHAR(pCtx);
|
||||||
assignVal(pCtx->aOutputBuf, pData, pCtx->inputBytes, pCtx->inputType);
|
assignVal(pCtx->aOutputBuf, pData, pCtx->inputBytes, pCtx->inputType);
|
||||||
} else {
|
} else {
|
||||||
|
@ -3869,76 +3838,65 @@ static void interp_function(SQLFunctionCtx *pCtx) {
|
||||||
* use interpolation to generate the result.
|
* use interpolation to generate the result.
|
||||||
* Note: the result of primary timestamp column uses the timestamp specified by user in the query sql
|
* Note: the result of primary timestamp column uses the timestamp specified by user in the query sql
|
||||||
*/
|
*/
|
||||||
assert(pCtx->param[3].i64Key == 2);
|
assert(pCtx->size == 2);
|
||||||
|
if (pInfo->type == TSDB_FILL_NONE) { // set no output result
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SInterpInfo interpInfo = *(SInterpInfo *)pCtx->aOutputBuf;
|
if (pInfo->primaryCol == 1) {
|
||||||
SInterpInfoDetail *pInfoDetail = interpInfo.pInterpDetail;
|
*(TSKEY *) pCtx->aOutputBuf = pInfo->ts;
|
||||||
|
|
||||||
/* set no output result */
|
|
||||||
if (pInfoDetail->type == TSDB_FILL_NONE) {
|
|
||||||
pCtx->param[3].i64Key = 0;
|
|
||||||
} else if (pInfoDetail->primaryCol == 1) {
|
|
||||||
*(TSKEY *)pCtx->aOutputBuf = pInfoDetail->ts;
|
|
||||||
} else {
|
} else {
|
||||||
if (pInfoDetail->type == TSDB_FILL_NULL) {
|
if (pInfo->type == TSDB_FILL_NULL) {
|
||||||
if (pCtx->outputType == TSDB_DATA_TYPE_BINARY || pCtx->outputType == TSDB_DATA_TYPE_NCHAR) {
|
if (pCtx->outputType == TSDB_DATA_TYPE_BINARY || pCtx->outputType == TSDB_DATA_TYPE_NCHAR) {
|
||||||
setVardataNull(pCtx->aOutputBuf, pCtx->outputType);
|
setVardataNull(pCtx->aOutputBuf, pCtx->outputType);
|
||||||
} else {
|
} else {
|
||||||
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
|
setNull(pCtx->aOutputBuf, pCtx->outputType, pCtx->outputBytes);
|
||||||
}
|
}
|
||||||
} else if (pInfoDetail->type == TSDB_FILL_SET_VALUE) {
|
|
||||||
tVariantDump(&pCtx->param[1], pCtx->aOutputBuf, pCtx->inputType);
|
SET_VAL(pCtx, pCtx->size, 1);
|
||||||
} else if (pInfoDetail->type == TSDB_FILL_PREV) {
|
} else if (pInfo->type == TSDB_FILL_SET_VALUE) {
|
||||||
char *data = pCtx->param[1].pz;
|
tVariantDump(&pCtx->param[1], pCtx->aOutputBuf, pCtx->inputType, true);
|
||||||
char *pVal = data + TSDB_KEYSIZE;
|
} else if (pInfo->type == TSDB_FILL_PREV) {
|
||||||
|
char *data = GET_INPUT_CHAR_INDEX(pCtx, 0);
|
||||||
if (pCtx->outputType == TSDB_DATA_TYPE_FLOAT) {
|
assignVal(pCtx->aOutputBuf, data, pCtx->outputBytes, pCtx->outputType);
|
||||||
float v = GET_DOUBLE_VAL(pVal);
|
|
||||||
assignVal(pCtx->aOutputBuf, (const char*) &v, pCtx->outputBytes, pCtx->outputType);
|
SET_VAL(pCtx, pCtx->size, 1);
|
||||||
} else {
|
} else if (pInfo->type == TSDB_FILL_LINEAR) {
|
||||||
assignVal(pCtx->aOutputBuf, pVal, pCtx->outputBytes, pCtx->outputType);
|
char *data1 = GET_INPUT_CHAR_INDEX(pCtx, 0);
|
||||||
}
|
char *data2 = GET_INPUT_CHAR_INDEX(pCtx, 1);
|
||||||
|
|
||||||
} else if (pInfoDetail->type == TSDB_FILL_LINEAR) {
|
TSKEY key1 = pCtx->ptsList[0];
|
||||||
char *data1 = pCtx->param[1].pz;
|
TSKEY key2 = pCtx->ptsList[1];
|
||||||
char *data2 = pCtx->param[2].pz;
|
|
||||||
|
SPoint point1 = {.key = key1, .val = data1};
|
||||||
char *pVal1 = data1 + TSDB_KEYSIZE;
|
SPoint point2 = {.key = key2, .val = data2};
|
||||||
char *pVal2 = data2 + TSDB_KEYSIZE;
|
|
||||||
|
SPoint point = {.key = pInfo->ts, .val = pCtx->aOutputBuf};
|
||||||
SPoint point1 = {.key = *(TSKEY *)data1, .val = &pCtx->param[1].i64Key};
|
|
||||||
SPoint point2 = {.key = *(TSKEY *)data2, .val = &pCtx->param[2].i64Key};
|
|
||||||
|
|
||||||
SPoint point = {.key = pInfoDetail->ts, .val = pCtx->aOutputBuf};
|
|
||||||
|
|
||||||
int32_t srcType = pCtx->inputType;
|
int32_t srcType = pCtx->inputType;
|
||||||
if ((srcType >= TSDB_DATA_TYPE_TINYINT && srcType <= TSDB_DATA_TYPE_BIGINT) ||
|
if ((srcType >= TSDB_DATA_TYPE_TINYINT && srcType <= TSDB_DATA_TYPE_BIGINT) ||
|
||||||
srcType == TSDB_DATA_TYPE_TIMESTAMP || srcType == TSDB_DATA_TYPE_DOUBLE) {
|
srcType == TSDB_DATA_TYPE_TIMESTAMP || srcType == TSDB_DATA_TYPE_DOUBLE) {
|
||||||
point1.val = pVal1;
|
point1.val = data1;
|
||||||
|
point2.val = data2;
|
||||||
point2.val = pVal2;
|
|
||||||
|
if (isNull(data1, srcType) || isNull(data2, srcType)) {
|
||||||
if (isNull(pVal1, srcType) || isNull(pVal2, srcType)) {
|
|
||||||
setNull(pCtx->aOutputBuf, srcType, pCtx->inputBytes);
|
setNull(pCtx->aOutputBuf, srcType, pCtx->inputBytes);
|
||||||
} else {
|
} else {
|
||||||
taosDoLinearInterpolation(pCtx->outputType, &point1, &point2, &point);
|
taosDoLinearInterpolation(pCtx->outputType, &point1, &point2, &point);
|
||||||
}
|
}
|
||||||
} else if (srcType == TSDB_DATA_TYPE_FLOAT) {
|
} else if (srcType == TSDB_DATA_TYPE_FLOAT) {
|
||||||
float v1 = GET_DOUBLE_VAL(pVal1);
|
point1.val = data1;
|
||||||
float v2 = GET_DOUBLE_VAL(pVal2);
|
point2.val = data2;
|
||||||
|
|
||||||
point1.val = &v1;
|
if (isNull(data1, srcType) || isNull(data2, srcType)) {
|
||||||
point2.val = &v2;
|
|
||||||
|
|
||||||
if (isNull(pVal1, srcType) || isNull(pVal2, srcType)) {
|
|
||||||
setNull(pCtx->aOutputBuf, srcType, pCtx->inputBytes);
|
setNull(pCtx->aOutputBuf, srcType, pCtx->inputBytes);
|
||||||
} else {
|
} else {
|
||||||
taosDoLinearInterpolation(pCtx->outputType, &point1, &point2, &point);
|
taosDoLinearInterpolation(pCtx->outputType, &point1, &point2, &point);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (srcType == TSDB_DATA_TYPE_BINARY || srcType == TSDB_DATA_TYPE_NCHAR) {
|
if (srcType == TSDB_DATA_TYPE_BINARY || srcType == TSDB_DATA_TYPE_NCHAR) {
|
||||||
setVardataNull(pCtx->aOutputBuf, pCtx->inputBytes);
|
setVardataNull(pCtx->aOutputBuf, pCtx->inputType);
|
||||||
} else {
|
} else {
|
||||||
setNull(pCtx->aOutputBuf, srcType, pCtx->inputBytes);
|
setNull(pCtx->aOutputBuf, srcType, pCtx->inputBytes);
|
||||||
}
|
}
|
||||||
|
@ -3946,15 +3904,8 @@ static void interp_function(SQLFunctionCtx *pCtx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(interpInfo.pInterpDetail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pCtx->size = pCtx->param[3].i64Key;
|
|
||||||
|
|
||||||
tVariantDestroy(&pCtx->param[1]);
|
|
||||||
tVariantDestroy(&pCtx->param[2]);
|
|
||||||
|
|
||||||
// data in the check operation are all null, not output
|
|
||||||
SET_VAL(pCtx, pCtx->size, 1);
|
SET_VAL(pCtx, pCtx->size, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4910,7 +4861,7 @@ SQLAggFuncElem aAggs[] = {{
|
||||||
"interp",
|
"interp",
|
||||||
TSDB_FUNC_INTERP,
|
TSDB_FUNC_INTERP,
|
||||||
TSDB_FUNC_INTERP,
|
TSDB_FUNC_INTERP,
|
||||||
TSDB_FUNCSTATE_SO | TSDB_FUNCSTATE_OF | TSDB_FUNCSTATE_STABLE | TSDB_FUNCSTATE_NEED_TS,
|
TSDB_FUNCSTATE_SO | TSDB_FUNCSTATE_OF | TSDB_FUNCSTATE_STABLE | TSDB_FUNCSTATE_NEED_TS ,
|
||||||
function_setup,
|
function_setup,
|
||||||
interp_function,
|
interp_function,
|
||||||
do_sum_f, // todo filter handle
|
do_sum_f, // todo filter handle
|
||||||
|
@ -4918,7 +4869,7 @@ SQLAggFuncElem aAggs[] = {{
|
||||||
doFinalizer,
|
doFinalizer,
|
||||||
noop1,
|
noop1,
|
||||||
copy_function,
|
copy_function,
|
||||||
no_data_info,
|
data_req_load_info,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// 28
|
// 28
|
||||||
|
|
|
@ -142,7 +142,7 @@ static int setColumnFilterInfoForTimestamp(SQueryInfo* pQueryInfo, tVariant* pVa
|
||||||
return invalidSqlErrMsg(pQueryInfo->msg, msg);
|
return invalidSqlErrMsg(pQueryInfo->msg, msg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (tVariantDump(pVar, (char*)&time, TSDB_DATA_TYPE_BIGINT)) {
|
if (tVariantDump(pVar, (char*)&time, TSDB_DATA_TYPE_BIGINT, true)) {
|
||||||
return invalidSqlErrMsg(pQueryInfo->msg, msg);
|
return invalidSqlErrMsg(pQueryInfo->msg, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1403,7 +1403,6 @@ int32_t addProjectionExprAndResultField(SQueryInfo* pQueryInfo, tSQLExprItem* pI
|
||||||
SSchema colSchema = {.type = TSDB_DATA_TYPE_BINARY, .bytes = TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE};
|
SSchema colSchema = {.type = TSDB_DATA_TYPE_BINARY, .bytes = TSDB_TABLE_NAME_LEN + VARSTR_HEADER_SIZE};
|
||||||
strcpy(colSchema.name, TSQL_TBNAME_L);
|
strcpy(colSchema.name, TSQL_TBNAME_L);
|
||||||
|
|
||||||
pQueryInfo->type = TSDB_QUERY_TYPE_STABLE_QUERY;
|
|
||||||
tscAddSpecialColumnForSelect(pQueryInfo, startPos, TSDB_FUNC_TAGPRJ, &index, &colSchema, true);
|
tscAddSpecialColumnForSelect(pQueryInfo, startPos, TSDB_FUNC_TAGPRJ, &index, &colSchema, true);
|
||||||
} else {
|
} else {
|
||||||
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, index.tableIndex);
|
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, index.tableIndex);
|
||||||
|
@ -1595,7 +1594,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
|
||||||
|
|
||||||
int16_t resultType = 0;
|
int16_t resultType = 0;
|
||||||
int16_t resultSize = 0;
|
int16_t resultSize = 0;
|
||||||
int16_t intermediateResSize = 0;
|
int32_t intermediateResSize = 0;
|
||||||
|
|
||||||
int16_t functionID = 0;
|
int16_t functionID = 0;
|
||||||
if (changeFunctionID(optr, &functionID) != TSDB_CODE_SUCCESS) {
|
if (changeFunctionID(optr, &functionID) != TSDB_CODE_SUCCESS) {
|
||||||
|
@ -1628,14 +1627,14 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
|
||||||
if (optr == TK_LEASTSQUARES) {
|
if (optr == TK_LEASTSQUARES) {
|
||||||
/* set the leastsquares parameters */
|
/* set the leastsquares parameters */
|
||||||
char val[8] = {0};
|
char val[8] = {0};
|
||||||
if (tVariantDump(&pParamElem[1].pNode->val, val, TSDB_DATA_TYPE_DOUBLE) < 0) {
|
if (tVariantDump(&pParamElem[1].pNode->val, val, TSDB_DATA_TYPE_DOUBLE, true) < 0) {
|
||||||
return TSDB_CODE_INVALID_SQL;
|
return TSDB_CODE_INVALID_SQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
addExprParams(pExpr, val, TSDB_DATA_TYPE_DOUBLE, DOUBLE_BYTES, 0);
|
addExprParams(pExpr, val, TSDB_DATA_TYPE_DOUBLE, DOUBLE_BYTES, 0);
|
||||||
|
|
||||||
memset(val, 0, tListLen(val));
|
memset(val, 0, tListLen(val));
|
||||||
if (tVariantDump(&pParamElem[2].pNode->val, val, TSDB_DATA_TYPE_DOUBLE) < 0) {
|
if (tVariantDump(&pParamElem[2].pNode->val, val, TSDB_DATA_TYPE_DOUBLE, true) < 0) {
|
||||||
return TSDB_CODE_INVALID_SQL;
|
return TSDB_CODE_INVALID_SQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1795,7 +1794,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
|
||||||
SSqlExpr* pExpr = NULL;
|
SSqlExpr* pExpr = NULL;
|
||||||
|
|
||||||
if (optr == TK_PERCENTILE || optr == TK_APERCENTILE) {
|
if (optr == TK_PERCENTILE || optr == TK_APERCENTILE) {
|
||||||
tVariantDump(pVariant, val, TSDB_DATA_TYPE_DOUBLE);
|
tVariantDump(pVariant, val, TSDB_DATA_TYPE_DOUBLE, true);
|
||||||
|
|
||||||
double dp = GET_DOUBLE_VAL(val);
|
double dp = GET_DOUBLE_VAL(val);
|
||||||
if (dp < 0 || dp > TOP_BOTTOM_QUERY_LIMIT) {
|
if (dp < 0 || dp > TOP_BOTTOM_QUERY_LIMIT) {
|
||||||
|
@ -1818,7 +1817,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
|
||||||
pExpr = tscSqlExprAppend(pQueryInfo, functionId, &index, resultType, resultSize, resultSize, false);
|
pExpr = tscSqlExprAppend(pQueryInfo, functionId, &index, resultType, resultSize, resultSize, false);
|
||||||
addExprParams(pExpr, val, TSDB_DATA_TYPE_DOUBLE, sizeof(double), 0);
|
addExprParams(pExpr, val, TSDB_DATA_TYPE_DOUBLE, sizeof(double), 0);
|
||||||
} else {
|
} else {
|
||||||
tVariantDump(pVariant, val, TSDB_DATA_TYPE_BIGINT);
|
tVariantDump(pVariant, val, TSDB_DATA_TYPE_BIGINT, true);
|
||||||
|
|
||||||
int64_t nTop = *((int32_t*)val);
|
int64_t nTop = *((int32_t*)val);
|
||||||
if (nTop <= 0 || nTop > 100) { // todo use macro
|
if (nTop <= 0 || nTop > 100) { // todo use macro
|
||||||
|
@ -1902,7 +1901,7 @@ int32_t addExprAndResultField(SQueryInfo* pQueryInfo, int32_t colIndex, tSQLExpr
|
||||||
|
|
||||||
int16_t bytes = 0;
|
int16_t bytes = 0;
|
||||||
int16_t type = 0;
|
int16_t type = 0;
|
||||||
int16_t inter = 0;
|
int32_t inter = 0;
|
||||||
|
|
||||||
int32_t ret = getResultDataInfo(s.type, s.bytes, TSDB_FUNC_TID_TAG, 0, &type, &bytes, &inter, 0, 0);
|
int32_t ret = getResultDataInfo(s.type, s.bytes, TSDB_FUNC_TID_TAG, 0, &type, &bytes, &inter, 0, 0);
|
||||||
assert(ret == TSDB_CODE_SUCCESS);
|
assert(ret == TSDB_CODE_SUCCESS);
|
||||||
|
@ -2288,7 +2287,7 @@ int32_t tscTansformSQLFuncForSTableQuery(SQueryInfo* pQueryInfo) {
|
||||||
|
|
||||||
int16_t bytes = 0;
|
int16_t bytes = 0;
|
||||||
int16_t type = 0;
|
int16_t type = 0;
|
||||||
int16_t intermediateBytes = 0;
|
int32_t interBytes = 0;
|
||||||
|
|
||||||
size_t size = tscSqlExprNumOfExprs(pQueryInfo);
|
size_t size = tscSqlExprNumOfExprs(pQueryInfo);
|
||||||
for (int32_t k = 0; k < size; ++k) {
|
for (int32_t k = 0; k < size; ++k) {
|
||||||
|
@ -2302,13 +2301,13 @@ int32_t tscTansformSQLFuncForSTableQuery(SQueryInfo* pQueryInfo) {
|
||||||
(functionId >= TSDB_FUNC_FIRST_DST && functionId <= TSDB_FUNC_LAST_DST) ||
|
(functionId >= TSDB_FUNC_FIRST_DST && functionId <= TSDB_FUNC_LAST_DST) ||
|
||||||
(functionId >= TSDB_FUNC_RATE && functionId <= TSDB_FUNC_AVG_IRATE)) {
|
(functionId >= TSDB_FUNC_RATE && functionId <= TSDB_FUNC_AVG_IRATE)) {
|
||||||
if (getResultDataInfo(pSrcSchema->type, pSrcSchema->bytes, functionId, pExpr->param[0].i64Key, &type, &bytes,
|
if (getResultDataInfo(pSrcSchema->type, pSrcSchema->bytes, functionId, pExpr->param[0].i64Key, &type, &bytes,
|
||||||
&intermediateBytes, 0, true) != TSDB_CODE_SUCCESS) {
|
&interBytes, 0, true) != TSDB_CODE_SUCCESS) {
|
||||||
return TSDB_CODE_INVALID_SQL;
|
return TSDB_CODE_INVALID_SQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
tscSqlExprUpdate(pQueryInfo, k, functionId, pExpr->colInfo.colIndex, TSDB_DATA_TYPE_BINARY, bytes);
|
tscSqlExprUpdate(pQueryInfo, k, functionId, pExpr->colInfo.colIndex, TSDB_DATA_TYPE_BINARY, bytes);
|
||||||
// todo refactor
|
// todo refactor
|
||||||
pExpr->interBytes = intermediateBytes;
|
pExpr->interBytes = interBytes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2328,27 +2327,23 @@ void tscRestoreSQLFuncForSTableQuery(SQueryInfo* pQueryInfo) {
|
||||||
SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, i);
|
SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, i);
|
||||||
SSchema* pSchema = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, pExpr->colInfo.colIndex);
|
SSchema* pSchema = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, pExpr->colInfo.colIndex);
|
||||||
|
|
||||||
// if (/*(pExpr->functionId >= TSDB_FUNC_FIRST_DST && pExpr->functionId <= TSDB_FUNC_LAST_DST) ||
|
// the final result size and type in the same as query on single table.
|
||||||
// (pExpr->functionId >= TSDB_FUNC_SUM && pExpr->functionId <= TSDB_FUNC_MAX) ||
|
// so here, set the flag to be false;
|
||||||
// pExpr->functionId == TSDB_FUNC_LAST_ROW*/) {
|
int32_t inter = 0;
|
||||||
// the final result size and type in the same as query on single table.
|
|
||||||
// so here, set the flag to be false;
|
int32_t functionId = pExpr->functionId;
|
||||||
int16_t inter = 0;
|
if (functionId >= TSDB_FUNC_TS && functionId <= TSDB_FUNC_DIFF) {
|
||||||
|
continue;
|
||||||
int32_t functionId = pExpr->functionId;
|
}
|
||||||
if (functionId >= TSDB_FUNC_TS && functionId <= TSDB_FUNC_DIFF) {
|
|
||||||
continue;
|
if (functionId == TSDB_FUNC_FIRST_DST) {
|
||||||
}
|
functionId = TSDB_FUNC_FIRST;
|
||||||
|
} else if (functionId == TSDB_FUNC_LAST_DST) {
|
||||||
if (functionId == TSDB_FUNC_FIRST_DST) {
|
functionId = TSDB_FUNC_LAST;
|
||||||
functionId = TSDB_FUNC_FIRST;
|
}
|
||||||
} else if (functionId == TSDB_FUNC_LAST_DST) {
|
|
||||||
functionId = TSDB_FUNC_LAST;
|
getResultDataInfo(pSchema->type, pSchema->bytes, functionId, 0, &pExpr->resType, &pExpr->resBytes,
|
||||||
}
|
&inter, 0, false);
|
||||||
|
|
||||||
getResultDataInfo(pSchema->type, pSchema->bytes, functionId, 0, &pExpr->resType, &pExpr->resBytes,
|
|
||||||
&inter, 0, false);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2631,23 +2626,23 @@ static int32_t doExtractColumnFilterInfo(SQueryInfo* pQueryInfo, SColumnFilterIn
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pExpr->nSQLOptr == TK_LE || pExpr->nSQLOptr == TK_LT) {
|
if (pExpr->nSQLOptr == TK_LE || pExpr->nSQLOptr == TK_LT) {
|
||||||
tVariantDump(&pRight->val, (char*)&pColumnFilter->upperBndd, colType);
|
tVariantDump(&pRight->val, (char*)&pColumnFilter->upperBndd, colType, false);
|
||||||
} else { // TK_GT,TK_GE,TK_EQ,TK_NE are based on the pColumn->lowerBndd
|
} else { // TK_GT,TK_GE,TK_EQ,TK_NE are based on the pColumn->lowerBndd
|
||||||
if (colType == TSDB_DATA_TYPE_BINARY) {
|
if (colType == TSDB_DATA_TYPE_BINARY) {
|
||||||
pColumnFilter->pz = (int64_t)calloc(1, pRight->val.nLen + 1);
|
pColumnFilter->pz = (int64_t)calloc(1, pRight->val.nLen + 1);
|
||||||
pColumnFilter->len = pRight->val.nLen;
|
pColumnFilter->len = pRight->val.nLen;
|
||||||
|
|
||||||
tVariantDump(&pRight->val, (char*)pColumnFilter->pz, colType);
|
tVariantDump(&pRight->val, (char*)pColumnFilter->pz, colType, false);
|
||||||
} else if (colType == TSDB_DATA_TYPE_NCHAR) {
|
} else if (colType == TSDB_DATA_TYPE_NCHAR) {
|
||||||
// pRight->val.nLen + 1 is larger than the actual nchar string length
|
// pRight->val.nLen + 1 is larger than the actual nchar string length
|
||||||
pColumnFilter->pz = (int64_t)calloc(1, (pRight->val.nLen + 1) * TSDB_NCHAR_SIZE);
|
pColumnFilter->pz = (int64_t)calloc(1, (pRight->val.nLen + 1) * TSDB_NCHAR_SIZE);
|
||||||
|
|
||||||
tVariantDump(&pRight->val, (char*)pColumnFilter->pz, colType);
|
tVariantDump(&pRight->val, (char*)pColumnFilter->pz, colType, false);
|
||||||
|
|
||||||
size_t len = wcslen((wchar_t*)pColumnFilter->pz);
|
size_t len = wcslen((wchar_t*)pColumnFilter->pz);
|
||||||
pColumnFilter->len = len * TSDB_NCHAR_SIZE;
|
pColumnFilter->len = len * TSDB_NCHAR_SIZE;
|
||||||
} else {
|
} else {
|
||||||
tVariantDump(&pRight->val, (char*)&pColumnFilter->lowerBndd, colType);
|
tVariantDump(&pRight->val, (char*)&pColumnFilter->lowerBndd, colType, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3336,9 +3331,8 @@ static int32_t handleExprInQueryCond(SQueryInfo* pQueryInfo, tSQLExpr** pExpr, S
|
||||||
|
|
||||||
*pExpr = NULL; // remove this expression
|
*pExpr = NULL; // remove this expression
|
||||||
*type = TSQL_EXPR_TS;
|
*type = TSQL_EXPR_TS;
|
||||||
} else if (index.columnIndex >= tscGetNumOfColumns(pTableMeta) ||
|
} else if (index.columnIndex >= tscGetNumOfColumns(pTableMeta) || index.columnIndex == TSDB_TBNAME_COLUMN_INDEX) {
|
||||||
index.columnIndex == TSDB_TBNAME_COLUMN_INDEX) { // query on tags
|
// query on tags, check for tag query condition
|
||||||
// check for tag query condition
|
|
||||||
if (UTIL_TABLE_IS_NORMAL_TABLE(pTableMetaInfo)) {
|
if (UTIL_TABLE_IS_NORMAL_TABLE(pTableMetaInfo)) {
|
||||||
return invalidSqlErrMsg(pQueryInfo->msg, msg1);
|
return invalidSqlErrMsg(pQueryInfo->msg, msg1);
|
||||||
}
|
}
|
||||||
|
@ -3933,7 +3927,7 @@ int32_t getTimeRange(STimeWindow* win, tSQLExpr* pRight, int32_t optr, int16_t t
|
||||||
* failed to parse timestamp in regular formation, try next
|
* failed to parse timestamp in regular formation, try next
|
||||||
* it may be a epoch time in string format
|
* it may be a epoch time in string format
|
||||||
*/
|
*/
|
||||||
tVariantDump(&pRight->val, (char*)&val, TSDB_DATA_TYPE_BIGINT);
|
tVariantDump(&pRight->val, (char*)&val, TSDB_DATA_TYPE_BIGINT, true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* transfer it into MICROSECOND format if it is a string, since for
|
* transfer it into MICROSECOND format if it is a string, since for
|
||||||
|
@ -4070,14 +4064,13 @@ int32_t parseFillClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySQL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ret = tVariantDump(&pFillToken->a[j].pVar, (char*)&pQueryInfo->fillVal[i], pFields->type);
|
int32_t ret = tVariantDump(&pFillToken->a[j].pVar, (char*)&pQueryInfo->fillVal[i], pFields->type, true);
|
||||||
if (ret != TSDB_CODE_SUCCESS) {
|
if (ret != TSDB_CODE_SUCCESS) {
|
||||||
return invalidSqlErrMsg(pQueryInfo->msg, msg);
|
return invalidSqlErrMsg(pQueryInfo->msg, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pFillToken->nExpr < size) ||
|
if ((pFillToken->nExpr < size) || ((pFillToken->nExpr - 1 < size) && (tscIsPointInterpQuery(pQueryInfo)))) {
|
||||||
((pFillToken->nExpr - 1 < size) && (tscIsPointInterpQuery(pQueryInfo)))) {
|
|
||||||
tVariantListItem* lastItem = &pFillToken->a[pFillToken->nExpr - 1];
|
tVariantListItem* lastItem = &pFillToken->a[pFillToken->nExpr - 1];
|
||||||
|
|
||||||
for (int32_t i = numOfFillVal; i < size; ++i) {
|
for (int32_t i = numOfFillVal; i < size; ++i) {
|
||||||
|
@ -4086,7 +4079,7 @@ int32_t parseFillClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySQL) {
|
||||||
if (pFields->type == TSDB_DATA_TYPE_BINARY || pFields->type == TSDB_DATA_TYPE_NCHAR) {
|
if (pFields->type == TSDB_DATA_TYPE_BINARY || pFields->type == TSDB_DATA_TYPE_NCHAR) {
|
||||||
setVardataNull((char*) &pQueryInfo->fillVal[i], pFields->type);
|
setVardataNull((char*) &pQueryInfo->fillVal[i], pFields->type);
|
||||||
} else {
|
} else {
|
||||||
tVariantDump(&lastItem->pVar, (char*)&pQueryInfo->fillVal[i], pFields->type);
|
tVariantDump(&lastItem->pVar, (char*)&pQueryInfo->fillVal[i], pFields->type, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4168,6 +4161,10 @@ int32_t parseOrderbyClause(SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql, SSchema
|
||||||
if (index.columnIndex >= tscGetNumOfColumns(pTableMetaInfo->pTableMeta)) {
|
if (index.columnIndex >= tscGetNumOfColumns(pTableMetaInfo->pTableMeta)) {
|
||||||
int32_t relTagIndex = index.columnIndex - tscGetNumOfColumns(pTableMetaInfo->pTableMeta);
|
int32_t relTagIndex = index.columnIndex - tscGetNumOfColumns(pTableMetaInfo->pTableMeta);
|
||||||
|
|
||||||
|
// it is a tag column
|
||||||
|
if (pQueryInfo->groupbyExpr.columnInfo == NULL) {
|
||||||
|
return invalidSqlErrMsg(pQueryInfo->msg, msg2);
|
||||||
|
}
|
||||||
SColIndex* pColIndex = taosArrayGet(pQueryInfo->groupbyExpr.columnInfo, 0);
|
SColIndex* pColIndex = taosArrayGet(pQueryInfo->groupbyExpr.columnInfo, 0);
|
||||||
if (relTagIndex == pColIndex->colIndex) {
|
if (relTagIndex == pColIndex->colIndex) {
|
||||||
orderByTags = true;
|
orderByTags = true;
|
||||||
|
@ -4420,10 +4417,10 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SSchema* pTagsSchema = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, columnIndex.columnIndex);
|
SSchema* pTagsSchema = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, columnIndex.columnIndex);
|
||||||
if (tVariantDump(&pVarList->a[1].pVar, pAlterSQL->tagData.data /*pCmd->payload*/, pTagsSchema->type) !=
|
if (tVariantDump(&pVarList->a[1].pVar, pAlterSQL->tagData.data, pTagsSchema->type, true) != TSDB_CODE_SUCCESS) {
|
||||||
TSDB_CODE_SUCCESS) {
|
|
||||||
return invalidSqlErrMsg(pQueryInfo->msg, msg13);
|
return invalidSqlErrMsg(pQueryInfo->msg, msg13);
|
||||||
}
|
}
|
||||||
|
|
||||||
pAlterSQL->tagData.dataLen = pTagsSchema->bytes;
|
pAlterSQL->tagData.dataLen = pTagsSchema->bytes;
|
||||||
|
|
||||||
// validate the length of binary
|
// validate the length of binary
|
||||||
|
@ -4680,7 +4677,7 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL*
|
||||||
|
|
||||||
const char* msg0 = "soffset/offset can not be less than 0";
|
const char* msg0 = "soffset/offset can not be less than 0";
|
||||||
const char* msg1 = "slimit/soffset only available for STable query";
|
const char* msg1 = "slimit/soffset only available for STable query";
|
||||||
const char* msg2 = "function not supported on table";
|
const char* msg2 = "functions mixed up in table query";
|
||||||
const char* msg3 = "slimit/soffset can not apply to projection query";
|
const char* msg3 = "slimit/soffset can not apply to projection query";
|
||||||
|
|
||||||
// handle the limit offset value, validate the limit
|
// handle the limit offset value, validate the limit
|
||||||
|
@ -4763,14 +4760,22 @@ int32_t parseLimitClause(SQueryInfo* pQueryInfo, int32_t clauseIndex, SQuerySQL*
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t size = taosArrayGetSize(pQueryInfo->exprList);
|
size_t size = taosArrayGetSize(pQueryInfo->exprList);
|
||||||
|
|
||||||
|
bool hasTags = false;
|
||||||
|
bool hasOtherFunc = false;
|
||||||
// filter the query functions operating on "tbname" column that are not supported by normal columns.
|
// filter the query functions operating on "tbname" column that are not supported by normal columns.
|
||||||
for (int32_t i = 0; i < size; ++i) {
|
for (int32_t i = 0; i < size; ++i) {
|
||||||
SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, i);
|
SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, i);
|
||||||
if (pExpr->colInfo.colIndex == TSDB_TBNAME_COLUMN_INDEX) {
|
if (TSDB_COL_IS_TAG(pExpr->colInfo.flag)) {
|
||||||
return invalidSqlErrMsg(pQueryInfo->msg, msg2);
|
hasTags = true;
|
||||||
|
} else {
|
||||||
|
hasOtherFunc = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasTags && hasOtherFunc) {
|
||||||
|
return invalidSqlErrMsg(pQueryInfo->msg, msg2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
@ -5571,21 +5576,9 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) {
|
||||||
if (pList->a[i].pVar.nLen + VARSTR_HEADER_SIZE > pTagSchema[i].bytes) {
|
if (pList->a[i].pVar.nLen + VARSTR_HEADER_SIZE > pTagSchema[i].bytes) {
|
||||||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3);
|
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = tVariantDump(&(pList->a[i].pVar), varDataVal(tagVal), pTagSchema[i].type);
|
|
||||||
if (pList->a[i].pVar.nType == TSDB_DATA_TYPE_NULL) {
|
|
||||||
if (pTagSchema[i].type == TSDB_DATA_TYPE_BINARY) {
|
|
||||||
varDataSetLen(tagVal, sizeof(uint8_t));
|
|
||||||
} else {
|
|
||||||
varDataSetLen(tagVal, sizeof(uint32_t));
|
|
||||||
}
|
|
||||||
} else { // todo refactor
|
|
||||||
varDataSetLen(tagVal, pList->a[i].pVar.nLen);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ret = tVariantDump(&(pList->a[i].pVar), tagVal, pTagSchema[i].type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = tVariantDump(&(pList->a[i].pVar), tagVal, pTagSchema[i].type, true);
|
||||||
if (ret != TSDB_CODE_SUCCESS) {
|
if (ret != TSDB_CODE_SUCCESS) {
|
||||||
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4);
|
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4);
|
||||||
}
|
}
|
||||||
|
@ -5845,7 +5838,7 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) {
|
||||||
pQueryInfo->window.ekey = pQueryInfo->window.ekey / 1000;
|
pQueryInfo->window.ekey = pQueryInfo->window.ekey / 1000;
|
||||||
}
|
}
|
||||||
} else { // set the time rang
|
} else { // set the time rang
|
||||||
pQueryInfo->window.skey = 0;
|
pQueryInfo->window.skey = TSKEY_INITIAL_VAL;
|
||||||
pQueryInfo->window.ekey = INT64_MAX;
|
pQueryInfo->window.ekey = INT64_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -689,7 +689,7 @@ int32_t tscLocalReducerEnvCreate(SSqlObj *pSql, tExtMemBuffer ***pMemBuffer, tOr
|
||||||
|
|
||||||
SSchema *p1 = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, pExpr->colInfo.colIndex);
|
SSchema *p1 = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, pExpr->colInfo.colIndex);
|
||||||
|
|
||||||
int16_t inter = 0;
|
int32_t inter = 0;
|
||||||
int16_t type = -1;
|
int16_t type = -1;
|
||||||
int16_t bytes = 0;
|
int16_t bytes = 0;
|
||||||
|
|
||||||
|
@ -1049,7 +1049,14 @@ static void doExecuteSecondaryMerge(SSqlCmd *pCmd, SLocalReducer *pLocalReducer,
|
||||||
int32_t functionId = pExpr->functionId;
|
int32_t functionId = pExpr->functionId;
|
||||||
if (functionId == TSDB_FUNC_TAG_DUMMY || functionId == TSDB_FUNC_TAG || functionId == TSDB_FUNC_TS_DUMMY) {
|
if (functionId == TSDB_FUNC_TAG_DUMMY || functionId == TSDB_FUNC_TAG || functionId == TSDB_FUNC_TS_DUMMY) {
|
||||||
tVariantDestroy(&pCtx->tag);
|
tVariantDestroy(&pCtx->tag);
|
||||||
tVariantCreateFromBinary(&pCtx->tag, pCtx->aInputElemBuf, pCtx->inputBytes, pCtx->inputType);
|
char* input = pCtx->aInputElemBuf;
|
||||||
|
|
||||||
|
if (pCtx->inputType == TSDB_DATA_TYPE_BINARY || pCtx->inputType == TSDB_DATA_TYPE_NCHAR) {
|
||||||
|
assert(varDataLen(input) <= pCtx->inputBytes);
|
||||||
|
tVariantCreateFromBinary(&pCtx->tag, varDataVal(input), varDataLen(input), pCtx->inputType);
|
||||||
|
} else {
|
||||||
|
tVariantCreateFromBinary(&pCtx->tag, input, pCtx->inputBytes, pCtx->inputType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pCtx->currentStage = SECONDARY_STAGE_MERGE;
|
pCtx->currentStage = SECONDARY_STAGE_MERGE;
|
||||||
|
@ -1309,7 +1316,7 @@ static bool isAllSourcesCompleted(SLocalReducer *pLocalReducer) {
|
||||||
return (pLocalReducer->numOfBuffer == pLocalReducer->numOfCompleted);
|
return (pLocalReducer->numOfBuffer == pLocalReducer->numOfCompleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool doInterpolationForCurrentGroup(SSqlObj *pSql) {
|
static bool doBuildFilledResultForGroup(SSqlObj *pSql) {
|
||||||
SSqlCmd *pCmd = &pSql->cmd;
|
SSqlCmd *pCmd = &pSql->cmd;
|
||||||
SSqlRes *pRes = &pSql->res;
|
SSqlRes *pRes = &pSql->res;
|
||||||
|
|
||||||
|
@ -1347,8 +1354,8 @@ static bool doHandleLastRemainData(SSqlObj *pSql) {
|
||||||
SSqlCmd *pCmd = &pSql->cmd;
|
SSqlCmd *pCmd = &pSql->cmd;
|
||||||
SSqlRes *pRes = &pSql->res;
|
SSqlRes *pRes = &pSql->res;
|
||||||
|
|
||||||
SLocalReducer * pLocalReducer = pRes->pLocalReducer;
|
SLocalReducer *pLocalReducer = pRes->pLocalReducer;
|
||||||
SFillInfo *pFillInfo = pLocalReducer->pFillInfo;
|
SFillInfo *pFillInfo = pLocalReducer->pFillInfo;
|
||||||
|
|
||||||
bool prevGroupCompleted = (!pLocalReducer->discard) && pLocalReducer->hasUnprocessedRow;
|
bool prevGroupCompleted = (!pLocalReducer->discard) && pLocalReducer->hasUnprocessedRow;
|
||||||
|
|
||||||
|
@ -1445,7 +1452,7 @@ int32_t tscDoLocalMerge(SSqlObj *pSql) {
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doInterpolationForCurrentGroup(pSql)) {
|
if (doBuildFilledResultForGroup(pSql)) {
|
||||||
pLocalReducer->status = TSC_LOCALREDUCE_READY; // set the flag, taos_free_result can release this result.
|
pLocalReducer->status = TSC_LOCALREDUCE_READY; // set the flag, taos_free_result can release this result.
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1464,8 +1471,7 @@ int32_t tscDoLocalMerge(SSqlObj *pSql) {
|
||||||
#ifdef _DEBUG_VIEW
|
#ifdef _DEBUG_VIEW
|
||||||
printf("chosen data in pTree[0] = %d\n", pTree->pNode[0].index);
|
printf("chosen data in pTree[0] = %d\n", pTree->pNode[0].index);
|
||||||
#endif
|
#endif
|
||||||
assert((pTree->pNode[0].index < pLocalReducer->numOfBuffer) && (pTree->pNode[0].index >= 0) &&
|
assert((pTree->pNode[0].index < pLocalReducer->numOfBuffer) && (pTree->pNode[0].index >= 0) && tmpBuffer->num == 0);
|
||||||
tmpBuffer->num == 0);
|
|
||||||
|
|
||||||
// chosen from loser tree
|
// chosen from loser tree
|
||||||
SLocalDataSource *pOneDataSrc = pLocalReducer->pLocalDataSrc[pTree->pNode[0].index];
|
SLocalDataSource *pOneDataSrc = pLocalReducer->pLocalDataSrc[pTree->pNode[0].index];
|
||||||
|
|
|
@ -651,7 +651,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
|
|
||||||
pQueryMsg->order = htons(pQueryInfo->order.order);
|
pQueryMsg->order = htons(pQueryInfo->order.order);
|
||||||
pQueryMsg->orderColId = htons(pQueryInfo->order.orderColId);
|
pQueryMsg->orderColId = htons(pQueryInfo->order.orderColId);
|
||||||
pQueryMsg->fillType = htons(pQueryInfo->fillType);
|
pQueryMsg->fillType = htons(pQueryInfo->fillType);
|
||||||
pQueryMsg->limit = htobe64(pQueryInfo->limit.limit);
|
pQueryMsg->limit = htobe64(pQueryInfo->limit.limit);
|
||||||
pQueryMsg->offset = htobe64(pQueryInfo->limit.offset);
|
pQueryMsg->offset = htobe64(pQueryInfo->limit.offset);
|
||||||
pQueryMsg->numOfCols = htons(taosArrayGetSize(pQueryInfo->colList));
|
pQueryMsg->numOfCols = htons(taosArrayGetSize(pQueryInfo->colList));
|
||||||
|
@ -1287,7 +1287,7 @@ int tscBuildAlterTableMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
|
|
||||||
pAlterTableMsg->numOfCols = htons(tscNumOfFields(pQueryInfo));
|
pAlterTableMsg->numOfCols = htons(tscNumOfFields(pQueryInfo));
|
||||||
SSchema *pSchema = pAlterTableMsg->schema;
|
SSchema *pSchema = pAlterTableMsg->schema;
|
||||||
for (int i = 0; i < pAlterTableMsg->numOfCols; ++i) {
|
for (int i = 0; i < tscNumOfFields(pQueryInfo); ++i) {
|
||||||
TAOS_FIELD *pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, i);
|
TAOS_FIELD *pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, i);
|
||||||
|
|
||||||
pSchema->type = pField->type;
|
pSchema->type = pField->type;
|
||||||
|
@ -1843,17 +1843,6 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
|
||||||
|
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
STableMeta* pTableMeta = tscCreateTableMetaFromMsg(pMetaMsg, &size);
|
STableMeta* pTableMeta = tscCreateTableMetaFromMsg(pMetaMsg, &size);
|
||||||
|
|
||||||
#if 0
|
|
||||||
// if current table is created according to super table, get the table meta of super table
|
|
||||||
if (pTableMeta->tableType == TSDB_CHILD_TABLE) {
|
|
||||||
char id[TSDB_TABLE_ID_LEN + 1] = {0};
|
|
||||||
strncpy(id, pMetaMsg->stableId, TSDB_TABLE_ID_LEN);
|
|
||||||
|
|
||||||
// NOTE: if the table meta of super table is not cached at client side yet, the pSTable is NULL
|
|
||||||
pTableMeta->pSTable = taosCacheAcquireByName(tscCacheHandle, id);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// todo add one more function: taosAddDataIfNotExists();
|
// todo add one more function: taosAddDataIfNotExists();
|
||||||
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, 0, 0);
|
STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, 0, 0);
|
||||||
|
@ -1976,7 +1965,7 @@ int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) {
|
||||||
|
|
||||||
pSql->res.code = TSDB_CODE_SUCCESS;
|
pSql->res.code = TSDB_CODE_SUCCESS;
|
||||||
pSql->res.numOfTotal = i;
|
pSql->res.numOfTotal = i;
|
||||||
tscTrace("%p load multi-metermeta resp complete num:%d", pSql, pSql->res.numOfTotal);
|
tscTrace("%p load multi-metermeta resp from complete num:%d", pSql, pSql->res.numOfTotal);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
|
|
@ -284,12 +284,11 @@ int taos_query(TAOS *taos, const char *sqlstr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SSqlObj* pSql = pObj->pSql;
|
SSqlObj* pSql = pObj->pSql;
|
||||||
|
size_t sqlLen = strlen(sqlstr);
|
||||||
size_t sqlLen = strlen(sqlstr);
|
|
||||||
doAsyncQuery(pObj, pSql, waitForQueryRsp, taos, sqlstr, sqlLen);
|
doAsyncQuery(pObj, pSql, waitForQueryRsp, taos, sqlstr, sqlLen);
|
||||||
|
|
||||||
// wait for the callback function to post the semaphore
|
// wait for the callback function to post the semaphore
|
||||||
sem_wait(&pSql->rspSem);
|
tsem_wait(&pSql->rspSem);
|
||||||
return pSql->res.code;
|
return pSql->res.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -525,7 +524,7 @@ int taos_select_db(TAOS *taos, const char *db) {
|
||||||
return taos_query(taos, sql);
|
return taos_query(taos, sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
|
void taos_free_result(TAOS_RES *res) {
|
||||||
if (res == NULL) return;
|
if (res == NULL) return;
|
||||||
|
|
||||||
SSqlObj *pSql = (SSqlObj *)res;
|
SSqlObj *pSql = (SSqlObj *)res;
|
||||||
|
@ -536,26 +535,23 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
|
||||||
|
|
||||||
if (pSql->signature != pSql) return;
|
if (pSql->signature != pSql) return;
|
||||||
|
|
||||||
|
STscObj* pObj = pSql->pTscObj;
|
||||||
if (pRes == NULL || pRes->qhandle == 0) {
|
if (pRes == NULL || pRes->qhandle == 0) {
|
||||||
/* Query rsp is not received from vnode, so the qhandle is NULL */
|
/* Query rsp is not received from vnode, so the qhandle is NULL */
|
||||||
tscTrace("%p qhandle is null, abort free, fp:%p", pSql, pSql->fp);
|
tscTrace("%p qhandle is null, abort free, fp:%p", pSql, pSql->fp);
|
||||||
STscObj* pTscObj = pSql->pTscObj;
|
|
||||||
|
|
||||||
if (pTscObj->pSql != pSql) {
|
// The semaphore can not be changed while freeing async sub query objects.
|
||||||
|
if (pObj->pSql != pSql) {
|
||||||
tscTrace("%p SqlObj is freed by app", pSql);
|
tscTrace("%p SqlObj is freed by app", pSql);
|
||||||
tscFreeSqlObj(pSql);
|
tscFreeSqlObj(pSql);
|
||||||
} else {
|
} else {
|
||||||
if (keepCmd) {
|
tscPartiallyFreeSqlObj(pSql);
|
||||||
tscFreeSqlResult(pSql);
|
|
||||||
} else {
|
|
||||||
tscPartiallyFreeSqlObj(pSql);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set freeFlag to 1 in retrieve message if there are un-retrieved results
|
// set freeFlag to 1 in retrieve message if there are un-retrieved results data in node
|
||||||
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0);
|
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0);
|
||||||
if (pQueryInfo == NULL) {
|
if (pQueryInfo == NULL) {
|
||||||
tscPartiallyFreeSqlObj(pSql);
|
tscPartiallyFreeSqlObj(pSql);
|
||||||
|
@ -563,6 +559,7 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pQueryInfo->type = TSDB_QUERY_TYPE_FREE_RESOURCE;
|
pQueryInfo->type = TSDB_QUERY_TYPE_FREE_RESOURCE;
|
||||||
|
STscObj* pTscObj = pSql->pTscObj;
|
||||||
|
|
||||||
STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
|
STableMetaInfo *pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
|
||||||
|
|
||||||
|
@ -579,9 +576,8 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
|
||||||
if ((pCmd->command == TSDB_SQL_SELECT ||
|
if ((pCmd->command == TSDB_SQL_SELECT ||
|
||||||
pCmd->command == TSDB_SQL_SHOW ||
|
pCmd->command == TSDB_SQL_SHOW ||
|
||||||
pCmd->command == TSDB_SQL_RETRIEVE ||
|
pCmd->command == TSDB_SQL_RETRIEVE ||
|
||||||
pCmd->command == TSDB_SQL_FETCH) && pRes->code == TSDB_CODE_SUCCESS &&
|
pCmd->command == TSDB_SQL_FETCH) && pRes->code == TSDB_CODE_SUCCESS && pRes->completed == false &&
|
||||||
((pCmd->command < TSDB_SQL_LOCAL && pRes->completed == false) ||
|
(pCmd->command == TSDB_SQL_SELECT && pSql->pStream == NULL && pTableMetaInfo->pTableMeta != NULL)) {
|
||||||
(pCmd->command == TSDB_SQL_SELECT && pSql->pStream == NULL && pTableMetaInfo->pTableMeta != NULL))) {
|
|
||||||
pCmd->command = (pCmd->command > TSDB_SQL_MGMT) ? TSDB_SQL_RETRIEVE : TSDB_SQL_FETCH;
|
pCmd->command = (pCmd->command > TSDB_SQL_MGMT) ? TSDB_SQL_RETRIEVE : TSDB_SQL_FETCH;
|
||||||
|
|
||||||
tscTrace("%p send msg to free qhandle in vnode, code:%d, numOfRows:%d, command:%s", pSql, pRes->code, pRes->numOfRows,
|
tscTrace("%p send msg to free qhandle in vnode, code:%d, numOfRows:%d, command:%s", pSql, pRes->code, pRes->numOfRows,
|
||||||
|
@ -591,30 +587,20 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) {
|
||||||
tscProcessSql(pSql);
|
tscProcessSql(pSql);
|
||||||
|
|
||||||
// waits for response and then goes on
|
// waits for response and then goes on
|
||||||
STscObj* pTscObj = pSql->pTscObj;
|
|
||||||
if (pTscObj->pSql == pSql) {
|
if (pTscObj->pSql == pSql) {
|
||||||
sem_wait(&pSql->rspSem);
|
sem_wait(&pSql->rspSem);
|
||||||
}
|
}
|
||||||
} else { // if no free resource msg is sent to vnode, we free this object immediately.
|
} else { // if no free resource msg is sent to vnode, we free this object immediately.
|
||||||
STscObj* pTscObj = pSql->pTscObj;
|
|
||||||
|
|
||||||
if (pTscObj->pSql != pSql) {
|
if (pTscObj->pSql != pSql) {
|
||||||
tscFreeSqlObj(pSql);
|
tscFreeSqlObj(pSql);
|
||||||
tscTrace("%p sql result is freed by app", pSql);
|
tscTrace("%p sql result is freed by app", pSql);
|
||||||
} else {
|
} else {
|
||||||
if (keepCmd) {
|
tscPartiallyFreeSqlObj(pSql);
|
||||||
tscFreeSqlResult(pSql);
|
tscTrace("%p sql result is freed by app", pSql);
|
||||||
tscTrace("%p sql result is freed while sql command is kept", pSql);
|
|
||||||
} else {
|
|
||||||
tscPartiallyFreeSqlObj(pSql);
|
|
||||||
tscTrace("%p sql result is freed by app", pSql);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void taos_free_result(TAOS_RES *res) { taos_free_result_imp(res, 0); }
|
|
||||||
|
|
||||||
// todo should not be used in async query
|
// todo should not be used in async query
|
||||||
int taos_errno(TAOS *taos) {
|
int taos_errno(TAOS *taos) {
|
||||||
STscObj *pObj = (STscObj *)taos;
|
STscObj *pObj = (STscObj *)taos;
|
||||||
|
|
|
@ -1084,7 +1084,7 @@ int32_t tscLaunchJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter
|
||||||
|
|
||||||
int16_t bytes = 0;
|
int16_t bytes = 0;
|
||||||
int16_t type = 0;
|
int16_t type = 0;
|
||||||
int16_t inter = 0;
|
int32_t inter = 0;
|
||||||
|
|
||||||
getResultDataInfo(s.type, s.bytes, TSDB_FUNC_TID_TAG, 0, &type, &bytes, &inter, 0, 0);
|
getResultDataInfo(s.type, s.bytes, TSDB_FUNC_TID_TAG, 0, &type, &bytes, &inter, 0, 0);
|
||||||
|
|
||||||
|
@ -1770,6 +1770,8 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
|
||||||
*/
|
*/
|
||||||
pNew->fetchFp = pNew->fp;
|
pNew->fetchFp = pNew->fp;
|
||||||
pSql->pSubs[i] = pNew;
|
pSql->pSubs[i] = pNew;
|
||||||
|
pNew->fetchFp = pNew->fp;
|
||||||
|
|
||||||
tscTrace("%p sub:%p create subObj success. orderOfSub:%d", pSql, pNew, i);
|
tscTrace("%p sub:%p create subObj success. orderOfSub:%d", pSql, pNew, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -421,7 +421,6 @@ void tscFreeSqlObj(SSqlObj* pSql) {
|
||||||
|
|
||||||
memset(pCmd->payload, 0, (size_t)pCmd->allocSize);
|
memset(pCmd->payload, 0, (size_t)pCmd->allocSize);
|
||||||
tfree(pCmd->payload);
|
tfree(pCmd->payload);
|
||||||
|
|
||||||
pCmd->allocSize = 0;
|
pCmd->allocSize = 0;
|
||||||
|
|
||||||
tfree(pSql->sqlstr);
|
tfree(pSql->sqlstr);
|
||||||
|
@ -1033,7 +1032,7 @@ SSqlExpr* tscSqlExprUpdate(SQueryInfo* pQueryInfo, int32_t index, int16_t functi
|
||||||
return pExpr;
|
return pExpr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tscSqlExprNumOfExprs(SQueryInfo* pQueryInfo) {
|
size_t tscSqlExprNumOfExprs(SQueryInfo* pQueryInfo) {
|
||||||
return taosArrayGetSize(pQueryInfo->exprList);
|
return taosArrayGetSize(pQueryInfo->exprList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1352,7 +1351,7 @@ bool tscValidateColumnId(STableMetaInfo* pTableMetaInfo, int32_t colId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colId == -1 && UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) {
|
if (colId == TSDB_TBNAME_COLUMN_INDEX) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1768,11 +1767,12 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
|
||||||
pNewQueryInfo->limit = pQueryInfo->limit;
|
pNewQueryInfo->limit = pQueryInfo->limit;
|
||||||
pNewQueryInfo->slimit = pQueryInfo->slimit;
|
pNewQueryInfo->slimit = pQueryInfo->slimit;
|
||||||
pNewQueryInfo->order = pQueryInfo->order;
|
pNewQueryInfo->order = pQueryInfo->order;
|
||||||
pNewQueryInfo->clauseLimit = pQueryInfo->clauseLimit;
|
pNewQueryInfo->tsBuf = NULL;
|
||||||
pNewQueryInfo->pTableMetaInfo = NULL;
|
pNewQueryInfo->fillType = pQueryInfo->fillType;
|
||||||
pNewQueryInfo->fillVal = NULL;
|
pNewQueryInfo->fillVal = NULL;
|
||||||
|
pNewQueryInfo->clauseLimit = pQueryInfo->clauseLimit;
|
||||||
pNewQueryInfo->numOfTables = 0;
|
pNewQueryInfo->numOfTables = 0;
|
||||||
pNewQueryInfo->tsBuf = NULL;
|
pNewQueryInfo->pTableMetaInfo = NULL;
|
||||||
|
|
||||||
pNewQueryInfo->groupbyExpr = pQueryInfo->groupbyExpr;
|
pNewQueryInfo->groupbyExpr = pQueryInfo->groupbyExpr;
|
||||||
if (pQueryInfo->groupbyExpr.columnInfo != NULL) {
|
if (pQueryInfo->groupbyExpr.columnInfo != NULL) {
|
||||||
|
@ -1864,7 +1864,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pFinalInfo->pTableMeta == NULL) {
|
if (pFinalInfo->pTableMeta == NULL) {
|
||||||
tscError("%p new subquery failed for get pMeterMeta is NULL from cache", pSql);
|
tscError("%p new subquery failed for get tableMeta is NULL from cache", pSql);
|
||||||
tscFreeSqlObj(pNew);
|
tscFreeSqlObj(pNew);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -2011,7 +2011,7 @@ bool hasMoreVnodesToTry(SSqlObj* pSql) {
|
||||||
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
|
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
|
||||||
assert(pRes->completed);
|
assert(pRes->completed);
|
||||||
|
|
||||||
// for normal table, do not try any more if result are exhausted
|
// for normal table, no need to try any more if results are all retrieved from one vnode
|
||||||
if (!UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo) || (pTableMetaInfo->vgroupList == NULL)) {
|
if (!UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo) || (pTableMetaInfo->vgroupList == NULL)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2037,7 +2037,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
|
||||||
|
|
||||||
int32_t totalVgroups = pTableMetaInfo->vgroupList->numOfVgroups;
|
int32_t totalVgroups = pTableMetaInfo->vgroupList->numOfVgroups;
|
||||||
while (++pTableMetaInfo->vgroupIndex < totalVgroups) {
|
while (++pTableMetaInfo->vgroupIndex < totalVgroups) {
|
||||||
tscTrace("%p current vnode:%d exhausted, try next:%d. total vnode:%d. current numOfRes:%d", pSql,
|
tscTrace("%p results from vgroup index:%d completed, try next:%d. total vgroups:%d. current numOfRes:%d", pSql,
|
||||||
pTableMetaInfo->vgroupIndex - 1, pTableMetaInfo->vgroupIndex, totalVgroups, pRes->numOfClauseTotal);
|
pTableMetaInfo->vgroupIndex - 1, pTableMetaInfo->vgroupIndex, totalVgroups, pRes->numOfClauseTotal);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2121,7 +2121,7 @@ void tscGetResultColumnChr(SSqlRes* pRes, SFieldInfo* pFieldInfo, int32_t column
|
||||||
int32_t type = pInfo->pSqlExpr->resType;
|
int32_t type = pInfo->pSqlExpr->resType;
|
||||||
int32_t bytes = pInfo->pSqlExpr->resBytes;
|
int32_t bytes = pInfo->pSqlExpr->resBytes;
|
||||||
|
|
||||||
char* pData = ((char*) pRes->data) + pInfo->pSqlExpr->offset * pRes->numOfRows + bytes * pRes->row;
|
char* pData = pRes->data + pInfo->pSqlExpr->offset * pRes->numOfRows + bytes * pRes->row;
|
||||||
|
|
||||||
if (type == TSDB_DATA_TYPE_NCHAR || type == TSDB_DATA_TYPE_BINARY) {
|
if (type == TSDB_DATA_TYPE_NCHAR || type == TSDB_DATA_TYPE_BINARY) {
|
||||||
int32_t realLen = varDataLen(pData);
|
int32_t realLen = varDataLen(pData);
|
||||||
|
@ -2134,7 +2134,7 @@ void tscGetResultColumnChr(SSqlRes* pRes, SFieldInfo* pFieldInfo, int32_t column
|
||||||
}
|
}
|
||||||
|
|
||||||
if (realLen < pInfo->pSqlExpr->resBytes - VARSTR_HEADER_SIZE) { // todo refactor
|
if (realLen < pInfo->pSqlExpr->resBytes - VARSTR_HEADER_SIZE) { // todo refactor
|
||||||
*(char*) (pData + realLen + VARSTR_HEADER_SIZE) = 0;
|
*(pData + realLen + VARSTR_HEADER_SIZE) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pRes->length[columnIndex] = realLen;
|
pRes->length[columnIndex] = realLen;
|
||||||
|
|
|
@ -196,6 +196,7 @@ void * tdQueryTagByID(SDataRow row, int16_t colId, int16_t *type) {
|
||||||
STagCol key = {colId,0,0};
|
STagCol key = {colId,0,0};
|
||||||
STagCol * stCol = taosbsearch(&key, pBase, nCols, sizeof(STagCol), compTagId, TD_EQ);
|
STagCol * stCol = taosbsearch(&key, pBase, nCols, sizeof(STagCol), compTagId, TD_EQ);
|
||||||
if (NULL == stCol) {
|
if (NULL == stCol) {
|
||||||
|
type = TSDB_DATA_TYPE_NULL;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,35 @@ const int32_t TYPE_BYTES[11] = {
|
||||||
sizeof(VarDataOffsetT) // TSDB_DATA_TYPE_NCHAR
|
sizeof(VarDataOffsetT) // TSDB_DATA_TYPE_NCHAR
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void getStatics_bool(const TSKEY *primaryKey, const void *pData, int32_t numOfRow, int64_t *min, int64_t *max,
|
||||||
|
int64_t *sum, int16_t *minIndex, int16_t *maxIndex, int16_t *numOfNull) {
|
||||||
|
int8_t *data = (int8_t *)pData;
|
||||||
|
*min = INT64_MAX;
|
||||||
|
*max = INT64_MIN;
|
||||||
|
*minIndex = 0;
|
||||||
|
*maxIndex = 0;
|
||||||
|
|
||||||
|
ASSERT(numOfRow <= INT16_MAX);
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < numOfRow; ++i) {
|
||||||
|
if (isNull((char *)&data[i], TSDB_DATA_TYPE_BOOL)) {
|
||||||
|
(*numOfNull) += 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
*sum += data[i];
|
||||||
|
if (*min > data[i]) {
|
||||||
|
*min = data[i];
|
||||||
|
*minIndex = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*max < data[i]) {
|
||||||
|
*max = data[i];
|
||||||
|
*maxIndex = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void getStatics_i8(const TSKEY *primaryKey, const void *pData, int32_t numOfRow, int64_t *min, int64_t *max,
|
static void getStatics_i8(const TSKEY *primaryKey, const void *pData, int32_t numOfRow, int64_t *min, int64_t *max,
|
||||||
int64_t *sum, int16_t *minIndex, int16_t *maxIndex, int16_t *numOfNull) {
|
int64_t *sum, int16_t *minIndex, int16_t *maxIndex, int16_t *numOfNull) {
|
||||||
int8_t *data = (int8_t *)pData;
|
int8_t *data = (int8_t *)pData;
|
||||||
|
@ -131,15 +160,6 @@ static void getStatics_i32(const TSKEY *primaryKey, const void *pData, int32_t n
|
||||||
*max = data[i];
|
*max = data[i];
|
||||||
*maxIndex = i;
|
*maxIndex = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (isNull(&lastVal, TSDB_DATA_TYPE_INT)) {
|
|
||||||
// lastKey = primaryKey[i];
|
|
||||||
// lastVal = data[i];
|
|
||||||
// } else {
|
|
||||||
// *wsum = lastVal * (primaryKey[i] - lastKey);
|
|
||||||
// lastKey = primaryKey[i];
|
|
||||||
// lastVal = data[i];
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,11 +299,11 @@ static void getStatics_bin(const TSKEY *primaryKey, const void *pData, int32_t n
|
||||||
ASSERT(numOfRow <= INT16_MAX);
|
ASSERT(numOfRow <= INT16_MAX);
|
||||||
|
|
||||||
for (int32_t i = 0; i < numOfRow; ++i) {
|
for (int32_t i = 0; i < numOfRow; ++i) {
|
||||||
if (isNull((const char*) varDataVal(data), TSDB_DATA_TYPE_BINARY)) {
|
if (isNull(data, TSDB_DATA_TYPE_BINARY)) {
|
||||||
(*numOfNull) += 1;
|
(*numOfNull) += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
data += varDataLen(data);
|
data += varDataTLen(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
*sum = 0;
|
*sum = 0;
|
||||||
|
@ -299,11 +319,11 @@ static void getStatics_nchr(const TSKEY *primaryKey, const void *pData, int32_t
|
||||||
ASSERT(numOfRow <= INT16_MAX);
|
ASSERT(numOfRow <= INT16_MAX);
|
||||||
|
|
||||||
for (int32_t i = 0; i < numOfRow; ++i) {
|
for (int32_t i = 0; i < numOfRow; ++i) {
|
||||||
if (isNull((const char*) varDataVal(data), TSDB_DATA_TYPE_NCHAR)) {
|
if (isNull(data, TSDB_DATA_TYPE_NCHAR)) {
|
||||||
(*numOfNull) += 1;
|
(*numOfNull) += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
data += varDataLen(data);
|
data += varDataTLen(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
*sum = 0;
|
*sum = 0;
|
||||||
|
@ -315,7 +335,7 @@ static void getStatics_nchr(const TSKEY *primaryKey, const void *pData, int32_t
|
||||||
|
|
||||||
tDataTypeDescriptor tDataTypeDesc[11] = {
|
tDataTypeDescriptor tDataTypeDesc[11] = {
|
||||||
{TSDB_DATA_TYPE_NULL, 6, 1, "NOTYPE", NULL, NULL, NULL},
|
{TSDB_DATA_TYPE_NULL, 6, 1, "NOTYPE", NULL, NULL, NULL},
|
||||||
{TSDB_DATA_TYPE_BOOL, 4, CHAR_BYTES, "BOOL", tsCompressBool, tsDecompressBool, getStatics_i8},
|
{TSDB_DATA_TYPE_BOOL, 4, CHAR_BYTES, "BOOL", tsCompressBool, tsDecompressBool, getStatics_bool},
|
||||||
{TSDB_DATA_TYPE_TINYINT, 7, CHAR_BYTES, "TINYINT", tsCompressTinyint, tsDecompressTinyint, getStatics_i8},
|
{TSDB_DATA_TYPE_TINYINT, 7, CHAR_BYTES, "TINYINT", tsCompressTinyint, tsDecompressTinyint, getStatics_i8},
|
||||||
{TSDB_DATA_TYPE_SMALLINT, 8, SHORT_BYTES, "SMALLINT", tsCompressSmallint, tsDecompressSmallint, getStatics_i16},
|
{TSDB_DATA_TYPE_SMALLINT, 8, SHORT_BYTES, "SMALLINT", tsCompressSmallint, tsDecompressSmallint, getStatics_i16},
|
||||||
{TSDB_DATA_TYPE_INT, 3, INT_BYTES, "INT", tsCompressInt, tsDecompressInt, getStatics_i32},
|
{TSDB_DATA_TYPE_INT, 3, INT_BYTES, "INT", tsCompressInt, tsDecompressInt, getStatics_i32},
|
||||||
|
|
|
@ -293,9 +293,9 @@ void tsDataSwap(void *pLeft, void *pRight, int32_t type, int32_t size);
|
||||||
#define TSDB_MAX_COMP_LEVEL 2
|
#define TSDB_MAX_COMP_LEVEL 2
|
||||||
#define TSDB_DEFAULT_COMP_LEVEL 2
|
#define TSDB_DEFAULT_COMP_LEVEL 2
|
||||||
|
|
||||||
#define TSDB_MIN_WAL_LEVEL 0
|
#define TSDB_MIN_WAL_LEVEL 1
|
||||||
#define TSDB_MAX_WAL_LEVEL 2
|
#define TSDB_MAX_WAL_LEVEL 2
|
||||||
#define TSDB_DEFAULT_WAL_LEVEL 2
|
#define TSDB_DEFAULT_WAL_LEVEL 1
|
||||||
|
|
||||||
#define TSDB_MIN_REPLICA_NUM 1
|
#define TSDB_MIN_REPLICA_NUM 1
|
||||||
#define TSDB_MAX_REPLICA_NUM 3
|
#define TSDB_MAX_REPLICA_NUM 3
|
||||||
|
|
|
@ -370,7 +370,7 @@ typedef struct SExprInfo {
|
||||||
struct tExprNode* pExpr;
|
struct tExprNode* pExpr;
|
||||||
int16_t bytes;
|
int16_t bytes;
|
||||||
int16_t type;
|
int16_t type;
|
||||||
int16_t interBytes;
|
int32_t interBytes;
|
||||||
} SExprInfo;
|
} SExprInfo;
|
||||||
|
|
||||||
typedef struct SColumnFilterInfo {
|
typedef struct SColumnFilterInfo {
|
||||||
|
@ -620,13 +620,6 @@ typedef struct {
|
||||||
SCMVgroupInfo vgroups[];
|
SCMVgroupInfo vgroups[];
|
||||||
} SVgroupsInfo;
|
} SVgroupsInfo;
|
||||||
|
|
||||||
//typedef struct {
|
|
||||||
// int32_t numOfTables;
|
|
||||||
// int32_t join;
|
|
||||||
// int32_t joinCondLen; // for join condition
|
|
||||||
// int32_t metaElem[TSDB_MAX_JOIN_TABLE_NUM];
|
|
||||||
//} SSuperTableMetaMsg;
|
|
||||||
|
|
||||||
typedef struct STableMetaMsg {
|
typedef struct STableMetaMsg {
|
||||||
int32_t contLen;
|
int32_t contLen;
|
||||||
char tableId[TSDB_TABLE_ID_LEN + 1]; // table id
|
char tableId[TSDB_TABLE_ID_LEN + 1]; // table id
|
||||||
|
|
|
@ -200,6 +200,10 @@ TsdbQueryHandleT *tsdbQueryTables(TsdbRepoT *tsdb, STsdbQueryCond *pCond, STable
|
||||||
*/
|
*/
|
||||||
TsdbQueryHandleT tsdbQueryLastRow(TsdbRepoT *tsdb, STsdbQueryCond *pCond, STableGroupInfo *groupInfo);
|
TsdbQueryHandleT tsdbQueryLastRow(TsdbRepoT *tsdb, STsdbQueryCond *pCond, STableGroupInfo *groupInfo);
|
||||||
|
|
||||||
|
SArray* tsdbGetQueriedTableIdList(TsdbQueryHandleT *pHandle);
|
||||||
|
|
||||||
|
TsdbQueryHandleT tsdbQueryRowsInExternalWindow(TsdbRepoT *tsdb, STsdbQueryCond* pCond, STableGroupInfo *groupList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* move to next block if exists
|
* move to next block if exists
|
||||||
*
|
*
|
||||||
|
|
|
@ -276,8 +276,8 @@ static int32_t mnodeCheckDbCfg(SDbCfg *pCfg) {
|
||||||
return TSDB_CODE_INVALID_OPTION;
|
return TSDB_CODE_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pCfg->replications > 1 && pCfg->walLevel <= TSDB_MIN_WAL_LEVEL) {
|
if (pCfg->walLevel < TSDB_MIN_WAL_LEVEL) {
|
||||||
mError("invalid db option walLevel:%d must > 0, while replica:%d > 1", pCfg->walLevel, pCfg->replications);
|
mError("invalid db option walLevel:%d must be greater than 0", pCfg->walLevel);
|
||||||
return TSDB_CODE_INVALID_OPTION;
|
return TSDB_CODE_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -871,8 +871,8 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SCMAlterDbMsg *pAlter) {
|
||||||
mTrace("db:%s, replications:%d change to %d", pDb->name, pDb->cfg.replications, replications);
|
mTrace("db:%s, replications:%d change to %d", pDb->name, pDb->cfg.replications, replications);
|
||||||
newCfg.replications = replications;
|
newCfg.replications = replications;
|
||||||
|
|
||||||
if (replications > 1 && pDb->cfg.walLevel <= TSDB_MIN_WAL_LEVEL) {
|
if (pDb->cfg.walLevel < TSDB_MIN_WAL_LEVEL) {
|
||||||
mError("db:%s, walLevel:%d must > 0, while replica:%d > 1", pDb->name, pDb->cfg.walLevel, replications);
|
mError("db:%s, walLevel:%d must be greater than 0", pDb->name, pDb->cfg.walLevel);
|
||||||
terrno = TSDB_CODE_INVALID_OPTION;
|
terrno = TSDB_CODE_INVALID_OPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,21 +28,16 @@
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
#include "tsqlfunction.h"
|
#include "tsqlfunction.h"
|
||||||
|
|
||||||
//typedef struct tFilePage {
|
|
||||||
// int64_t num;
|
|
||||||
// char data[];
|
|
||||||
//} tFilePage;
|
|
||||||
|
|
||||||
struct SColumnFilterElem;
|
struct SColumnFilterElem;
|
||||||
typedef bool (*__filter_func_t)(struct SColumnFilterElem* pFilter, char* val1, char* val2);
|
typedef bool (*__filter_func_t)(struct SColumnFilterElem* pFilter, char* val1, char* val2);
|
||||||
typedef int32_t (*__block_search_fn_t)(char* data, int32_t num, int64_t key, int32_t order);
|
typedef int32_t (*__block_search_fn_t)(char* data, int32_t num, int64_t key, int32_t order);
|
||||||
|
|
||||||
typedef struct SSqlGroupbyExpr {
|
typedef struct SSqlGroupbyExpr {
|
||||||
int16_t tableIndex;
|
int16_t tableIndex;
|
||||||
SArray* columnInfo; // SArray<SColIndex>, group by columns information
|
SArray* columnInfo; // SArray<SColIndex>, group by columns information
|
||||||
int16_t numOfGroupCols;
|
int16_t numOfGroupCols;
|
||||||
int16_t orderIndex; // order by column index
|
int16_t orderIndex; // order by column index
|
||||||
int16_t orderType; // order by type: asc/desc
|
int16_t orderType; // order by type: asc/desc
|
||||||
} SSqlGroupbyExpr;
|
} SSqlGroupbyExpr;
|
||||||
|
|
||||||
typedef struct SPosInfo {
|
typedef struct SPosInfo {
|
||||||
|
@ -62,25 +57,27 @@ typedef struct SWindowResult {
|
||||||
SWindowStatus status; // this result status: closed or opened
|
SWindowStatus status; // this result status: closed or opened
|
||||||
} SWindowResult;
|
} SWindowResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the number of generated results is greater than this value,
|
||||||
|
* query query will be halt and return results to client immediate.
|
||||||
|
*/
|
||||||
typedef struct SResultRec {
|
typedef struct SResultRec {
|
||||||
int64_t total; // total generated result size in rows
|
int64_t total; // total generated result size in rows
|
||||||
int64_t rows; // current result set size in rows
|
int64_t rows; // current result set size in rows
|
||||||
int64_t capacity; // capacity of current result output buffer
|
int64_t capacity; // capacity of current result output buffer
|
||||||
|
int32_t threshold; // result size threshold in rows.
|
||||||
// result size threshold in rows. If the result buffer is larger than this, pause query and return to client
|
|
||||||
int32_t threshold;
|
|
||||||
} SResultRec;
|
} SResultRec;
|
||||||
|
|
||||||
typedef struct SWindowResInfo {
|
typedef struct SWindowResInfo {
|
||||||
SWindowResult* pResult; // result list
|
SWindowResult* pResult; // result list
|
||||||
void* hashList; // hash list for quick access
|
SHashObj* hashList; // hash list for quick access
|
||||||
int16_t type; // data type for hash key
|
int16_t type; // data type for hash key
|
||||||
int32_t capacity; // max capacity
|
int32_t capacity; // max capacity
|
||||||
int32_t curIndex; // current start active index
|
int32_t curIndex; // current start active index
|
||||||
int32_t size; // number of result set
|
int32_t size; // number of result set
|
||||||
int64_t startTime; // start time of the first time window for sliding query
|
int64_t startTime; // start time of the first time window for sliding query
|
||||||
int64_t prevSKey; // previous (not completed) sliding window start key
|
int64_t prevSKey; // previous (not completed) sliding window start key
|
||||||
int64_t threshold; // threshold to pausing query and return closed results.
|
int64_t threshold; // threshold to halt query and return the generated results.
|
||||||
} SWindowResInfo;
|
} SWindowResInfo;
|
||||||
|
|
||||||
typedef struct SColumnFilterElem {
|
typedef struct SColumnFilterElem {
|
||||||
|
@ -90,98 +87,111 @@ typedef struct SColumnFilterElem {
|
||||||
} SColumnFilterElem;
|
} SColumnFilterElem;
|
||||||
|
|
||||||
typedef struct SSingleColumnFilterInfo {
|
typedef struct SSingleColumnFilterInfo {
|
||||||
SColumnInfo info;
|
|
||||||
int32_t numOfFilters;
|
|
||||||
SColumnFilterElem* pFilters;
|
|
||||||
void* pData;
|
void* pData;
|
||||||
|
int32_t numOfFilters;
|
||||||
|
SColumnInfo info;
|
||||||
|
SColumnFilterElem* pFilters;
|
||||||
} SSingleColumnFilterInfo;
|
} SSingleColumnFilterInfo;
|
||||||
|
|
||||||
typedef struct STableQueryInfo { // todo merge with the STableQueryInfo struct
|
typedef struct STableQueryInfo { // todo merge with the STableQueryInfo struct
|
||||||
int32_t tableIndex;
|
int32_t tableIndex;
|
||||||
int32_t groupIdx; // group id in table list
|
int32_t groupIndex; // group id in table list
|
||||||
TSKEY lastKey;
|
TSKEY lastKey;
|
||||||
int32_t numOfRes;
|
int32_t numOfRes;
|
||||||
int16_t queryRangeSet; // denote if the query range is set, only available for interval query
|
int16_t queryRangeSet; // denote if the query range is set, only available for interval query
|
||||||
int64_t tag;
|
int64_t tag;
|
||||||
STimeWindow win;
|
STimeWindow win;
|
||||||
STSCursor cur;
|
STSCursor cur;
|
||||||
STableId id; // for retrieve the page id list
|
STableId id; // for retrieve the page id list
|
||||||
|
|
||||||
SWindowResInfo windowResInfo;
|
SWindowResInfo windowResInfo;
|
||||||
} STableQueryInfo;
|
} STableQueryInfo;
|
||||||
|
|
||||||
typedef struct SQueryCostSummary {
|
typedef struct SQueryCostInfo {
|
||||||
} SQueryCostSummary;
|
uint64_t loadStatisTime;
|
||||||
|
uint64_t loadFileBlockTime;
|
||||||
|
uint64_t loadDataInCacheTime;
|
||||||
|
uint64_t loadStatisSize;
|
||||||
|
uint64_t loadFileBlockSize;
|
||||||
|
uint64_t loadDataInCacheSize;
|
||||||
|
|
||||||
|
uint64_t loadDataTime;
|
||||||
|
uint64_t dataInRows;
|
||||||
|
uint64_t checkRows;
|
||||||
|
uint32_t dataBlocks;
|
||||||
|
uint32_t loadBlockStatis;
|
||||||
|
uint32_t discardBlocks;
|
||||||
|
} SQueryCostInfo;
|
||||||
|
|
||||||
typedef struct SGroupItem {
|
typedef struct SGroupItem {
|
||||||
STableId id;
|
STableId id;
|
||||||
STableQueryInfo* info;
|
STableQueryInfo* info;
|
||||||
} SGroupItem;
|
} SGroupItem;
|
||||||
|
|
||||||
typedef struct SQuery {
|
typedef struct SQuery {
|
||||||
int16_t numOfCols;
|
int16_t numOfCols;
|
||||||
int16_t numOfTags;
|
int16_t numOfTags;
|
||||||
|
SOrderVal order;
|
||||||
SOrderVal order;
|
STimeWindow window;
|
||||||
STimeWindow window;
|
int64_t intervalTime;
|
||||||
int64_t intervalTime;
|
int64_t slidingTime; // sliding time for sliding window query
|
||||||
int64_t slidingTime; // sliding time for sliding window query
|
char slidingTimeUnit; // interval data type, used for daytime revise
|
||||||
char slidingTimeUnit; // interval data type, used for daytime revise
|
int8_t precision;
|
||||||
int8_t precision;
|
int16_t numOfOutput;
|
||||||
int16_t numOfOutput;
|
int16_t fillType;
|
||||||
int16_t fillType;
|
int16_t checkBuffer; // check if the buffer is full during scan each block
|
||||||
int16_t checkBuffer; // check if the buffer is full during scan each block
|
SLimitVal limit;
|
||||||
SLimitVal limit;
|
int32_t rowSize;
|
||||||
int32_t rowSize;
|
SSqlGroupbyExpr* pGroupbyExpr;
|
||||||
SSqlGroupbyExpr* pGroupbyExpr;
|
SExprInfo* pSelectExpr;
|
||||||
SExprInfo* pSelectExpr;
|
SColumnInfo* colList;
|
||||||
SColumnInfo* colList;
|
SColumnInfo* tagColList;
|
||||||
SColumnInfo* tagColList;
|
int32_t numOfFilterCols;
|
||||||
int32_t numOfFilterCols;
|
int64_t* fillVal;
|
||||||
int64_t* fillVal;
|
uint32_t status; // query status
|
||||||
uint32_t status; // query status
|
SResultRec rec;
|
||||||
SResultRec rec;
|
int32_t pos;
|
||||||
int32_t pos;
|
tFilePage** sdata;
|
||||||
tFilePage** sdata;
|
STableQueryInfo* current;
|
||||||
STableQueryInfo* current;
|
|
||||||
SSingleColumnFilterInfo* pFilterInfo;
|
SSingleColumnFilterInfo* pFilterInfo;
|
||||||
} SQuery;
|
} SQuery;
|
||||||
|
|
||||||
typedef struct SQueryRuntimeEnv {
|
typedef struct SQueryRuntimeEnv {
|
||||||
SResultInfo* resultInfo; // todo refactor to merge with SWindowResInfo
|
SResultInfo* resultInfo; // todo refactor to merge with SWindowResInfo
|
||||||
SQuery* pQuery;
|
SQuery* pQuery;
|
||||||
SQLFunctionCtx* pCtx;
|
SQLFunctionCtx* pCtx;
|
||||||
int16_t numOfRowsPerPage;
|
int16_t numOfRowsPerPage;
|
||||||
int16_t offset[TSDB_MAX_COLUMNS];
|
int16_t offset[TSDB_MAX_COLUMNS];
|
||||||
uint16_t scanFlag; // denotes reversed scan of data or not
|
uint16_t scanFlag; // denotes reversed scan of data or not
|
||||||
SFillInfo* pFillInfo;
|
SFillInfo* pFillInfo;
|
||||||
SWindowResInfo windowResInfo;
|
SWindowResInfo windowResInfo;
|
||||||
STSBuf* pTSBuf;
|
STSBuf* pTSBuf;
|
||||||
STSCursor cur;
|
STSCursor cur;
|
||||||
SQueryCostSummary summary;
|
SQueryCostInfo summary;
|
||||||
bool stableQuery; // super table query or not
|
bool stableQuery; // super table query or not
|
||||||
void* pQueryHandle;
|
void* pQueryHandle;
|
||||||
void* pSecQueryHandle; // another thread for
|
void* pSecQueryHandle; // another thread for
|
||||||
SDiskbasedResultBuf* pResultBuf; // query result buffer based on blocked-wised disk file
|
SDiskbasedResultBuf* pResultBuf; // query result buffer based on blocked-wised disk file
|
||||||
} SQueryRuntimeEnv;
|
} SQueryRuntimeEnv;
|
||||||
|
|
||||||
typedef struct SQInfo {
|
typedef struct SQInfo {
|
||||||
void* signature;
|
void* signature;
|
||||||
TSKEY startTime;
|
TSKEY startTime;
|
||||||
TSKEY elapsedTime;
|
TSKEY elapsedTime;
|
||||||
int32_t pointsInterpo;
|
int32_t pointsInterpo;
|
||||||
int32_t code; // error code to returned to client
|
int32_t code; // error code to returned to client
|
||||||
sem_t dataReady;
|
sem_t dataReady;
|
||||||
void* tsdb;
|
void* tsdb;
|
||||||
int32_t vgId;
|
int32_t vgId;
|
||||||
|
|
||||||
STableGroupInfo tableIdGroupInfo; // table id list < only includes the STableId list>
|
STableGroupInfo tableIdGroupInfo; // table id list < only includes the STableId list>
|
||||||
STableGroupInfo groupInfo; //
|
STableGroupInfo groupInfo; //
|
||||||
SQueryRuntimeEnv runtimeEnv;
|
SQueryRuntimeEnv runtimeEnv;
|
||||||
int32_t groupIndex;
|
int32_t groupIndex;
|
||||||
int32_t offset; // offset in group result set of subgroup, todo refactor
|
int32_t offset; // offset in group result set of subgroup, todo refactor
|
||||||
SArray* arrTableIdInfo;
|
SArray* arrTableIdInfo;
|
||||||
|
|
||||||
T_REF_DECLARE()
|
T_REF_DECLARE()
|
||||||
/*
|
/*
|
||||||
* the query is executed position on which meter of the whole list.
|
* the query is executed position on which meter of the whole list.
|
||||||
|
@ -189,8 +199,8 @@ typedef struct SQInfo {
|
||||||
* We later may refactor to remove this attribution by using another flag to denote
|
* We later may refactor to remove this attribution by using another flag to denote
|
||||||
* whether a multimeter query is completed or not.
|
* whether a multimeter query is completed or not.
|
||||||
*/
|
*/
|
||||||
int32_t tableIndex;
|
int32_t tableIndex;
|
||||||
int32_t numOfGroupResultPages;
|
int32_t numOfGroupResultPages;
|
||||||
} SQInfo;
|
} SQInfo;
|
||||||
|
|
||||||
#endif // TDENGINE_QUERYEXECUTOR_H
|
#endif // TDENGINE_QUERYEXECUTOR_H
|
||||||
|
|
|
@ -28,8 +28,7 @@ extern "C" {
|
||||||
#include "tdataformat.h"
|
#include "tdataformat.h"
|
||||||
#include "talgo.h"
|
#include "talgo.h"
|
||||||
|
|
||||||
#define DEFAULT_PAGE_SIZE 16384 // 16k larger than the SHistoInfo
|
#define DEFAULT_PAGE_SIZE (1024L*56) // 16k larger than the SHistoInfo
|
||||||
#define MIN_BUFFER_SIZE (1 << 19)
|
|
||||||
#define MAX_TMPFILE_PATH_LENGTH PATH_MAX
|
#define MAX_TMPFILE_PATH_LENGTH PATH_MAX
|
||||||
#define INITIAL_ALLOCATION_BUFFER_SIZE 64
|
#define INITIAL_ALLOCATION_BUFFER_SIZE 64
|
||||||
|
|
||||||
|
|
|
@ -45,12 +45,13 @@ typedef struct SFillInfo {
|
||||||
int32_t numOfCols; // number of columns, including the tags columns
|
int32_t numOfCols; // number of columns, including the tags columns
|
||||||
int32_t rowSize; // size of each row
|
int32_t rowSize; // size of each row
|
||||||
char ** pTags; // tags value for current interpolation
|
char ** pTags; // tags value for current interpolation
|
||||||
|
int64_t slidingTime; // sliding value to determine the number of result for a given time window
|
||||||
int64_t slidingTime; // sliding value to determine the number of result for a given time window
|
|
||||||
char * prevValues; // previous row of data, to generate the interpolation results
|
char * prevValues; // previous row of data, to generate the interpolation results
|
||||||
char * nextValues; // next row of data
|
char * nextValues; // next row of data
|
||||||
|
char** pData; // original result data block involved in filling data
|
||||||
|
int32_t capacityInRows; // data buffer size in rows
|
||||||
|
|
||||||
SFillColInfo* pFillCol; // column info for fill operations
|
SFillColInfo* pFillCol; // column info for fill operations
|
||||||
char** pData; // original result data block involved in filling data
|
|
||||||
} SFillInfo;
|
} SFillInfo;
|
||||||
|
|
||||||
typedef struct SPoint {
|
typedef struct SPoint {
|
||||||
|
|
|
@ -44,6 +44,8 @@ typedef struct SDiskbasedResultBuf {
|
||||||
SIDList* list; // for each id, there is a page id list
|
SIDList* list; // for each id, there is a page id list
|
||||||
} SDiskbasedResultBuf;
|
} SDiskbasedResultBuf;
|
||||||
|
|
||||||
|
#define DEFAULT_INTERN_BUF_PAGE_SIZE (8192L*5)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create disk-based result buffer
|
* create disk-based result buffer
|
||||||
* @param pResultBuf
|
* @param pResultBuf
|
||||||
|
|
|
@ -161,26 +161,24 @@ typedef struct SExtTagsInfo {
|
||||||
|
|
||||||
// sql function runtime context
|
// sql function runtime context
|
||||||
typedef struct SQLFunctionCtx {
|
typedef struct SQLFunctionCtx {
|
||||||
int32_t startOffset;
|
int32_t startOffset;
|
||||||
int32_t size; // number of rows
|
int32_t size; // number of rows
|
||||||
uint32_t order; // asc|desc
|
uint32_t order; // asc|desc
|
||||||
uint32_t scanFlag; // TODO merge with currentStage
|
int16_t inputType;
|
||||||
|
int16_t inputBytes;
|
||||||
int16_t inputType;
|
|
||||||
int16_t inputBytes;
|
int16_t outputType;
|
||||||
|
int16_t outputBytes; // size of results, determined by function and input column data type
|
||||||
int16_t outputType;
|
bool hasNull; // null value exist in current block
|
||||||
int16_t outputBytes; // size of results, determined by function and input column data type
|
int16_t functionId; // function id
|
||||||
bool hasNull; // null value exist in current block
|
void * aInputElemBuf;
|
||||||
int16_t functionId; // function id
|
char * aOutputBuf; // final result output buffer, point to sdata->data
|
||||||
void * aInputElemBuf;
|
uint8_t currentStage; // record current running step, default: 0
|
||||||
char * aOutputBuf; // final result output buffer, point to sdata->data
|
int64_t nStartQueryTimestamp; // timestamp range of current query when function is executed on a specific data block
|
||||||
uint8_t currentStage; // record current running step, default: 0
|
int32_t numOfParams;
|
||||||
int64_t nStartQueryTimestamp; // timestamp range of current query when function is executed on a specific data block
|
tVariant param[4]; // input parameter, e.g., top(k, 20), the number of results for top query is kept in param */
|
||||||
int32_t numOfParams;
|
int64_t * ptsList; // corresponding timestamp array list
|
||||||
tVariant param[4]; // input parameter, e.g., top(k, 20), the number of results for top query is kept in param */
|
void * ptsOutputBuf; // corresponding output buffer for timestamp of each result, e.g., top/bottom*/
|
||||||
int64_t *ptsList; // corresponding timestamp array list
|
|
||||||
void * ptsOutputBuf; // corresponding output buffer for timestamp of each result, e.g., top/bottom*/
|
|
||||||
SQLPreAggVal preAggVals;
|
SQLPreAggVal preAggVals;
|
||||||
tVariant tag;
|
tVariant tag;
|
||||||
SResultInfo *resultInfo;
|
SResultInfo *resultInfo;
|
||||||
|
@ -219,7 +217,7 @@ typedef struct SQLAggFuncElem {
|
||||||
#define GET_RES_INFO(ctx) ((ctx)->resultInfo)
|
#define GET_RES_INFO(ctx) ((ctx)->resultInfo)
|
||||||
|
|
||||||
int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionId, int32_t param, int16_t *type,
|
int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionId, int32_t param, int16_t *type,
|
||||||
int16_t *len, int16_t *interBytes, int16_t extLength, bool isSuperTable);
|
int16_t *len, int32_t *interBytes, int16_t extLength, bool isSuperTable);
|
||||||
|
|
||||||
#define IS_STREAM_QUERY_VALID(x) (((x)&TSDB_FUNCSTATE_STREAM) != 0)
|
#define IS_STREAM_QUERY_VALID(x) (((x)&TSDB_FUNCSTATE_STREAM) != 0)
|
||||||
#define IS_MULTIOUTPUT(x) (((x)&TSDB_FUNCSTATE_MO) != 0)
|
#define IS_MULTIOUTPUT(x) (((x)&TSDB_FUNCSTATE_MO) != 0)
|
||||||
|
@ -239,7 +237,7 @@ enum {
|
||||||
/* determine the real data need to calculated the result */
|
/* determine the real data need to calculated the result */
|
||||||
enum {
|
enum {
|
||||||
BLK_DATA_NO_NEEDED = 0x0,
|
BLK_DATA_NO_NEEDED = 0x0,
|
||||||
BLK_DATA_FILEDS_NEEDED = 0x1,
|
BLK_DATA_STATIS_NEEDED = 0x1,
|
||||||
BLK_DATA_ALL_NEEDED = 0x3,
|
BLK_DATA_ALL_NEEDED = 0x3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -269,9 +267,6 @@ extern struct SQLAggFuncElem aAggs[];
|
||||||
/* compatible check array list */
|
/* compatible check array list */
|
||||||
extern int32_t funcCompatDefList[];
|
extern int32_t funcCompatDefList[];
|
||||||
|
|
||||||
void getStatistics(char *priData, char *data, int32_t size, int32_t numOfRow, int32_t type, int64_t *min, int64_t *max,
|
|
||||||
int64_t *sum, int16_t *minIndex, int16_t *maxIndex, int32_t *numOfNull);
|
|
||||||
|
|
||||||
bool top_bot_datablock_filter(SQLFunctionCtx *pCtx, int32_t functionId, char *minval, char *maxval);
|
bool top_bot_datablock_filter(SQLFunctionCtx *pCtx, int32_t functionId, char *minval, char *maxval);
|
||||||
|
|
||||||
bool stableQueryFunctChanged(int32_t funcId);
|
bool stableQueryFunctChanged(int32_t funcId);
|
||||||
|
|
|
@ -48,7 +48,7 @@ void tVariantAssign(tVariant *pDst, const tVariant *pSrc);
|
||||||
|
|
||||||
int32_t tVariantToString(tVariant *pVar, char *dst);
|
int32_t tVariantToString(tVariant *pVar, char *dst);
|
||||||
|
|
||||||
int32_t tVariantDump(tVariant *pVariant, char *payload, char type);
|
int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool includeLengthPrefix);
|
||||||
|
|
||||||
int32_t tVariantTypeSetType(tVariant *pVariant, char type);
|
int32_t tVariantTypeSetType(tVariant *pVariant, char type);
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -209,7 +209,7 @@ bool like_str(SColumnFilterElem *pFilter, char *minval, char *maxval) {
|
||||||
bool like_nchar(SColumnFilterElem* pFilter, char* minval, char *maxval) {
|
bool like_nchar(SColumnFilterElem* pFilter, char* minval, char *maxval) {
|
||||||
SPatternCompareInfo info = PATTERN_COMPARE_INFO_INITIALIZER;
|
SPatternCompareInfo info = PATTERN_COMPARE_INFO_INITIALIZER;
|
||||||
|
|
||||||
return WCSPatternMatch((wchar_t*) pFilter->filterInfo.pz, varDataVal(minval), varDataLen(minval)/TSDB_NCHAR_SIZE, &info) == TSDB_PATTERN_MATCH;
|
return WCSPatternMatch((wchar_t*)pFilter->filterInfo.pz, varDataVal(minval), varDataLen(minval)/TSDB_NCHAR_SIZE, &info) == TSDB_PATTERN_MATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -137,11 +137,10 @@ void clearFirstNTimeWindow(SQueryRuntimeEnv *pRuntimeEnv, int32_t num) {
|
||||||
for (int32_t k = 0; k < pWindowResInfo->size; ++k) {
|
for (int32_t k = 0; k < pWindowResInfo->size; ++k) {
|
||||||
SWindowResult *pResult = &pWindowResInfo->pResult[k];
|
SWindowResult *pResult = &pWindowResInfo->pResult[k];
|
||||||
int32_t *p = (int32_t *)taosHashGet(pWindowResInfo->hashList, (const char *)&pResult->window.skey, TSDB_KEYSIZE);
|
int32_t *p = (int32_t *)taosHashGet(pWindowResInfo->hashList, (const char *)&pResult->window.skey, TSDB_KEYSIZE);
|
||||||
|
|
||||||
int32_t v = (*p - num);
|
int32_t v = (*p - num);
|
||||||
assert(v >= 0 && v <= pWindowResInfo->size);
|
assert(v >= 0 && v <= pWindowResInfo->size);
|
||||||
|
taosHashPut(pWindowResInfo->hashList, (char *)&pResult->window.skey, TSDB_KEYSIZE, (char *)&v, sizeof(int32_t));
|
||||||
taosHashPut(pWindowResInfo->hashList, (const char *)&pResult->window.skey, TSDB_KEYSIZE, (char *)&v,
|
|
||||||
sizeof(int32_t));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pWindowResInfo->curIndex = -1;
|
pWindowResInfo->curIndex = -1;
|
||||||
|
|
|
@ -79,7 +79,7 @@ SFillInfo* taosInitFillInfo(int32_t order, TSKEY skey, int32_t numOfTags, int32_
|
||||||
int32_t rowsize = 0;
|
int32_t rowsize = 0;
|
||||||
for (int32_t i = 0; i < numOfCols; ++i) {
|
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||||
int32_t bytes = pFillInfo->pFillCol[i].col.bytes;
|
int32_t bytes = pFillInfo->pFillCol[i].col.bytes;
|
||||||
pFillInfo->pData[i] = calloc(1, sizeof(tFilePage) + bytes * capacity);
|
pFillInfo->pData[i] = calloc(1, bytes * capacity);
|
||||||
|
|
||||||
rowsize += bytes;
|
rowsize += bytes;
|
||||||
}
|
}
|
||||||
|
@ -89,6 +89,8 @@ SFillInfo* taosInitFillInfo(int32_t order, TSKEY skey, int32_t numOfTags, int32_
|
||||||
}
|
}
|
||||||
|
|
||||||
pFillInfo->rowSize = rowsize;
|
pFillInfo->rowSize = rowsize;
|
||||||
|
pFillInfo->capacityInRows = capacity;
|
||||||
|
|
||||||
return pFillInfo;
|
return pFillInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,6 +121,17 @@ void taosFillSetStartInfo(SFillInfo* pFillInfo, int32_t numOfRows, TSKEY endKey)
|
||||||
pFillInfo->rowIdx = 0;
|
pFillInfo->rowIdx = 0;
|
||||||
pFillInfo->endKey = endKey;
|
pFillInfo->endKey = endKey;
|
||||||
pFillInfo->numOfRows = numOfRows;
|
pFillInfo->numOfRows = numOfRows;
|
||||||
|
|
||||||
|
// ensure the space
|
||||||
|
if (pFillInfo->capacityInRows < numOfRows) {
|
||||||
|
for(int32_t i = 0; i < pFillInfo->numOfCols; ++i) {
|
||||||
|
char* tmp = realloc(pFillInfo->pData[i], numOfRows*pFillInfo->pFillCol[i].col.bytes);
|
||||||
|
assert(tmp != NULL); // todo handle error
|
||||||
|
|
||||||
|
memset(tmp, 0, numOfRows*pFillInfo->pFillCol[i].col.bytes);
|
||||||
|
pFillInfo->pData[i] = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void taosFillCopyInputDataFromFilePage(SFillInfo* pFillInfo, tFilePage** pInput) {
|
void taosFillCopyInputDataFromFilePage(SFillInfo* pFillInfo, tFilePage** pInput) {
|
||||||
|
@ -474,11 +487,11 @@ int32_t generateDataBlockImpl(SFillInfo* pFillInfo, tFilePage** data, int32_t nu
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t taosGenerateDataBlock(SFillInfo* pFillInfo, tFilePage** output, int32_t capacity) {
|
int64_t taosGenerateDataBlock(SFillInfo* pFillInfo, tFilePage** output, int32_t capacity) {
|
||||||
int32_t remain = taosNumOfRemainRows(pFillInfo); // todo use iterator?
|
int32_t remain = taosNumOfRemainRows(pFillInfo); // todo use iterator?
|
||||||
int32_t rows = taosGetNumOfResultWithFill(pFillInfo, remain, pFillInfo->endKey, capacity);
|
int32_t rows = taosGetNumOfResultWithFill(pFillInfo, remain, pFillInfo->endKey, capacity);
|
||||||
|
|
||||||
|
int32_t numOfRes = generateDataBlockImpl(pFillInfo, output, remain, rows, pFillInfo->pData);
|
||||||
|
assert(numOfRes == rows);
|
||||||
|
|
||||||
int32_t numOfRes = generateDataBlockImpl(pFillInfo, output, remain, rows, pFillInfo->pData);
|
return numOfRes;
|
||||||
assert(numOfRes == rows);
|
|
||||||
|
|
||||||
return numOfRes;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,14 +5,12 @@
|
||||||
#include "tsqlfunction.h"
|
#include "tsqlfunction.h"
|
||||||
#include "queryLog.h"
|
#include "queryLog.h"
|
||||||
|
|
||||||
#define DEFAULT_INTERN_BUF_SIZE 16384L
|
|
||||||
|
|
||||||
int32_t createDiskbasedResultBuffer(SDiskbasedResultBuf** pResultBuf, int32_t size, int32_t rowSize, void* handle) {
|
int32_t createDiskbasedResultBuffer(SDiskbasedResultBuf** pResultBuf, int32_t size, int32_t rowSize, void* handle) {
|
||||||
SDiskbasedResultBuf* pResBuf = calloc(1, sizeof(SDiskbasedResultBuf));
|
SDiskbasedResultBuf* pResBuf = calloc(1, sizeof(SDiskbasedResultBuf));
|
||||||
pResBuf->numOfRowsPerPage = (DEFAULT_INTERN_BUF_SIZE - sizeof(tFilePage)) / rowSize;
|
pResBuf->numOfRowsPerPage = (DEFAULT_INTERN_BUF_PAGE_SIZE - sizeof(tFilePage)) / rowSize;
|
||||||
pResBuf->numOfPages = size;
|
pResBuf->numOfPages = size;
|
||||||
|
|
||||||
pResBuf->totalBufSize = pResBuf->numOfPages * DEFAULT_INTERN_BUF_SIZE;
|
pResBuf->totalBufSize = pResBuf->numOfPages * DEFAULT_INTERN_BUF_PAGE_SIZE;
|
||||||
pResBuf->incStep = 4;
|
pResBuf->incStep = 4;
|
||||||
|
|
||||||
// init id hash table
|
// init id hash table
|
||||||
|
@ -33,7 +31,7 @@ int32_t createDiskbasedResultBuffer(SDiskbasedResultBuf** pResultBuf, int32_t si
|
||||||
return TSDB_CODE_CLI_NO_DISKSPACE;
|
return TSDB_CODE_CLI_NO_DISKSPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ret = ftruncate(pResBuf->fd, pResBuf->numOfPages * DEFAULT_INTERN_BUF_SIZE);
|
int32_t ret = ftruncate(pResBuf->fd, pResBuf->numOfPages * DEFAULT_INTERN_BUF_PAGE_SIZE);
|
||||||
if (ret != TSDB_CODE_SUCCESS) {
|
if (ret != TSDB_CODE_SUCCESS) {
|
||||||
qError("failed to create tmp file: %s on disk. %s", pResBuf->path, strerror(errno));
|
qError("failed to create tmp file: %s on disk. %s", pResBuf->path, strerror(errno));
|
||||||
return TSDB_CODE_CLI_NO_DISKSPACE;
|
return TSDB_CODE_CLI_NO_DISKSPACE;
|
||||||
|
@ -55,7 +53,7 @@ int32_t createDiskbasedResultBuffer(SDiskbasedResultBuf** pResultBuf, int32_t si
|
||||||
tFilePage* getResultBufferPageById(SDiskbasedResultBuf* pResultBuf, int32_t id) {
|
tFilePage* getResultBufferPageById(SDiskbasedResultBuf* pResultBuf, int32_t id) {
|
||||||
assert(id < pResultBuf->numOfPages && id >= 0);
|
assert(id < pResultBuf->numOfPages && id >= 0);
|
||||||
|
|
||||||
return (tFilePage*)(pResultBuf->pBuf + DEFAULT_INTERN_BUF_SIZE * id);
|
return (tFilePage*)(pResultBuf->pBuf + DEFAULT_INTERN_BUF_PAGE_SIZE * id);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t getNumOfResultBufGroupId(SDiskbasedResultBuf* pResultBuf) { return taosHashGetSize(pResultBuf->idsTable); }
|
int32_t getNumOfResultBufGroupId(SDiskbasedResultBuf* pResultBuf) { return taosHashGetSize(pResultBuf->idsTable); }
|
||||||
|
@ -63,7 +61,7 @@ int32_t getNumOfResultBufGroupId(SDiskbasedResultBuf* pResultBuf) { return taosH
|
||||||
int32_t getResBufSize(SDiskbasedResultBuf* pResultBuf) { return pResultBuf->totalBufSize; }
|
int32_t getResBufSize(SDiskbasedResultBuf* pResultBuf) { return pResultBuf->totalBufSize; }
|
||||||
|
|
||||||
static int32_t extendDiskFileSize(SDiskbasedResultBuf* pResultBuf, int32_t numOfPages) {
|
static int32_t extendDiskFileSize(SDiskbasedResultBuf* pResultBuf, int32_t numOfPages) {
|
||||||
assert(pResultBuf->numOfPages * DEFAULT_INTERN_BUF_SIZE == pResultBuf->totalBufSize);
|
assert(pResultBuf->numOfPages * DEFAULT_INTERN_BUF_PAGE_SIZE == pResultBuf->totalBufSize);
|
||||||
|
|
||||||
int32_t ret = munmap(pResultBuf->pBuf, pResultBuf->totalBufSize);
|
int32_t ret = munmap(pResultBuf->pBuf, pResultBuf->totalBufSize);
|
||||||
pResultBuf->numOfPages += numOfPages;
|
pResultBuf->numOfPages += numOfPages;
|
||||||
|
@ -72,14 +70,14 @@ static int32_t extendDiskFileSize(SDiskbasedResultBuf* pResultBuf, int32_t numOf
|
||||||
* disk-based output buffer is exhausted, try to extend the disk-based buffer, the available disk space may
|
* disk-based output buffer is exhausted, try to extend the disk-based buffer, the available disk space may
|
||||||
* be insufficient
|
* be insufficient
|
||||||
*/
|
*/
|
||||||
ret = ftruncate(pResultBuf->fd, pResultBuf->numOfPages * DEFAULT_INTERN_BUF_SIZE);
|
ret = ftruncate(pResultBuf->fd, pResultBuf->numOfPages * DEFAULT_INTERN_BUF_PAGE_SIZE);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
// dError("QInfo:%p failed to create intermediate result output file:%s. %s", pQInfo, pSupporter->extBufFile,
|
// dError("QInfo:%p failed to create intermediate result output file:%s. %s", pQInfo, pSupporter->extBufFile,
|
||||||
// strerror(errno));
|
// strerror(errno));
|
||||||
return -TSDB_CODE_SERV_NO_DISKSPACE;
|
return -TSDB_CODE_SERV_NO_DISKSPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
pResultBuf->totalBufSize = pResultBuf->numOfPages * DEFAULT_INTERN_BUF_SIZE;
|
pResultBuf->totalBufSize = pResultBuf->numOfPages * DEFAULT_INTERN_BUF_PAGE_SIZE;
|
||||||
pResultBuf->pBuf = mmap(NULL, pResultBuf->totalBufSize, PROT_READ | PROT_WRITE, MAP_SHARED, pResultBuf->fd, 0);
|
pResultBuf->pBuf = mmap(NULL, pResultBuf->totalBufSize, PROT_READ | PROT_WRITE, MAP_SHARED, pResultBuf->fd, 0);
|
||||||
|
|
||||||
if (pResultBuf->pBuf == MAP_FAILED) {
|
if (pResultBuf->pBuf == MAP_FAILED) {
|
||||||
|
@ -174,7 +172,7 @@ tFilePage* getNewDataBuf(SDiskbasedResultBuf* pResultBuf, int32_t groupId, int32
|
||||||
tFilePage* page = getResultBufferPageById(pResultBuf, *pageId);
|
tFilePage* page = getResultBufferPageById(pResultBuf, *pageId);
|
||||||
|
|
||||||
// clear memory for the new page
|
// clear memory for the new page
|
||||||
memset(page, 0, DEFAULT_INTERN_BUF_SIZE);
|
memset(page, 0, DEFAULT_INTERN_BUF_PAGE_SIZE);
|
||||||
|
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
|
@ -363,8 +363,6 @@ static int32_t toBinary(tVariant *pVariant, char **pDest, int32_t *pDestSize) {
|
||||||
|
|
||||||
taosUcs4ToMbs(pVariant->wpz, newSize, pBuf);
|
taosUcs4ToMbs(pVariant->wpz, newSize, pBuf);
|
||||||
free(pVariant->wpz);
|
free(pVariant->wpz);
|
||||||
|
|
||||||
/* terminated string */
|
|
||||||
pBuf[newSize] = 0;
|
pBuf[newSize] = 0;
|
||||||
} else {
|
} else {
|
||||||
taosUcs4ToMbs(pVariant->wpz, newSize, *pDest);
|
taosUcs4ToMbs(pVariant->wpz, newSize, *pDest);
|
||||||
|
@ -598,7 +596,7 @@ static int32_t convertToBool(tVariant *pVariant, int64_t *pDest) {
|
||||||
*
|
*
|
||||||
* todo handle the return value
|
* todo handle the return value
|
||||||
*/
|
*/
|
||||||
int32_t tVariantDump(tVariant *pVariant, char *payload, char type) {
|
int32_t tVariantDump(tVariant *pVariant, char *payload, int16_t type, bool includeLengthPrefix) {
|
||||||
if (pVariant == NULL || (pVariant->nType != 0 && !isValidDataType(pVariant->nType, pVariant->nLen))) {
|
if (pVariant == NULL || (pVariant->nType != 0 && !isValidDataType(pVariant->nType, pVariant->nLen))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -765,13 +763,30 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, char type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case TSDB_DATA_TYPE_BINARY: {
|
case TSDB_DATA_TYPE_BINARY: {
|
||||||
if (pVariant->nType == TSDB_DATA_TYPE_NULL) {
|
if (!includeLengthPrefix) {
|
||||||
*payload = TSDB_DATA_BINARY_NULL;
|
if (pVariant->nType == TSDB_DATA_TYPE_NULL) {
|
||||||
} else {
|
*(uint8_t*) payload = TSDB_DATA_BINARY_NULL;
|
||||||
if (pVariant->nType != TSDB_DATA_TYPE_BINARY) {
|
|
||||||
toBinary(pVariant, &payload, &pVariant->nLen);
|
|
||||||
} else {
|
} else {
|
||||||
strncpy(payload, pVariant->pz, pVariant->nLen);
|
if (pVariant->nType != TSDB_DATA_TYPE_BINARY) {
|
||||||
|
toBinary(pVariant, &payload, &pVariant->nLen);
|
||||||
|
} else {
|
||||||
|
strncpy(payload, pVariant->pz, pVariant->nLen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (pVariant->nType == TSDB_DATA_TYPE_NULL) {
|
||||||
|
setVardataNull(payload, TSDB_DATA_TYPE_BINARY);
|
||||||
|
} else {
|
||||||
|
char *p = varDataVal(payload);
|
||||||
|
|
||||||
|
if (pVariant->nType != TSDB_DATA_TYPE_BINARY) {
|
||||||
|
toBinary(pVariant, &p, &pVariant->nLen);
|
||||||
|
} else {
|
||||||
|
strncpy(p, pVariant->pz, pVariant->nLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
varDataSetLen(payload, pVariant->nLen);
|
||||||
|
assert(p == varDataVal(payload));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -785,15 +800,33 @@ int32_t tVariantDump(tVariant *pVariant, char *payload, char type) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TSDB_DATA_TYPE_NCHAR: {
|
case TSDB_DATA_TYPE_NCHAR: {
|
||||||
if (pVariant->nType == TSDB_DATA_TYPE_NULL) {
|
if (!includeLengthPrefix) {
|
||||||
*(uint32_t *) payload = TSDB_DATA_NCHAR_NULL;
|
if (pVariant->nType == TSDB_DATA_TYPE_NULL) {
|
||||||
} else {
|
*(uint32_t *)payload = TSDB_DATA_NCHAR_NULL;
|
||||||
if (pVariant->nType != TSDB_DATA_TYPE_NCHAR) {
|
|
||||||
toNchar(pVariant, &payload, &pVariant->nLen);
|
|
||||||
} else {
|
} else {
|
||||||
wcsncpy((wchar_t *)payload, pVariant->wpz, pVariant->nLen);
|
if (pVariant->nType != TSDB_DATA_TYPE_NCHAR) {
|
||||||
|
toNchar(pVariant, &payload, &pVariant->nLen);
|
||||||
|
} else {
|
||||||
|
wcsncpy((wchar_t *)payload, pVariant->wpz, pVariant->nLen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (pVariant->nType == TSDB_DATA_TYPE_NULL) {
|
||||||
|
setVardataNull(payload, TSDB_DATA_TYPE_NCHAR);
|
||||||
|
} else {
|
||||||
|
char *p = varDataVal(payload);
|
||||||
|
|
||||||
|
if (pVariant->nType != TSDB_DATA_TYPE_NCHAR) {
|
||||||
|
toNchar(pVariant, &p, &pVariant->nLen);
|
||||||
|
} else {
|
||||||
|
wcsncpy((wchar_t *)p, pVariant->wpz, pVariant->nLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
varDataSetLen(payload, pVariant->nLen); // the length may be changed after toNchar function called
|
||||||
|
assert(p == varDataVal(payload));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,8 +124,7 @@ typedef struct SRpcConn {
|
||||||
} SRpcConn;
|
} SRpcConn;
|
||||||
|
|
||||||
int tsRpcMaxUdpSize = 15000; // bytes
|
int tsRpcMaxUdpSize = 15000; // bytes
|
||||||
int tsRpcProgressTime = 10; // milliseocnds
|
int tsProgressTimer = 100;
|
||||||
|
|
||||||
// not configurable
|
// not configurable
|
||||||
int tsRpcMaxRetry;
|
int tsRpcMaxRetry;
|
||||||
int tsRpcHeadSize;
|
int tsRpcHeadSize;
|
||||||
|
@ -204,7 +203,8 @@ static void rpcUnlockConn(SRpcConn *pConn);
|
||||||
void *rpcOpen(const SRpcInit *pInit) {
|
void *rpcOpen(const SRpcInit *pInit) {
|
||||||
SRpcInfo *pRpc;
|
SRpcInfo *pRpc;
|
||||||
|
|
||||||
tsRpcMaxRetry = tsRpcMaxTime * 1000 / tsRpcProgressTime;
|
tsProgressTimer = tsRpcTimer/2;
|
||||||
|
tsRpcMaxRetry = tsRpcMaxTime * 1000/tsProgressTimer;
|
||||||
tsRpcHeadSize = RPC_MSG_OVERHEAD;
|
tsRpcHeadSize = RPC_MSG_OVERHEAD;
|
||||||
tsRpcOverhead = sizeof(SRpcReqContext);
|
tsRpcOverhead = sizeof(SRpcReqContext);
|
||||||
|
|
||||||
|
@ -420,8 +420,11 @@ void rpcSendResponse(const SRpcMsg *pRsp) {
|
||||||
pConn->rspMsgLen = msgLen;
|
pConn->rspMsgLen = msgLen;
|
||||||
if (pMsg->code == TSDB_CODE_ACTION_IN_PROGRESS) pConn->inTranId--;
|
if (pMsg->code == TSDB_CODE_ACTION_IN_PROGRESS) pConn->inTranId--;
|
||||||
|
|
||||||
|
SRpcInfo *pRpc = pConn->pRpc;
|
||||||
taosTmrStopA(&pConn->pTimer);
|
taosTmrStopA(&pConn->pTimer);
|
||||||
// taosTmrReset(rpcProcessIdleTimer, pRpc->idleTime, pConn, pRpc->tmrCtrl, &pConn->pIdleTimer);
|
|
||||||
|
// set the idle timer to monitor the activity
|
||||||
|
taosTmrReset(rpcProcessIdleTimer, pRpc->idleTime, pConn, pRpc->tmrCtrl, &pConn->pIdleTimer);
|
||||||
rpcSendMsgToPeer(pConn, msg, msgLen);
|
rpcSendMsgToPeer(pConn, msg, msgLen);
|
||||||
pConn->secured = 1; // connection shall be secured
|
pConn->secured = 1; // connection shall be secured
|
||||||
|
|
||||||
|
@ -683,6 +686,7 @@ static SRpcConn *rpcSetupConnToServer(SRpcReqContext *pContext) {
|
||||||
tError("%s %p, failed to set up connection(%s)", pRpc->label, pContext->ahandle, tstrerror(terrno));
|
tError("%s %p, failed to set up connection(%s)", pRpc->label, pContext->ahandle, tstrerror(terrno));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pConn->tretry = 0;
|
||||||
return pConn;
|
return pConn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -748,20 +752,28 @@ static int rpcProcessRspHead(SRpcConn *pConn, SRpcHead *pHead) {
|
||||||
taosTmrStopA(&pConn->pTimer);
|
taosTmrStopA(&pConn->pTimer);
|
||||||
pConn->retry = 0;
|
pConn->retry = 0;
|
||||||
|
|
||||||
|
if (pHead->code == TSDB_CODE_AUTH_REQUIRED && pRpc->spi) {
|
||||||
|
tTrace("%s, authentication shall be restarted", pConn->info);
|
||||||
|
pConn->secured = 0;
|
||||||
|
rpcSendMsgToPeer(pConn, pConn->pReqMsg, pConn->reqMsgLen);
|
||||||
|
pConn->pTimer = taosTmrStart(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl);
|
||||||
|
return TSDB_CODE_ALREADY_PROCESSED;
|
||||||
|
}
|
||||||
|
|
||||||
if (pHead->code == TSDB_CODE_ACTION_IN_PROGRESS) {
|
if (pHead->code == TSDB_CODE_ACTION_IN_PROGRESS) {
|
||||||
if (pConn->tretry <= tsRpcMaxRetry) {
|
if (pConn->tretry <= tsRpcMaxRetry) {
|
||||||
tTrace("%s, peer is still processing the transaction", pConn->info);
|
tTrace("%s, peer is still processing the transaction, retry:%d", pConn->info, pConn->tretry);
|
||||||
pConn->tretry++;
|
pConn->tretry++;
|
||||||
rpcSendReqHead(pConn);
|
rpcSendReqHead(pConn);
|
||||||
taosTmrReset(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl, &pConn->pTimer);
|
pConn->pTimer = taosTmrStart(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl);
|
||||||
return TSDB_CODE_ALREADY_PROCESSED;
|
return TSDB_CODE_ALREADY_PROCESSED;
|
||||||
} else {
|
} else {
|
||||||
// peer still in processing, give up
|
// peer still in processing, give up
|
||||||
return TSDB_CODE_TOO_SLOW;
|
tTrace("%s, server processing takes too long time, give up", pConn->info);
|
||||||
|
pHead->code = TSDB_CODE_TOO_SLOW;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pConn->tretry = 0;
|
|
||||||
pConn->outType = 0;
|
pConn->outType = 0;
|
||||||
pConn->pReqMsg = NULL;
|
pConn->pReqMsg = NULL;
|
||||||
pConn->reqMsgLen = 0;
|
pConn->reqMsgLen = 0;
|
||||||
|
@ -820,7 +832,9 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv) {
|
||||||
if ( rpcIsReq(pHead->msgType) ) {
|
if ( rpcIsReq(pHead->msgType) ) {
|
||||||
terrno = rpcProcessReqHead(pConn, pHead);
|
terrno = rpcProcessReqHead(pConn, pHead);
|
||||||
pConn->connType = pRecv->connType;
|
pConn->connType = pRecv->connType;
|
||||||
taosTmrReset(rpcProcessIdleTimer, pRpc->idleTime, pConn, pRpc->tmrCtrl, &pConn->pIdleTimer);
|
|
||||||
|
// client shall send the request within tsRpcTime again, put 20 mseconds tolerance
|
||||||
|
taosTmrReset(rpcProcessIdleTimer, tsRpcTimer+20, pConn, pRpc->tmrCtrl, &pConn->pIdleTimer);
|
||||||
} else {
|
} else {
|
||||||
terrno = rpcProcessRspHead(pConn, pHead);
|
terrno = rpcProcessRspHead(pConn, pHead);
|
||||||
}
|
}
|
||||||
|
@ -935,7 +949,7 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
|
||||||
|
|
||||||
if ( rpcIsReq(pHead->msgType) ) {
|
if ( rpcIsReq(pHead->msgType) ) {
|
||||||
rpcMsg.handle = pConn;
|
rpcMsg.handle = pConn;
|
||||||
taosTmrReset(rpcProcessProgressTimer, tsRpcTimer/2, pConn, pRpc->tmrCtrl, &pConn->pTimer);
|
pConn->pTimer = taosTmrStart(rpcProcessProgressTimer, tsProgressTimer, pConn, pRpc->tmrCtrl);
|
||||||
(*(pRpc->cfp))(&rpcMsg, NULL);
|
(*(pRpc->cfp))(&rpcMsg, NULL);
|
||||||
} else {
|
} else {
|
||||||
// it's a response
|
// it's a response
|
||||||
|
@ -943,14 +957,12 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead) {
|
||||||
rpcMsg.handle = pContext->ahandle;
|
rpcMsg.handle = pContext->ahandle;
|
||||||
pConn->pContext = NULL;
|
pConn->pContext = NULL;
|
||||||
|
|
||||||
if (pHead->code == TSDB_CODE_AUTH_REQUIRED) {
|
|
||||||
pConn->secured = 0;
|
|
||||||
rpcSendReqToServer(pRpc, pContext);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// for UDP, port may be changed by server, the port in ipSet shall be used for cache
|
// for UDP, port may be changed by server, the port in ipSet shall be used for cache
|
||||||
rpcAddConnIntoCache(pRpc->pCache, pConn, pConn->peerFqdn, pContext->ipSet.port[pContext->ipSet.inUse], pConn->connType);
|
if (pHead->code != TSDB_CODE_TOO_SLOW) {
|
||||||
|
rpcAddConnIntoCache(pRpc->pCache, pConn, pConn->peerFqdn, pContext->ipSet.port[pContext->ipSet.inUse], pConn->connType);
|
||||||
|
} else {
|
||||||
|
rpcCloseConn(pConn);
|
||||||
|
}
|
||||||
|
|
||||||
if (pHead->code == TSDB_CODE_REDIRECT) {
|
if (pHead->code == TSDB_CODE_REDIRECT) {
|
||||||
pContext->redirect++;
|
pContext->redirect++;
|
||||||
|
@ -1039,6 +1051,7 @@ static void rpcSendErrorMsgToPeer(SRecvInfo *pRecv, int32_t code) {
|
||||||
pReplyHead->sourceId = pRecvHead->destId;
|
pReplyHead->sourceId = pRecvHead->destId;
|
||||||
pReplyHead->destId = pRecvHead->sourceId;
|
pReplyHead->destId = pRecvHead->sourceId;
|
||||||
pReplyHead->linkUid = pRecvHead->linkUid;
|
pReplyHead->linkUid = pRecvHead->linkUid;
|
||||||
|
pReplyHead->ahandle = pRecvHead->ahandle;
|
||||||
|
|
||||||
pReplyHead->code = htonl(code);
|
pReplyHead->code = htonl(code);
|
||||||
msgLen = sizeof(SRpcHead);
|
msgLen = sizeof(SRpcHead);
|
||||||
|
@ -1095,8 +1108,8 @@ static void rpcSendReqToServer(SRpcInfo *pRpc, SRpcReqContext *pContext) {
|
||||||
pConn->reqMsgLen = msgLen;
|
pConn->reqMsgLen = msgLen;
|
||||||
pConn->pContext = pContext;
|
pConn->pContext = pContext;
|
||||||
|
|
||||||
taosTmrReset(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl, &pConn->pTimer);
|
|
||||||
rpcSendMsgToPeer(pConn, msg, msgLen);
|
rpcSendMsgToPeer(pConn, msg, msgLen);
|
||||||
|
taosTmrReset(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl, &pConn->pTimer);
|
||||||
|
|
||||||
rpcUnlockConn(pConn);
|
rpcUnlockConn(pConn);
|
||||||
}
|
}
|
||||||
|
@ -1172,7 +1185,7 @@ static void rpcProcessRetryTimer(void *param, void *tmrId) {
|
||||||
if (pConn->retry < 4) {
|
if (pConn->retry < 4) {
|
||||||
tTrace("%s, re-send msg:%s to %s:%hu", pConn->info, taosMsg[pConn->outType], pConn->peerFqdn, pConn->peerPort);
|
tTrace("%s, re-send msg:%s to %s:%hu", pConn->info, taosMsg[pConn->outType], pConn->peerFqdn, pConn->peerPort);
|
||||||
rpcSendMsgToPeer(pConn, pConn->pReqMsg, pConn->reqMsgLen);
|
rpcSendMsgToPeer(pConn, pConn->pReqMsg, pConn->reqMsgLen);
|
||||||
taosTmrReset(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl, &pConn->pTimer);
|
pConn->pTimer = taosTmrStart(rpcProcessRetryTimer, tsRpcTimer, pConn, pRpc->tmrCtrl);
|
||||||
} else {
|
} else {
|
||||||
// close the connection
|
// close the connection
|
||||||
tTrace("%s, failed to send msg:%s to %s:%hu", pConn->info, taosMsg[pConn->outType], pConn->peerFqdn, pConn->peerPort);
|
tTrace("%s, failed to send msg:%s to %s:%hu", pConn->info, taosMsg[pConn->outType], pConn->peerFqdn, pConn->peerPort);
|
||||||
|
@ -1225,7 +1238,7 @@ static void rpcProcessProgressTimer(void *param, void *tmrId) {
|
||||||
if (pConn->inType && pConn->user[0]) {
|
if (pConn->inType && pConn->user[0]) {
|
||||||
tTrace("%s, progress timer expired, send progress", pConn->info);
|
tTrace("%s, progress timer expired, send progress", pConn->info);
|
||||||
rpcSendQuickRsp(pConn, TSDB_CODE_ACTION_IN_PROGRESS);
|
rpcSendQuickRsp(pConn, TSDB_CODE_ACTION_IN_PROGRESS);
|
||||||
taosTmrReset(rpcProcessProgressTimer, tsRpcTimer/2, pConn, pRpc->tmrCtrl, &pConn->pTimer);
|
pConn->pTimer = taosTmrStart(rpcProcessProgressTimer, tsProgressTimer, pConn, pRpc->tmrCtrl);
|
||||||
} else {
|
} else {
|
||||||
tTrace("%s, progress timer:%p not processed", pConn->info, tmrId);
|
tTrace("%s, progress timer:%p not processed", pConn->info, tmrId);
|
||||||
}
|
}
|
||||||
|
@ -1357,15 +1370,17 @@ static int rpcCheckAuthentication(SRpcConn *pConn, char *msg, int msgLen) {
|
||||||
if ((pConn->secured && pHead->spi == 0) || (pHead->spi == 0 && pConn->spi == 0)){
|
if ((pConn->secured && pHead->spi == 0) || (pHead->spi == 0 && pConn->spi == 0)){
|
||||||
// secured link, or no authentication
|
// secured link, or no authentication
|
||||||
pHead->msgLen = (int32_t)htonl((uint32_t)pHead->msgLen);
|
pHead->msgLen = (int32_t)htonl((uint32_t)pHead->msgLen);
|
||||||
|
// tTrace("%s, secured link, no auth is required", pConn->info);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !rpcIsReq(pHead->msgType) ) {
|
if ( !rpcIsReq(pHead->msgType) ) {
|
||||||
// for response, if code is auth failure, it shall bypass the auth process
|
// for response, if code is auth failure, it shall bypass the auth process
|
||||||
code = htonl(pHead->code);
|
code = htonl(pHead->code);
|
||||||
if (code==TSDB_CODE_INVALID_TIME_STAMP || code==TSDB_CODE_AUTH_FAILURE ||
|
if (code==TSDB_CODE_INVALID_TIME_STAMP || code==TSDB_CODE_AUTH_FAILURE || code == TSDB_CODE_AUTH_REQUIRED ||
|
||||||
code==TSDB_CODE_INVALID_USER || code == TSDB_CODE_NOT_READY) {
|
code==TSDB_CODE_INVALID_USER || code == TSDB_CODE_NOT_READY) {
|
||||||
pHead->msgLen = (int32_t)htonl((uint32_t)pHead->msgLen);
|
pHead->msgLen = (int32_t)htonl((uint32_t)pHead->msgLen);
|
||||||
|
// tTrace("%s, dont check authentication since code is:0x%x", pConn->info, code);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1388,12 +1403,12 @@ static int rpcCheckAuthentication(SRpcConn *pConn, char *msg, int msgLen) {
|
||||||
} else {
|
} else {
|
||||||
pHead->msgLen = (int32_t)htonl((uint32_t)pHead->msgLen) - sizeof(SRpcDigest);
|
pHead->msgLen = (int32_t)htonl((uint32_t)pHead->msgLen) - sizeof(SRpcDigest);
|
||||||
if ( !rpcIsReq(pHead->msgType) ) pConn->secured = 1; // link is secured for client
|
if ( !rpcIsReq(pHead->msgType) ) pConn->secured = 1; // link is secured for client
|
||||||
//tTrace("%s, message is authenticated", pConn->info);
|
// tTrace("%s, message is authenticated", pConn->info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tError("%s, auth spi:%d not matched with received:%d", pConn->info, pConn->spi, pHead->spi);
|
tError("%s, auth spi:%d not matched with received:%d", pConn->info, pConn->spi, pHead->spi);
|
||||||
code = TSDB_CODE_AUTH_FAILURE;
|
code = pHead->spi ? TSDB_CODE_AUTH_FAILURE : TSDB_CODE_AUTH_REQUIRED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
|
|
@ -288,7 +288,11 @@ int tsdbCopyBlockDataInFile(SFile *pOutFile, SFile *pInFile, SCompInfo *pCompInf
|
||||||
static int compFGroupKey(const void *key, const void *fgroup) {
|
static int compFGroupKey(const void *key, const void *fgroup) {
|
||||||
int fid = *(int *)key;
|
int fid = *(int *)key;
|
||||||
SFileGroup *pFGroup = (SFileGroup *)fgroup;
|
SFileGroup *pFGroup = (SFileGroup *)fgroup;
|
||||||
return (fid - pFGroup->fileId);
|
if (fid == pFGroup->fileId) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return fid > pFGroup->fileId? 1:-1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int compFGroup(const void *arg1, const void *arg2) {
|
static int compFGroup(const void *arg1, const void *arg2) {
|
||||||
|
|
|
@ -103,7 +103,8 @@ STable *tsdbDecodeTable(void *cont, int contLen) {
|
||||||
if (pTable->type == TSDB_STREAM_TABLE) {
|
if (pTable->type == TSDB_STREAM_TABLE) {
|
||||||
ptr = taosDecodeString(ptr, &(pTable->sql));
|
ptr = taosDecodeString(ptr, &(pTable->sql));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pTable->lastKey = TSKEY_INITIAL_VAL;
|
||||||
return pTable;
|
return pTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +119,7 @@ static char* getTagIndexKey(const void* pData) {
|
||||||
STSchema* pSchema = tsdbGetTableTagSchema(elem->pMeta, elem->pTable);
|
STSchema* pSchema = tsdbGetTableTagSchema(elem->pMeta, elem->pTable);
|
||||||
STColumn* pCol = &pSchema->columns[DEFAULT_TAG_INDEX_COLUMN];
|
STColumn* pCol = &pSchema->columns[DEFAULT_TAG_INDEX_COLUMN];
|
||||||
int16_t type = 0;
|
int16_t type = 0;
|
||||||
void * res = tdQueryTagByID(row, pCol->colId,&type);
|
void * res = tdQueryTagByID(row, pCol->colId, &type);
|
||||||
ASSERT(type == pCol->type);
|
ASSERT(type == pCol->type);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -255,30 +256,18 @@ int32_t tsdbGetTableTagVal(TsdbRepoT* repo, STableId* id, int32_t colId, int16_t
|
||||||
STsdbMeta* pMeta = tsdbGetMeta(repo);
|
STsdbMeta* pMeta = tsdbGetMeta(repo);
|
||||||
STable* pTable = tsdbGetTableByUid(pMeta, id->uid);
|
STable* pTable = tsdbGetTableByUid(pMeta, id->uid);
|
||||||
|
|
||||||
STSchema* pSchema = tsdbGetTableTagSchema(pMeta, pTable);
|
*val = tdQueryTagByID(pTable->tagVal, colId, type);
|
||||||
STColumn* pCol = NULL;
|
|
||||||
|
|
||||||
// todo binary search
|
if (*val != NULL) {
|
||||||
for(int32_t col = 0; col < schemaNCols(pSchema); ++col) {
|
switch(*type) {
|
||||||
STColumn* p = schemaColAt(pSchema, col);
|
case TSDB_DATA_TYPE_BINARY:
|
||||||
if (p->colId == colId) {
|
case TSDB_DATA_TYPE_NCHAR: *bytes = varDataLen(*val); break;
|
||||||
pCol = p;
|
case TSDB_DATA_TYPE_NULL: *bytes = 0; break;
|
||||||
break;
|
default:
|
||||||
|
*bytes = tDataTypeDesc[*type].nSize;break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pCol == NULL) {
|
|
||||||
return -1; // No matched tags. Maybe the modification of tags has not been done yet.
|
|
||||||
}
|
|
||||||
|
|
||||||
SDataRow row = (SDataRow)pTable->tagVal;
|
|
||||||
int16_t tagtype = 0;
|
|
||||||
char* d = tdQueryTagByID(row, pCol->colId, &tagtype);
|
|
||||||
//ASSERT((int8_t)tagtype == pCol->type)
|
|
||||||
*val = d;
|
|
||||||
*type = pCol->type;
|
|
||||||
*bytes = pCol->bytes;
|
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,7 +394,9 @@ int tsdbCreateTable(TsdbRepoT *repo, STableCfg *pCfg) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table->lastKey = TSKEY_INITIAL_VAL;
|
||||||
|
|
||||||
// Register to meta
|
// Register to meta
|
||||||
if (newSuper) {
|
if (newSuper) {
|
||||||
tsdbAddTableToMeta(pMeta, super, true);
|
tsdbAddTableToMeta(pMeta, super, true);
|
||||||
|
|
|
@ -95,7 +95,6 @@ typedef struct STsdbQueryHandle {
|
||||||
SQueryFilePos cur; // current position
|
SQueryFilePos cur; // current position
|
||||||
int16_t order;
|
int16_t order;
|
||||||
STimeWindow window; // the primary query time window that applies to all queries
|
STimeWindow window; // the primary query time window that applies to all queries
|
||||||
SCompBlock* pBlock;
|
|
||||||
SDataStatis* statis; // query level statistics, only one table block statistics info exists at any time
|
SDataStatis* statis; // query level statistics, only one table block statistics info exists at any time
|
||||||
int32_t numOfBlocks;
|
int32_t numOfBlocks;
|
||||||
SArray* pColumns; // column list, SColumnInfoData array list
|
SArray* pColumns; // column list, SColumnInfoData array list
|
||||||
|
@ -117,6 +116,12 @@ typedef struct STsdbQueryHandle {
|
||||||
} STsdbQueryHandle;
|
} STsdbQueryHandle;
|
||||||
|
|
||||||
static void changeQueryHandleForLastrowQuery(TsdbQueryHandleT pqHandle);
|
static void changeQueryHandleForLastrowQuery(TsdbQueryHandleT pqHandle);
|
||||||
|
static void changeQueryHandleForInterpQuery(TsdbQueryHandleT pHandle);
|
||||||
|
static void doMergeTwoLevelData(STsdbQueryHandle* pQueryHandle, STableCheckInfo* pCheckInfo, SCompBlock* pBlock,
|
||||||
|
SArray* sa);
|
||||||
|
static int32_t binarySearchForKey(char* pValue, int num, TSKEY key, int order);
|
||||||
|
static int tsdbReadRowsFromCache(SSkipListIterator* pIter, STable* pTable, TSKEY maxKey, int maxRowsToRead, TSKEY* skey, TSKEY* ekey,
|
||||||
|
STsdbQueryHandle* pQueryHandle);
|
||||||
|
|
||||||
static void tsdbInitDataBlockLoadInfo(SDataBlockLoadInfo* pBlockLoadInfo) {
|
static void tsdbInitDataBlockLoadInfo(SDataBlockLoadInfo* pBlockLoadInfo) {
|
||||||
pBlockLoadInfo->slot = -1;
|
pBlockLoadInfo->slot = -1;
|
||||||
|
@ -188,9 +193,6 @@ TsdbQueryHandleT* tsdbQueryTables(TsdbRepoT* tsdb, STsdbQueryCond* pCond, STable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int32_t i = 0; i < numOfCols; ++i) {
|
|
||||||
}
|
|
||||||
|
|
||||||
uTrace("%p total numOfTable:%d in query", pQueryHandle, taosArrayGetSize(pQueryHandle->pTableCheckInfo));
|
uTrace("%p total numOfTable:%d in query", pQueryHandle, taosArrayGetSize(pQueryHandle->pTableCheckInfo));
|
||||||
|
|
||||||
tsdbInitDataBlockLoadInfo(&pQueryHandle->dataBlockLoadInfo);
|
tsdbInitDataBlockLoadInfo(&pQueryHandle->dataBlockLoadInfo);
|
||||||
|
@ -209,13 +211,29 @@ TsdbQueryHandleT tsdbQueryLastRow(TsdbRepoT *tsdb, STsdbQueryCond *pCond, STable
|
||||||
return pQueryHandle;
|
return pQueryHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SArray* tsdbGetQueriedTableIdList(TsdbQueryHandleT *pHandle) {
|
||||||
|
assert(pHandle != NULL);
|
||||||
|
|
||||||
|
STsdbQueryHandle *pQueryHandle = (STsdbQueryHandle*) pHandle;
|
||||||
|
|
||||||
|
size_t size = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||||
|
SArray* res = taosArrayInit(size, sizeof(STableId));
|
||||||
|
|
||||||
|
for(int32_t i = 0; i < size; ++i) {
|
||||||
|
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i);
|
||||||
|
taosArrayPush(res, &pCheckInfo->tableId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
TsdbQueryHandleT tsdbQueryRowsInExternalWindow(TsdbRepoT *tsdb, STsdbQueryCond* pCond, STableGroupInfo *groupList) {
|
TsdbQueryHandleT tsdbQueryRowsInExternalWindow(TsdbRepoT *tsdb, STsdbQueryCond* pCond, STableGroupInfo *groupList) {
|
||||||
STsdbQueryHandle *pQueryHandle = (STsdbQueryHandle*) tsdbQueryTables(tsdb, pCond, groupList);
|
STsdbQueryHandle *pQueryHandle = (STsdbQueryHandle*) tsdbQueryTables(tsdb, pCond, groupList);
|
||||||
|
|
||||||
pQueryHandle->type = TSDB_QUERY_TYPE_EXTERNAL;
|
pQueryHandle->type = TSDB_QUERY_TYPE_EXTERNAL;
|
||||||
pQueryHandle->order = TSDB_ORDER_ASC;
|
// pQueryHandle->outputCapacity = 2; // only allowed two rows to be loaded
|
||||||
|
|
||||||
// changeQueryHandleForLastrowQuery(pQueryHandle);
|
changeQueryHandleForInterpQuery(pQueryHandle);
|
||||||
return pQueryHandle;
|
return pQueryHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,13 +346,35 @@ static bool hasMoreDataInCache(STsdbQueryHandle* pHandle) {
|
||||||
(pCheckInfo->lastKey < pHandle->window.ekey && !ASCENDING_TRAVERSE(pHandle->order))) {
|
(pCheckInfo->lastKey < pHandle->window.ekey && !ASCENDING_TRAVERSE(pHandle->order))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t step = ASCENDING_TRAVERSE(pHandle->order)? 1:-1;
|
||||||
|
STimeWindow* win = &pHandle->cur.win;
|
||||||
|
pHandle->cur.rows = tsdbReadRowsFromCache(pCheckInfo->iter, pCheckInfo->pTableObj, pHandle->window.ekey,
|
||||||
|
pHandle->outputCapacity, &win->skey, &win->ekey, pHandle); // todo refactor API
|
||||||
|
|
||||||
|
// update the last key value
|
||||||
|
pCheckInfo->lastKey = win->ekey + step;
|
||||||
|
pHandle->cur.lastKey = win->ekey + step;
|
||||||
|
pHandle->cur.mixBlock = true;
|
||||||
|
|
||||||
|
if (!ASCENDING_TRAVERSE(pHandle->order)) {
|
||||||
|
SWAP(win->skey, win->ekey, TSKEY);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t getFileIdFromKey(TSKEY key, int32_t daysPerFile) {
|
static int32_t getFileIdFromKey(TSKEY key, int32_t daysPerFile) {
|
||||||
|
if (key == TSKEY_INITIAL_VAL) {
|
||||||
|
return INT32_MIN;
|
||||||
|
}
|
||||||
|
|
||||||
int64_t fid = (int64_t)(key / (daysPerFile * tsMsPerDay[0])); // set the starting fileId
|
int64_t fid = (int64_t)(key / (daysPerFile * tsMsPerDay[0])); // set the starting fileId
|
||||||
if (fid > INT32_MAX) {
|
if (fid < 0L && llabs(fid) > INT32_MAX) { // data value overflow for INT32
|
||||||
|
fid = INT32_MIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fid > 0L && fid > INT32_MAX) {
|
||||||
fid = INT32_MAX;
|
fid = INT32_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,12 +512,6 @@ static SArray* getDefaultLoadColumns(STsdbQueryHandle* pQueryHandle, bool loadTS
|
||||||
return pLocalIdList;
|
return pLocalIdList;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void doMergeTwoLevelData(STsdbQueryHandle* pQueryHandle, STableCheckInfo* pCheckInfo, SCompBlock* pBlock,
|
|
||||||
SArray* sa);
|
|
||||||
static int32_t binarySearchForKey(char* pValue, int num, TSKEY key, int order);
|
|
||||||
static int tsdbReadRowsFromCache(SSkipListIterator* pIter, STable* pTable, TSKEY maxKey, int maxRowsToRead, TSKEY* skey, TSKEY* ekey,
|
|
||||||
STsdbQueryHandle* pQueryHandle);
|
|
||||||
|
|
||||||
static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlock, STableCheckInfo* pCheckInfo) {
|
static bool doLoadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlock, STableCheckInfo* pCheckInfo) {
|
||||||
STsdbRepo *pRepo = pQueryHandle->pTsdb;
|
STsdbRepo *pRepo = pQueryHandle->pTsdb;
|
||||||
SCompData* data = calloc(1, sizeof(SCompData) + sizeof(SCompCol) * pBlock->numOfCols);
|
SCompData* data = calloc(1, sizeof(SCompData) + sizeof(SCompCol) * pBlock->numOfCols);
|
||||||
|
@ -581,13 +615,21 @@ static void handleDataMergeIfNeeded(STsdbQueryHandle* pQueryHandle, SCompBlock*
|
||||||
}
|
}
|
||||||
|
|
||||||
SArray* sa = getDefaultLoadColumns(pQueryHandle, true);
|
SArray* sa = getDefaultLoadColumns(pQueryHandle, true);
|
||||||
|
|
||||||
doLoadFileDataBlock(pQueryHandle, pBlock, pCheckInfo);
|
doLoadFileDataBlock(pQueryHandle, pBlock, pCheckInfo);
|
||||||
doMergeTwoLevelData(pQueryHandle, pCheckInfo, pBlock, sa);
|
doMergeTwoLevelData(pQueryHandle, pCheckInfo, pBlock, sa);
|
||||||
taosArrayDestroy(sa);
|
taosArrayDestroy(sa);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
/*
|
||||||
|
* no data in cache, only load data from file
|
||||||
|
* during the query processing, data in cache will not be checked anymore.
|
||||||
|
*
|
||||||
|
* Here the buffer is not enough, so only part of file block can be loaded into memory buffer
|
||||||
|
*/
|
||||||
|
assert(pQueryHandle->outputCapacity >= binfo.rows);
|
||||||
pQueryHandle->realNumOfRows = binfo.rows;
|
pQueryHandle->realNumOfRows = binfo.rows;
|
||||||
|
|
||||||
cur->rows = binfo.rows;
|
cur->rows = binfo.rows;
|
||||||
cur->win = binfo.window;
|
cur->win = binfo.window;
|
||||||
cur->mixBlock = false;
|
cur->mixBlock = false;
|
||||||
|
@ -622,15 +664,14 @@ static bool loadFileDataBlock(STsdbQueryHandle* pQueryHandle, SCompBlock* pBlock
|
||||||
handleDataMergeIfNeeded(pQueryHandle, pBlock, pCheckInfo);
|
handleDataMergeIfNeeded(pQueryHandle, pBlock, pCheckInfo);
|
||||||
}
|
}
|
||||||
} else { //desc order, query ended in current block
|
} else { //desc order, query ended in current block
|
||||||
if (pQueryHandle->window.ekey > pBlock->keyFirst) {
|
if (pQueryHandle->window.ekey > pBlock->keyFirst || pCheckInfo->lastKey < pBlock->keyLast) {
|
||||||
if (!doLoadFileDataBlock(pQueryHandle, pBlock, pCheckInfo)) {
|
if (!doLoadFileDataBlock(pQueryHandle, pBlock, pCheckInfo)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDataCols* pDataCols = pCheckInfo->pDataCols;
|
SDataCols* pTSCol = pQueryHandle->rhelper.pDataCols[0];
|
||||||
if (pCheckInfo->lastKey < pBlock->keyLast) {
|
if (pCheckInfo->lastKey < pBlock->keyLast) {
|
||||||
cur->pos =
|
cur->pos = binarySearchForKey(pTSCol->cols[0].pData, pBlock->numOfRows, pCheckInfo->lastKey, pQueryHandle->order);
|
||||||
binarySearchForKey(pDataCols->cols[0].pData, pBlock->numOfRows, pCheckInfo->lastKey, pQueryHandle->order);
|
|
||||||
} else {
|
} else {
|
||||||
cur->pos = pBlock->numOfRows - 1;
|
cur->pos = pBlock->numOfRows - 1;
|
||||||
}
|
}
|
||||||
|
@ -1011,7 +1052,7 @@ int32_t binarySearchForKey(char* pValue, int num, TSKEY key, int order) {
|
||||||
firstPos = 0;
|
firstPos = 0;
|
||||||
lastPos = num - 1;
|
lastPos = num - 1;
|
||||||
|
|
||||||
if (order == 0) {
|
if (order == TSDB_ORDER_DESC) {
|
||||||
// find the first position which is smaller than the key
|
// find the first position which is smaller than the key
|
||||||
while (1) {
|
while (1) {
|
||||||
if (key >= keyList[lastPos]) return lastPos;
|
if (key >= keyList[lastPos]) return lastPos;
|
||||||
|
@ -1293,7 +1334,7 @@ static bool getDataBlocksInFiles(STsdbQueryHandle* pQueryHandle) {
|
||||||
|
|
||||||
static bool doHasDataInBuffer(STsdbQueryHandle* pQueryHandle) {
|
static bool doHasDataInBuffer(STsdbQueryHandle* pQueryHandle) {
|
||||||
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||||
// todo add assert, the value of numOfTables should be less than the maximum value for each vnode capacity
|
assert(numOfTables <= ((STsdbRepo*)pQueryHandle->pTsdb)->config.maxTables);
|
||||||
|
|
||||||
while (pQueryHandle->activeIndex < numOfTables) {
|
while (pQueryHandle->activeIndex < numOfTables) {
|
||||||
if (hasMoreDataInCache(pQueryHandle)) {
|
if (hasMoreDataInCache(pQueryHandle)) {
|
||||||
|
@ -1307,12 +1348,116 @@ static bool doHasDataInBuffer(STsdbQueryHandle* pQueryHandle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle data in cache situation
|
// handle data in cache situation
|
||||||
bool tsdbNextDataBlock(TsdbQueryHandleT* pqHandle) {
|
bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
|
||||||
STsdbQueryHandle* pQueryHandle = (STsdbQueryHandle*) pqHandle;
|
STsdbQueryHandle* pQueryHandle = (STsdbQueryHandle*) pHandle;
|
||||||
|
|
||||||
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||||
assert(numOfTables > 0);
|
assert(numOfTables > 0);
|
||||||
|
|
||||||
|
if (pQueryHandle->type == TSDB_QUERY_TYPE_EXTERNAL) {
|
||||||
|
pQueryHandle->type = TSDB_QUERY_TYPE_ALL;
|
||||||
|
pQueryHandle->order = TSDB_ORDER_DESC;
|
||||||
|
|
||||||
|
if (!tsdbNextDataBlock(pHandle)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
SArray* sa = getDefaultLoadColumns(pQueryHandle, true);
|
||||||
|
/*SDataBlockInfo* pBlockInfo =*/ tsdbRetrieveDataBlockInfo(pHandle);
|
||||||
|
/*SArray *pDataBlock = */tsdbRetrieveDataBlock(pHandle, sa);
|
||||||
|
|
||||||
|
if (pQueryHandle->cur.win.ekey == pQueryHandle->window.skey) {
|
||||||
|
// data already retrieve, discard other data rows and return
|
||||||
|
int32_t numOfCols = QH_GET_NUM_OF_COLS(pQueryHandle);
|
||||||
|
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||||
|
SColumnInfoData* pCol = taosArrayGet(pQueryHandle->pColumns, i);
|
||||||
|
memcpy(pCol->pData, pCol->pData + pCol->info.bytes * (pQueryHandle->cur.rows-1), pCol->info.bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
pQueryHandle->cur.win = (STimeWindow){pQueryHandle->window.skey, pQueryHandle->window.skey};
|
||||||
|
pQueryHandle->window = pQueryHandle->cur.win;
|
||||||
|
pQueryHandle->cur.rows = 1;
|
||||||
|
pQueryHandle->type = TSDB_QUERY_TYPE_EXTERNAL;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
STsdbQueryHandle* pSecQueryHandle = calloc(1, sizeof(STsdbQueryHandle));
|
||||||
|
pSecQueryHandle->order = TSDB_ORDER_ASC;
|
||||||
|
pSecQueryHandle->window = (STimeWindow) {pQueryHandle->window.skey, INT64_MAX};
|
||||||
|
pSecQueryHandle->pTsdb = pQueryHandle->pTsdb;
|
||||||
|
pSecQueryHandle->type = TSDB_QUERY_TYPE_ALL;
|
||||||
|
pSecQueryHandle->cur.fid = -1;
|
||||||
|
pSecQueryHandle->cur.win = TSWINDOW_INITIALIZER;
|
||||||
|
pSecQueryHandle->checkFiles = true;
|
||||||
|
pSecQueryHandle->activeIndex = 0;
|
||||||
|
pSecQueryHandle->outputCapacity = ((STsdbRepo*)pSecQueryHandle->pTsdb)->config.maxRowsPerFileBlock;
|
||||||
|
|
||||||
|
tsdbInitReadHelper(&pSecQueryHandle->rhelper, (STsdbRepo*) pSecQueryHandle->pTsdb);
|
||||||
|
|
||||||
|
// allocate buffer in order to load data blocks from file
|
||||||
|
int32_t numOfCols = QH_GET_NUM_OF_COLS(pQueryHandle);
|
||||||
|
|
||||||
|
pSecQueryHandle->statis = calloc(numOfCols, sizeof(SDataStatis));
|
||||||
|
pSecQueryHandle->pColumns = taosArrayInit(numOfCols, sizeof(SColumnInfoData));
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||||
|
SColumnInfoData colInfo = {{0}, 0};
|
||||||
|
SColumnInfoData* pCol = taosArrayGet(pQueryHandle->pColumns, i);
|
||||||
|
|
||||||
|
colInfo.info = pCol->info;
|
||||||
|
colInfo.pData = calloc(1, EXTRA_BYTES + pQueryHandle->outputCapacity * pCol->info.bytes);
|
||||||
|
taosArrayPush(pSecQueryHandle->pColumns, &colInfo);
|
||||||
|
pSecQueryHandle->statis[i].colId = colInfo.info.colId;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t si = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||||
|
pSecQueryHandle->pTableCheckInfo = taosArrayInit(si, sizeof(STableCheckInfo));
|
||||||
|
STsdbMeta* pMeta = tsdbGetMeta(pQueryHandle->pTsdb);
|
||||||
|
assert(pMeta != NULL);
|
||||||
|
|
||||||
|
for (int32_t j = 0; j < si; ++j) {
|
||||||
|
STableCheckInfo* pCheckInfo = (STableCheckInfo*) taosArrayGet(pQueryHandle->pTableCheckInfo, j);
|
||||||
|
|
||||||
|
STableCheckInfo info = {
|
||||||
|
.lastKey = pSecQueryHandle->window.skey,
|
||||||
|
.tableId = pCheckInfo->tableId,
|
||||||
|
.pTableObj = pCheckInfo->pTableObj,
|
||||||
|
};
|
||||||
|
|
||||||
|
taosArrayPush(pSecQueryHandle->pTableCheckInfo, &info);
|
||||||
|
}
|
||||||
|
|
||||||
|
tsdbInitDataBlockLoadInfo(&pSecQueryHandle->dataBlockLoadInfo);
|
||||||
|
tsdbInitCompBlockLoadInfo(&pSecQueryHandle->compBlockLoadInfo);
|
||||||
|
|
||||||
|
bool ret = tsdbNextDataBlock((void*) pSecQueryHandle);
|
||||||
|
assert(ret);
|
||||||
|
|
||||||
|
/*SDataBlockInfo* pBlockInfo =*/ tsdbRetrieveDataBlockInfo((void*) pSecQueryHandle);
|
||||||
|
/*SArray *pDataBlock = */tsdbRetrieveDataBlock((void*) pSecQueryHandle, sa);
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < numOfCols; ++i) {
|
||||||
|
SColumnInfoData* pCol = taosArrayGet(pQueryHandle->pColumns, i);
|
||||||
|
memcpy(pCol->pData, pCol->pData + pCol->info.bytes * (pQueryHandle->cur.rows-1), pCol->info.bytes);
|
||||||
|
|
||||||
|
SColumnInfoData* pCol1 = taosArrayGet(pSecQueryHandle->pColumns, i);
|
||||||
|
assert(pCol->info.colId == pCol1->info.colId);
|
||||||
|
|
||||||
|
memcpy(pCol->pData + pCol->info.bytes, pCol1->pData, pCol1->info.bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
SColumnInfoData* pTSCol = taosArrayGet(pQueryHandle->pColumns, 0);
|
||||||
|
|
||||||
|
pQueryHandle->cur.win = (STimeWindow){((TSKEY*)pTSCol->pData)[0], ((TSKEY*)pTSCol->pData)[1]};
|
||||||
|
pQueryHandle->window = pQueryHandle->cur.win;
|
||||||
|
pQueryHandle->cur.rows = 2;
|
||||||
|
|
||||||
|
tsdbCleanupQueryHandle(pSecQueryHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
pQueryHandle->type = TSDB_QUERY_TYPE_EXTERNAL;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (pQueryHandle->checkFiles) {
|
if (pQueryHandle->checkFiles) {
|
||||||
if (getDataBlocksInFiles(pQueryHandle)) {
|
if (getDataBlocksInFiles(pQueryHandle)) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1322,7 +1467,6 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pqHandle) {
|
||||||
pQueryHandle->checkFiles = false;
|
pQueryHandle->checkFiles = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: opt by using lastKeyOnFile
|
|
||||||
// TODO: opt by consider the scan order
|
// TODO: opt by consider the scan order
|
||||||
return doHasDataInBuffer(pQueryHandle);
|
return doHasDataInBuffer(pQueryHandle);
|
||||||
}
|
}
|
||||||
|
@ -1336,23 +1480,25 @@ void changeQueryHandleForLastrowQuery(TsdbQueryHandleT pqHandle) {
|
||||||
// todo consider the query time window, current last_row does not apply the query time window
|
// todo consider the query time window, current last_row does not apply the query time window
|
||||||
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||||
|
|
||||||
TSKEY key = 0;
|
TSKEY key = TSKEY_INITIAL_VAL;
|
||||||
int32_t index = -1;
|
int32_t index = -1;
|
||||||
|
|
||||||
for(int32_t i = 0; i < numOfTables; ++i) {
|
for(int32_t i = 0; i < numOfTables; ++i) {
|
||||||
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i);
|
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i);
|
||||||
if (pCheckInfo->pTableObj->lastKey > key) { //todo lastKey should not be 0 by default
|
if (pCheckInfo->pTableObj->tableId.uid == 12094628167747) {
|
||||||
|
printf("abc\n");
|
||||||
|
}
|
||||||
|
if (pCheckInfo->pTableObj->lastKey > key) {
|
||||||
key = pCheckInfo->pTableObj->lastKey;
|
key = pCheckInfo->pTableObj->lastKey;
|
||||||
index = i;
|
index = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo, there are no data in all the tables. opt performance
|
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// erase all other elements in array list, todo refactor
|
// erase all other elements in array list
|
||||||
size_t size = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
size_t size = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||||
for (int32_t i = 0; i < size; ++i) {
|
for (int32_t i = 0; i < size; ++i) {
|
||||||
if (i == index) {
|
if (i == index) {
|
||||||
|
@ -1371,9 +1517,7 @@ void changeQueryHandleForLastrowQuery(TsdbQueryHandleT pqHandle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
STableCheckInfo info = *(STableCheckInfo*) taosArrayGet(pQueryHandle->pTableCheckInfo, index);
|
STableCheckInfo info = *(STableCheckInfo*) taosArrayGet(pQueryHandle->pTableCheckInfo, index);
|
||||||
taosArrayDestroy(pQueryHandle->pTableCheckInfo);
|
taosArrayClear(pQueryHandle->pTableCheckInfo);
|
||||||
|
|
||||||
pQueryHandle->pTableCheckInfo = taosArrayInit(1, sizeof(STableCheckInfo));
|
|
||||||
|
|
||||||
info.lastKey = key;
|
info.lastKey = key;
|
||||||
taosArrayPush(pQueryHandle->pTableCheckInfo, &info);
|
taosArrayPush(pQueryHandle->pTableCheckInfo, &info);
|
||||||
|
@ -1382,6 +1526,43 @@ void changeQueryHandleForLastrowQuery(TsdbQueryHandleT pqHandle) {
|
||||||
pQueryHandle->window = (STimeWindow) {key, key};
|
pQueryHandle->window = (STimeWindow) {key, key};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void changeQueryHandleForInterpQuery(TsdbQueryHandleT pHandle) {
|
||||||
|
// filter the queried time stamp in the first place
|
||||||
|
STsdbQueryHandle* pQueryHandle = (STsdbQueryHandle*) pHandle;
|
||||||
|
pQueryHandle->order = TSDB_ORDER_DESC;
|
||||||
|
|
||||||
|
assert(pQueryHandle->window.skey == pQueryHandle->window.ekey);
|
||||||
|
|
||||||
|
// starts from the buffer in case of descending timestamp order check data blocks
|
||||||
|
// todo consider the query time window, current last_row does not apply the query time window
|
||||||
|
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
|
||||||
|
|
||||||
|
int32_t i = 0;
|
||||||
|
while(i < numOfTables) {
|
||||||
|
STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i);
|
||||||
|
if (pQueryHandle->window.skey <= pCheckInfo->pTableObj->lastKey &&
|
||||||
|
pCheckInfo->pTableObj->lastKey != TSKEY_INITIAL_VAL) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// there are no data in all the tables
|
||||||
|
if (i == numOfTables) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
STableCheckInfo info = *(STableCheckInfo*) taosArrayGet(pQueryHandle->pTableCheckInfo, i);
|
||||||
|
taosArrayClear(pQueryHandle->pTableCheckInfo);
|
||||||
|
|
||||||
|
info.lastKey = pQueryHandle->window.skey;
|
||||||
|
taosArrayPush(pQueryHandle->pTableCheckInfo, &info);
|
||||||
|
|
||||||
|
// update the query time window according to the chosen last timestamp
|
||||||
|
pQueryHandle->window = (STimeWindow) {info.lastKey, TSKEY_INITIAL_VAL};
|
||||||
|
}
|
||||||
|
|
||||||
static int tsdbReadRowsFromCache(SSkipListIterator* pIter, STable* pTable, TSKEY maxKey, int maxRowsToRead, TSKEY* skey, TSKEY* ekey,
|
static int tsdbReadRowsFromCache(SSkipListIterator* pIter, STable* pTable, TSKEY maxKey, int maxRowsToRead, TSKEY* skey, TSKEY* ekey,
|
||||||
STsdbQueryHandle* pQueryHandle) {
|
STsdbQueryHandle* pQueryHandle) {
|
||||||
int numOfRows = 0;
|
int numOfRows = 0;
|
||||||
|
@ -1466,58 +1647,29 @@ static int tsdbReadRowsFromCache(SSkipListIterator* pIter, STable* pTable, TSKEY
|
||||||
return numOfRows;
|
return numOfRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy data from cache into data block
|
|
||||||
SDataBlockInfo tsdbRetrieveDataBlockInfo(TsdbQueryHandleT* pQueryHandle) {
|
SDataBlockInfo tsdbRetrieveDataBlockInfo(TsdbQueryHandleT* pQueryHandle) {
|
||||||
STsdbQueryHandle* pHandle = (STsdbQueryHandle*)pQueryHandle;
|
STsdbQueryHandle* pHandle = (STsdbQueryHandle*)pQueryHandle;
|
||||||
|
SQueryFilePos* cur = &pHandle->cur;
|
||||||
int32_t step = ASCENDING_TRAVERSE(pHandle->order)? 1:-1;
|
STable* pTable = NULL;
|
||||||
|
|
||||||
// there are data in file
|
// there are data in file
|
||||||
if (pHandle->cur.fid >= 0) {
|
if (pHandle->cur.fid >= 0) {
|
||||||
STableBlockInfo* pBlockInfo = &pHandle->pDataBlockInfo[pHandle->cur.slot];
|
STableBlockInfo* pBlockInfo = &pHandle->pDataBlockInfo[cur->slot];
|
||||||
STable* pTable = pBlockInfo->pTableCheckInfo->pTableObj;
|
pTable = pBlockInfo->pTableCheckInfo->pTableObj;
|
||||||
|
|
||||||
SDataBlockInfo blockInfo = {
|
|
||||||
.uid = pTable->tableId.uid,
|
|
||||||
.tid = pTable->tableId.tid,
|
|
||||||
.rows = pHandle->cur.rows,
|
|
||||||
.window = pHandle->cur.win,
|
|
||||||
.numOfCols = QH_GET_NUM_OF_COLS(pHandle),
|
|
||||||
};
|
|
||||||
|
|
||||||
return blockInfo;
|
|
||||||
} else {
|
} else {
|
||||||
STableCheckInfo* pCheckInfo = taosArrayGet(pHandle->pTableCheckInfo, pHandle->activeIndex);
|
STableCheckInfo* pCheckInfo = taosArrayGet(pHandle->pTableCheckInfo, pHandle->activeIndex);
|
||||||
SQueryFilePos* cur = &pHandle->cur;
|
pTable = pCheckInfo->pTableObj;
|
||||||
|
|
||||||
STable* pTable = pCheckInfo->pTableObj;
|
|
||||||
if (pTable->mem != NULL) { // create mem table iterator if it is not created yet
|
|
||||||
assert(pCheckInfo->iter != NULL);
|
|
||||||
STimeWindow* win = &cur->win;
|
|
||||||
|
|
||||||
pHandle->cur.rows = tsdbReadRowsFromCache(pCheckInfo->iter, pCheckInfo->pTableObj, pHandle->window.ekey,
|
|
||||||
pHandle->outputCapacity, &win->skey, &win->ekey, pHandle); // todo refactor API
|
|
||||||
|
|
||||||
// update the last key value
|
|
||||||
pCheckInfo->lastKey = win->ekey + step;
|
|
||||||
cur->lastKey = win->ekey + step;
|
|
||||||
cur->mixBlock = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ASCENDING_TRAVERSE(pHandle->order)) {
|
|
||||||
SWAP(pHandle->cur.win.skey, pHandle->cur.win.ekey, TSKEY);
|
|
||||||
}
|
|
||||||
|
|
||||||
SDataBlockInfo blockInfo = {
|
|
||||||
.uid = pTable->tableId.uid,
|
|
||||||
.tid = pTable->tableId.tid,
|
|
||||||
.rows = pHandle->cur.rows,
|
|
||||||
.window = pHandle->cur.win,
|
|
||||||
.numOfCols = QH_GET_NUM_OF_COLS(pHandle),
|
|
||||||
};
|
|
||||||
|
|
||||||
return blockInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDataBlockInfo blockInfo = {
|
||||||
|
.uid = pTable->tableId.uid,
|
||||||
|
.tid = pTable->tableId.tid,
|
||||||
|
.rows = cur->rows,
|
||||||
|
.window = cur->win,
|
||||||
|
.numOfCols = QH_GET_NUM_OF_COLS(pHandle),
|
||||||
|
};
|
||||||
|
|
||||||
|
return blockInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1536,6 +1688,13 @@ int32_t tsdbRetrieveDataBlockStatisInfo(TsdbQueryHandleT* pQueryHandle, SDataSta
|
||||||
((cur->slot == pHandle->numOfBlocks) && (cur->slot == 0)));
|
((cur->slot == pHandle->numOfBlocks) && (cur->slot == 0)));
|
||||||
|
|
||||||
STableBlockInfo* pBlockInfo = &pHandle->pDataBlockInfo[cur->slot];
|
STableBlockInfo* pBlockInfo = &pHandle->pDataBlockInfo[cur->slot];
|
||||||
|
|
||||||
|
// file block with subblocks has no statistics data
|
||||||
|
if (pBlockInfo->compBlock->numOfSubBlocks > 1) {
|
||||||
|
*pBlockStatis = NULL;
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
tsdbLoadCompData(&pHandle->rhelper, pBlockInfo->compBlock, NULL);
|
tsdbLoadCompData(&pHandle->rhelper, pBlockInfo->compBlock, NULL);
|
||||||
|
|
||||||
size_t numOfCols = QH_GET_NUM_OF_COLS(pHandle);
|
size_t numOfCols = QH_GET_NUM_OF_COLS(pHandle);
|
||||||
|
@ -1708,12 +1867,7 @@ void filterPrepare(void* expr, void* param) {
|
||||||
pInfo->q = (char*) pCond->arr;
|
pInfo->q = (char*) pCond->arr;
|
||||||
} else {
|
} else {
|
||||||
pInfo->q = calloc(1, pSchema->bytes);
|
pInfo->q = calloc(1, pSchema->bytes);
|
||||||
if (pSchema->type == TSDB_DATA_TYPE_BINARY || pSchema->type == TSDB_DATA_TYPE_NCHAR) {
|
tVariantDump(pCond, pInfo->q, pSchema->type, true);
|
||||||
tVariantDump(pCond, varDataVal(pInfo->q), pSchema->type);
|
|
||||||
varDataSetLen(pInfo->q, pCond->nLen); // the length may be changed after dump, so assign its value after dump
|
|
||||||
} else {
|
|
||||||
tVariantDump(pCond, pInfo->q, pSchema->type);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1843,13 +1997,11 @@ bool indexedNodeFilterFp(const void* pNode, void* param) {
|
||||||
val = (char*) elem->pTable->name;
|
val = (char*) elem->pTable->name;
|
||||||
type = TSDB_DATA_TYPE_BINARY;
|
type = TSDB_DATA_TYPE_BINARY;
|
||||||
} else {
|
} else {
|
||||||
// STSchema* pTSchema = (STSchema*) pInfo->param; // todo table schema is identical to stable schema??
|
int16_t t1;
|
||||||
int16_t type;
|
val = tdQueryTagByID(elem->pTable->tagVal, pInfo->sch.colId, &t1);
|
||||||
// int32_t offset = pTSchema->columns[pInfo->colIndex].offset;
|
assert(pInfo->sch.type == t1);
|
||||||
// val = tdGetRowDataOfCol(elem->pTable->tagVal, pInfo->sch.type, TD_DATA_ROW_HEAD_SIZE + offset);
|
|
||||||
val = tdQueryTagByID(elem->pTable->tagVal, pInfo->sch.colId, &type);
|
|
||||||
// ASSERT(pInfo->sch.type == type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo :the val is possible to be null, so check it out carefully
|
//todo :the val is possible to be null, so check it out carefully
|
||||||
int32_t ret = 0;
|
int32_t ret = 0;
|
||||||
if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR) {
|
if (type == TSDB_DATA_TYPE_BINARY || type == TSDB_DATA_TYPE_NCHAR) {
|
||||||
|
|
|
@ -30,24 +30,19 @@ typedef void (*_hash_free_fn_t)(void *param);
|
||||||
|
|
||||||
typedef struct SHashNode {
|
typedef struct SHashNode {
|
||||||
char *key;
|
char *key;
|
||||||
union {
|
// union {
|
||||||
struct SHashNode * prev;
|
struct SHashNode * prev;
|
||||||
struct SHashEntry *prev1;
|
// struct SHashEntry *prev1;
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
struct SHashNode *next;
|
struct SHashNode *next;
|
||||||
uint32_t hashVal; // the hash value of key, if hashVal == HASH_VALUE_IN_TRASH, this node is moved to trash
|
uint32_t hashVal; // the hash value of key, if hashVal == HASH_VALUE_IN_TRASH, this node is moved to trash
|
||||||
uint32_t keyLen; // length of the key
|
uint32_t keyLen; // length of the key
|
||||||
char data[];
|
char data[];
|
||||||
} SHashNode;
|
} SHashNode;
|
||||||
|
|
||||||
typedef struct SHashEntry {
|
|
||||||
SHashNode *next;
|
|
||||||
uint32_t num;
|
|
||||||
} SHashEntry;
|
|
||||||
|
|
||||||
typedef struct SHashObj {
|
typedef struct SHashObj {
|
||||||
SHashEntry ** hashList;
|
SHashNode **hashList;
|
||||||
size_t capacity; // number of slots
|
size_t capacity; // number of slots
|
||||||
size_t size; // number of elements in hash table
|
size_t size; // number of elements in hash table
|
||||||
_hash_fn_t hashFp; // hash function
|
_hash_fn_t hashFp; // hash function
|
||||||
|
|
|
@ -83,17 +83,10 @@ static FORCE_INLINE int32_t taosHashCapacity(int32_t length) {
|
||||||
int32_t len = MIN(length, HASH_MAX_CAPACITY);
|
int32_t len = MIN(length, HASH_MAX_CAPACITY);
|
||||||
|
|
||||||
uint32_t i = 4;
|
uint32_t i = 4;
|
||||||
while (i < len) i = (i << 1U);
|
while (i < len) i = (i << 1u);
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* inplace update node in hash table
|
|
||||||
* @param pHashObj hash table object
|
|
||||||
* @param pNode hash data node
|
|
||||||
*/
|
|
||||||
static void doUpdateHashTable(SHashObj *pHashObj, SHashNode *pNode);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get SHashNode from hashlist, nodes from trash are not included.
|
* Get SHashNode from hashlist, nodes from trash are not included.
|
||||||
* @param pHashObj Cache objection
|
* @param pHashObj Cache objection
|
||||||
|
@ -105,10 +98,9 @@ static void doUpdateHashTable(SHashObj *pHashObj, SHashNode *pNode);
|
||||||
FORCE_INLINE SHashNode *doGetNodeFromHashTable(SHashObj *pHashObj, const void *key, uint32_t keyLen, uint32_t *hashVal) {
|
FORCE_INLINE SHashNode *doGetNodeFromHashTable(SHashObj *pHashObj, const void *key, uint32_t keyLen, uint32_t *hashVal) {
|
||||||
uint32_t hash = (*pHashObj->hashFp)(key, keyLen);
|
uint32_t hash = (*pHashObj->hashFp)(key, keyLen);
|
||||||
|
|
||||||
int32_t slot = HASH_INDEX(hash, pHashObj->capacity);
|
int32_t slot = HASH_INDEX(hash, pHashObj->capacity);
|
||||||
SHashEntry *pEntry = pHashObj->hashList[slot];
|
SHashNode *pNode = pHashObj->hashList[slot];
|
||||||
|
|
||||||
SHashNode *pNode = pEntry->next;
|
|
||||||
while (pNode) {
|
while (pNode) {
|
||||||
if ((pNode->keyLen == keyLen) && (memcmp(pNode->key, key, keyLen) == 0)) {
|
if ((pNode->keyLen == keyLen) && (memcmp(pNode->key, key, keyLen) == 0)) {
|
||||||
break;
|
break;
|
||||||
|
@ -190,17 +182,13 @@ SHashObj *taosHashInit(size_t capacity, _hash_fn_t fn, bool threadsafe) {
|
||||||
|
|
||||||
pHashObj->hashFp = fn;
|
pHashObj->hashFp = fn;
|
||||||
|
|
||||||
pHashObj->hashList = (SHashEntry **)calloc(pHashObj->capacity, sizeof(SHashEntry *));
|
pHashObj->hashList = (SHashNode **)calloc(pHashObj->capacity, POINTER_BYTES);
|
||||||
if (pHashObj->hashList == NULL) {
|
if (pHashObj->hashList == NULL) {
|
||||||
free(pHashObj);
|
free(pHashObj);
|
||||||
uError("failed to allocate memory, reason:%s", strerror(errno));
|
uError("failed to allocate memory, reason:%s", strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < pHashObj->capacity; ++i) {
|
|
||||||
pHashObj->hashList[i] = calloc(1, sizeof(SHashEntry));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (threadsafe) {
|
if (threadsafe) {
|
||||||
#if defined(LINUX)
|
#if defined(LINUX)
|
||||||
pHashObj->lock = calloc(1, sizeof(pthread_rwlock_t));
|
pHashObj->lock = calloc(1, sizeof(pthread_rwlock_t));
|
||||||
|
@ -252,7 +240,18 @@ int32_t taosHashPut(SHashObj *pHashObj, const void *key, size_t keyLen, void *da
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
doUpdateHashTable(pHashObj, pNewNode);
|
if (pNewNode->prev) {
|
||||||
|
pNewNode->prev->next = pNewNode;
|
||||||
|
} else {
|
||||||
|
int32_t slot = HASH_INDEX(pNewNode->hashVal, pHashObj->capacity);
|
||||||
|
|
||||||
|
assert(pHashObj->hashList[slot] == pNode);
|
||||||
|
pHashObj->hashList[slot] = pNewNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pNewNode->next) {
|
||||||
|
(pNewNode->next)->prev = pNewNode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__unlock(pHashObj->lock);
|
__unlock(pHashObj->lock);
|
||||||
|
@ -287,24 +286,19 @@ void taosHashRemove(SHashObj *pHashObj, const void *key, size_t keyLen) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SHashNode *pNext = pNode->next;
|
SHashNode *pNext = pNode->next;
|
||||||
if (pNode->prev != NULL) {
|
if (pNode->prev == NULL) {
|
||||||
int32_t slot = HASH_INDEX(val, pHashObj->capacity);
|
int32_t slot = HASH_INDEX(val, pHashObj->capacity);
|
||||||
if (pHashObj->hashList[slot]->next == pNode) {
|
assert(pHashObj->hashList[slot] == pNode);
|
||||||
pHashObj->hashList[slot]->next = pNext;
|
|
||||||
} else {
|
pHashObj->hashList[slot] = pNext;
|
||||||
pNode->prev->next = pNext;
|
} else {
|
||||||
}
|
pNode->prev->next = pNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pNext != NULL) {
|
if (pNext != NULL) {
|
||||||
pNext->prev = pNode->prev;
|
pNext->prev = pNode->prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t index = HASH_INDEX(pNode->hashVal, pHashObj->capacity);
|
|
||||||
|
|
||||||
SHashEntry *pEntry = pHashObj->hashList[index];
|
|
||||||
pEntry->num--;
|
|
||||||
|
|
||||||
pHashObj->size--;
|
pHashObj->size--;
|
||||||
|
|
||||||
pNode->next = NULL;
|
pNode->next = NULL;
|
||||||
|
@ -325,8 +319,7 @@ void taosHashCleanup(SHashObj *pHashObj) {
|
||||||
|
|
||||||
if (pHashObj->hashList) {
|
if (pHashObj->hashList) {
|
||||||
for (int32_t i = 0; i < pHashObj->capacity; ++i) {
|
for (int32_t i = 0; i < pHashObj->capacity; ++i) {
|
||||||
SHashEntry *pEntry = pHashObj->hashList[i];
|
pNode = pHashObj->hashList[i];
|
||||||
pNode = pEntry->next;
|
|
||||||
|
|
||||||
while (pNode) {
|
while (pNode) {
|
||||||
pNext = pNode->next;
|
pNext = pNode->next;
|
||||||
|
@ -337,8 +330,6 @@ void taosHashCleanup(SHashObj *pHashObj) {
|
||||||
free(pNode);
|
free(pNode);
|
||||||
pNode = pNext;
|
pNode = pNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
tfree(pEntry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(pHashObj->hashList);
|
free(pHashObj->hashList);
|
||||||
|
@ -385,13 +376,13 @@ bool taosHashIterNext(SHashMutableIterator *pIter) {
|
||||||
assert(pIter->pCur == NULL && pIter->pNext == NULL);
|
assert(pIter->pCur == NULL && pIter->pNext == NULL);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
SHashEntry *pEntry = pIter->pHashObj->hashList[pIter->entryIndex];
|
SHashNode *pEntry = pIter->pHashObj->hashList[pIter->entryIndex];
|
||||||
if (pEntry->next == NULL) {
|
if (pEntry == NULL) {
|
||||||
pIter->entryIndex++;
|
pIter->entryIndex++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pIter->pCur = pEntry->next;
|
pIter->pCur = pEntry;
|
||||||
|
|
||||||
if (pIter->pCur->next) {
|
if (pIter->pCur->next) {
|
||||||
pIter->pNext = pIter->pCur->next;
|
pIter->pNext = pIter->pCur->next;
|
||||||
|
@ -444,25 +435,25 @@ int32_t taosHashGetMaxOverflowLinkLength(const SHashObj *pHashObj) {
|
||||||
int32_t num = 0;
|
int32_t num = 0;
|
||||||
|
|
||||||
for (int32_t i = 0; i < pHashObj->size; ++i) {
|
for (int32_t i = 0; i < pHashObj->size; ++i) {
|
||||||
SHashEntry *pEntry = pHashObj->hashList[i];
|
SHashNode *pEntry = pHashObj->hashList[i];
|
||||||
if (num < pEntry->num) {
|
if (pEntry == NULL) {
|
||||||
num = pEntry->num;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t j = 0;
|
||||||
|
while(pEntry != NULL) {
|
||||||
|
pEntry = pEntry->next;
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (num < j) {
|
||||||
|
num = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
void doUpdateHashTable(SHashObj *pHashObj, SHashNode *pNode) {
|
|
||||||
if (pNode->prev1) {
|
|
||||||
pNode->prev1->next = pNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pNode->next) {
|
|
||||||
(pNode->next)->prev = pNode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void taosHashTableResize(SHashObj *pHashObj) {
|
void taosHashTableResize(SHashObj *pHashObj) {
|
||||||
if (pHashObj->size < pHashObj->capacity * HASH_DEFAULT_LOAD_FACTOR) {
|
if (pHashObj->size < pHashObj->capacity * HASH_DEFAULT_LOAD_FACTOR) {
|
||||||
return;
|
return;
|
||||||
|
@ -479,69 +470,53 @@ void taosHashTableResize(SHashObj *pHashObj) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// int64_t st = taosGetTimestampUs();
|
void *pNewEntry = realloc(pHashObj->hashList, POINTER_BYTES * newSize);
|
||||||
|
if (pNewEntry == NULL) {// todo handle error
|
||||||
SHashEntry **pNewEntry = realloc(pHashObj->hashList, sizeof(SHashEntry *) * newSize);
|
|
||||||
if (pNewEntry == NULL) {
|
|
||||||
// uTrace("cache resize failed due to out of memory, capacity remain:%d", pHashObj->capacity);
|
// uTrace("cache resize failed due to out of memory, capacity remain:%d", pHashObj->capacity);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pHashObj->hashList = pNewEntry;
|
pHashObj->hashList = pNewEntry;
|
||||||
for (int32_t i = pHashObj->capacity; i < newSize; ++i) {
|
memset(&pHashObj->hashList[pHashObj->capacity], 0, POINTER_BYTES * (newSize - pHashObj->capacity));
|
||||||
pHashObj->hashList[i] = calloc(1, sizeof(SHashEntry));
|
|
||||||
}
|
|
||||||
|
|
||||||
pHashObj->capacity = newSize;
|
pHashObj->capacity = newSize;
|
||||||
|
|
||||||
for (int32_t i = 0; i < pHashObj->capacity; ++i) {
|
for (int32_t i = 0; i < pHashObj->capacity; ++i) {
|
||||||
SHashEntry *pEntry = pHashObj->hashList[i];
|
pNode = pHashObj->hashList[i];
|
||||||
|
|
||||||
pNode = pEntry->next;
|
|
||||||
if (pNode != NULL) {
|
if (pNode != NULL) {
|
||||||
assert(pNode->prev1 == pEntry && pEntry->num > 0);
|
assert(pNode->prev == NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (pNode) {
|
while (pNode) {
|
||||||
int32_t j = HASH_INDEX(pNode->hashVal, pHashObj->capacity);
|
int32_t j = HASH_INDEX(pNode->hashVal, pHashObj->capacity);
|
||||||
if (j == i) { // this key resides in the same slot, no need to relocate it
|
if (j == i) { // this key locates in the same slot, no need to relocate it
|
||||||
pNode = pNode->next;
|
pNode = pNode->next;
|
||||||
} else {
|
} else {
|
||||||
pNext = pNode->next;
|
pNext = pNode->next;
|
||||||
|
|
||||||
// remove from current slot
|
if (pNode->prev == NULL) { // first node of the overflow linked list
|
||||||
assert(pNode->prev1 != NULL);
|
pHashObj->hashList[i] = pNext;
|
||||||
|
|
||||||
if (pNode->prev1 == pEntry) { // first node of the overflow linked list
|
|
||||||
pEntry->next = pNode->next;
|
|
||||||
} else {
|
} else {
|
||||||
pNode->prev->next = pNode->next;
|
pNode->prev->next = pNext;
|
||||||
}
|
}
|
||||||
|
|
||||||
pEntry->num--;
|
if (pNext != NULL) {
|
||||||
assert(pEntry->num >= 0);
|
pNext->prev = pNode->prev;
|
||||||
|
|
||||||
if (pNode->next != NULL) {
|
|
||||||
(pNode->next)->prev = pNode->prev;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear pointer
|
||||||
|
pNode->next = NULL;
|
||||||
|
pNode->prev = NULL;
|
||||||
|
|
||||||
// added into new slot
|
// added into new slot
|
||||||
pNode->next = NULL;
|
SHashNode *pNew = pHashObj->hashList[j];
|
||||||
pNode->prev1 = NULL;
|
if (pNew != NULL) {
|
||||||
|
assert(pNew->prev == NULL);
|
||||||
SHashEntry *pNewIndexEntry = pHashObj->hashList[j];
|
pNew->prev = pNode;
|
||||||
|
|
||||||
if (pNewIndexEntry->next != NULL) {
|
|
||||||
assert(pNewIndexEntry->next->prev1 == pNewIndexEntry);
|
|
||||||
|
|
||||||
pNewIndexEntry->next->prev = pNode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pNode->next = pNewIndexEntry->next;
|
pNode->next = pNew;
|
||||||
pNode->prev1 = pNewIndexEntry;
|
pHashObj->hashList[j] = pNode;
|
||||||
|
|
||||||
pNewIndexEntry->next = pNode;
|
|
||||||
pNewIndexEntry->num++;
|
|
||||||
|
|
||||||
// continue
|
// continue
|
||||||
pNode = pNext;
|
pNode = pNext;
|
||||||
|
@ -549,7 +524,6 @@ void taosHashTableResize(SHashObj *pHashObj) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// int64_t et = taosGetTimestampUs();
|
|
||||||
// uTrace("hash table resize completed, new capacity:%d, load factor:%f, elapsed time:%fms", pHashObj->capacity,
|
// uTrace("hash table resize completed, new capacity:%d, load factor:%f, elapsed time:%fms", pHashObj->capacity,
|
||||||
// ((double)pHashObj->size) / pHashObj->capacity, (et - st) / 1000.0);
|
// ((double)pHashObj->size) / pHashObj->capacity, (et - st) / 1000.0);
|
||||||
}
|
}
|
||||||
|
@ -595,19 +569,17 @@ SHashNode *doUpdateHashNode(SHashNode *pNode, const void *key, size_t keyLen, co
|
||||||
void doAddToHashTable(SHashObj *pHashObj, SHashNode *pNode) {
|
void doAddToHashTable(SHashObj *pHashObj, SHashNode *pNode) {
|
||||||
assert(pNode != NULL);
|
assert(pNode != NULL);
|
||||||
|
|
||||||
int32_t index = HASH_INDEX(pNode->hashVal, pHashObj->capacity);
|
int32_t index = HASH_INDEX(pNode->hashVal, pHashObj->capacity);
|
||||||
SHashEntry *pEntry = pHashObj->hashList[index];
|
|
||||||
|
|
||||||
pNode->next = pEntry->next;
|
SHashNode* pEntry = pHashObj->hashList[index];
|
||||||
|
if (pEntry != NULL) {
|
||||||
if (pEntry->next) {
|
pEntry->prev = pNode;
|
||||||
pEntry->next->prev = pNode;
|
|
||||||
|
pNode->next = pEntry;
|
||||||
|
pNode->prev = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pEntry->next = pNode;
|
pHashObj->hashList[index] = pNode;
|
||||||
pNode->prev1 = pEntry;
|
|
||||||
|
|
||||||
pEntry->num++;
|
|
||||||
pHashObj->size++;
|
pHashObj->size++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -616,13 +588,13 @@ SHashNode *getNextHashNode(SHashMutableIterator *pIter) {
|
||||||
|
|
||||||
pIter->entryIndex++;
|
pIter->entryIndex++;
|
||||||
while (pIter->entryIndex < pIter->pHashObj->capacity) {
|
while (pIter->entryIndex < pIter->pHashObj->capacity) {
|
||||||
SHashEntry *pEntry = pIter->pHashObj->hashList[pIter->entryIndex];
|
SHashNode *pNode = pIter->pHashObj->hashList[pIter->entryIndex];
|
||||||
if (pEntry->next == NULL) {
|
if (pNode == NULL) {
|
||||||
pIter->entryIndex++;
|
pIter->entryIndex++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return pEntry->next;
|
return pNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -92,7 +92,7 @@ int32_t compareLenPrefixedWStr(const void *pLeft, const void *pRight) {
|
||||||
if (len1 != len2) {
|
if (len1 != len2) {
|
||||||
return len1 > len2? 1:-1;
|
return len1 > len2? 1:-1;
|
||||||
} else {
|
} else {
|
||||||
int32_t ret = wcsncmp(varDataVal(pLeft), varDataVal(pRight), len1);
|
int32_t ret = wcsncmp(varDataVal(pLeft), varDataVal(pRight), len1/TSDB_NCHAR_SIZE);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -342,6 +342,7 @@ static void taosTimerLoopFunc(int signo) {
|
||||||
int64_t now = taosGetTimestampMs();
|
int64_t now = taosGetTimestampMs();
|
||||||
|
|
||||||
for (int i = 0; i < tListLen(wheels); i++) {
|
for (int i = 0; i < tListLen(wheels); i++) {
|
||||||
|
tmrTrace("begin processing wheel %d", i);
|
||||||
// `expried` is a temporary expire list.
|
// `expried` is a temporary expire list.
|
||||||
// expired timers are first add to this list, then move
|
// expired timers are first add to this list, then move
|
||||||
// to expired queue as a batch to improve performance.
|
// to expired queue as a batch to improve performance.
|
||||||
|
@ -389,6 +390,7 @@ static void taosTimerLoopFunc(int signo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
addToExpired(expired);
|
addToExpired(expired);
|
||||||
|
tmrTrace("end processing wheel %d", i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -149,8 +149,8 @@ int main(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(testCase, hashTest) {
|
TEST(testCase, hashTest) {
|
||||||
// simpleTest();
|
simpleTest();
|
||||||
// stringKeyTest();
|
stringKeyTest();
|
||||||
// noLockPerformanceTest();
|
noLockPerformanceTest();
|
||||||
// multithreadsTest();
|
multithreadsTest();
|
||||||
}
|
}
|
|
@ -139,12 +139,10 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
|
||||||
|
|
||||||
char *pTagData = pTable->data + totalCols * sizeof(SSchema);
|
char *pTagData = pTable->data + totalCols * sizeof(SSchema);
|
||||||
int accumBytes = 0;
|
int accumBytes = 0;
|
||||||
//dataRow = tdNewDataRowFromSchema(pDestTagSchema);
|
|
||||||
dataRow = tdNewTagRowFromSchema(pDestTagSchema, numOfTags);
|
dataRow = tdNewTagRowFromSchema(pDestTagSchema, numOfTags);
|
||||||
|
|
||||||
for (int i = 0; i < numOfTags; i++) {
|
for (int i = 0; i < numOfTags; i++) {
|
||||||
STColumn *pTCol = schemaColAt(pDestTagSchema, i);
|
STColumn *pTCol = schemaColAt(pDestTagSchema, i);
|
||||||
// tdAppendColVal(dataRow, pTagData + accumBytes, pTCol->type, pTCol->bytes, pTCol->offset);
|
|
||||||
tdAppendTagColVal(dataRow, pTagData + accumBytes, pTCol->type, pTCol->bytes, pTCol->colId);
|
tdAppendTagColVal(dataRow, pTagData + accumBytes, pTCol->type, pTCol->bytes, pTCol->colId);
|
||||||
accumBytes += htons(pSchema[i + numOfColumns].bytes);
|
accumBytes += htons(pSchema[i + numOfColumns].bytes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,11 +16,12 @@
|
||||||
// TAOS standard API example. The same syntax as MySQL, but only a subet
|
// TAOS standard API example. The same syntax as MySQL, but only a subet
|
||||||
// to compile: gcc -o demo demo.c -ltaos
|
// to compile: gcc -o demo demo.c -ltaos
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <taos.h> // TAOS header file
|
#include <taos.h> // TAOS header file
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
void taosMsleep(int mseconds);
|
void taosMsleep(int mseconds);
|
||||||
|
|
||||||
|
@ -49,19 +50,52 @@ static int32_t doQuery(TAOS* taos, const char* sql) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* oneLoader(void* param) {
|
||||||
|
TAOS* conn = (TAOS*) param;
|
||||||
|
|
||||||
|
for(int32_t i = 0; i < 20000; ++i) {
|
||||||
|
// doQuery(conn, "show databases");
|
||||||
|
doQuery(conn, "use test");
|
||||||
|
// doQuery(conn, "describe t12");
|
||||||
|
// doQuery(conn, "show tables");
|
||||||
|
// doQuery(conn, "create table if not exists abc (ts timestamp, k int)");
|
||||||
|
// doQuery(conn, "select * from t12");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static __attribute__((unused)) void multiThreadTest(int32_t numOfThreads, void* conn) {
|
||||||
|
pthread_attr_t thattr;
|
||||||
|
pthread_attr_init(&thattr);
|
||||||
|
pthread_attr_setdetachstate(&thattr, PTHREAD_CREATE_JOINABLE);
|
||||||
|
|
||||||
|
pthread_t* threadId = malloc(sizeof(pthread_t)*numOfThreads);
|
||||||
|
|
||||||
|
for (int i = 0; i < numOfThreads; ++i) {
|
||||||
|
pthread_create(&threadId[i], NULL, oneLoader, conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < numOfThreads; ++i) {
|
||||||
|
pthread_join(threadId[i], NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
pthread_attr_destroy(&thattr);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
TAOS * taos;
|
TAOS * taos;
|
||||||
char qstr[1024];
|
char qstr[1024];
|
||||||
TAOS_RES *result;
|
TAOS_RES *result;
|
||||||
|
|
||||||
|
|
||||||
// connect to server
|
// connect to server
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
printf("please input server-ip \n");
|
printf("please input server-ip \n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
taos_options(TSDB_OPTION_CONFIGDIR, "~/sec/cfg");
|
taos_options(TSDB_OPTION_CONFIGDIR, "/home/lisa/Documents/workspace/TDinternal/community/sim/tsim/cfg");
|
||||||
|
|
||||||
// init TAOS
|
// init TAOS
|
||||||
taos_init();
|
taos_init();
|
||||||
|
@ -73,15 +107,12 @@ int main(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
printf("success to connect to server\n");
|
printf("success to connect to server\n");
|
||||||
|
|
||||||
doQuery(taos, "create database if not exists test");
|
// multiThreadTest(1, taos);
|
||||||
doQuery(taos, "use test");
|
doQuery(taos, "select max(c1), min(c2), sum(c3), avg(c4), first(c7), last(c8), first(c9) from lm2_db0.lm2_stb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1, -2) group by t1 limit 2 offset 10;");
|
||||||
doQuery(taos, "select count(*) from m1 where ts>='2020-1-1 1:1:1' and ts<='2020-1-1 1:1:59' interval(500a) fill(value, 99)");
|
// for(int32_t i = 0; i < 100000; ++i) {
|
||||||
|
// doQuery(taos, "insert into t1 values(now, 2)");
|
||||||
// doQuery(taos, "create table t1(ts timestamp, k binary(12), f nchar(2))");
|
|
||||||
// for(int32_t i = 0; i< 100000; ++i) {
|
|
||||||
// doQuery(taos, "select m1.ts,m1.a from m1, m2 where m1.ts=m2.ts and m1.a=m2.b;");
|
|
||||||
// usleep(500000);
|
|
||||||
// }
|
// }
|
||||||
|
// doQuery(taos, "create table t1(ts timestamp, k binary(12), f nchar(2))");
|
||||||
|
|
||||||
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:1', 'abc')");
|
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:1', 'abc')");
|
||||||
// doQuery(taos, "create table if not exists tm0 (ts timestamp, k int);");
|
// doQuery(taos, "create table if not exists tm0 (ts timestamp, k int);");
|
||||||
|
|
|
@ -78,7 +78,8 @@ sleep 5000
|
||||||
|
|
||||||
print ========= step4
|
print ========= step4
|
||||||
sql select * from ic2db.tb;
|
sql select * from ic2db.tb;
|
||||||
if $rows != 13 then
|
if $rows != 13 then
|
||||||
|
print expect 13, actual:$rows
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -108,10 +108,10 @@ $cache = 16 # 16MB
|
||||||
$ablocks = 100
|
$ablocks = 100
|
||||||
$tblocks = 32 # max=512, automatically trimmed when exceeding
|
$tblocks = 32 # max=512, automatically trimmed when exceeding
|
||||||
$ctime = 36000 # 10 hours
|
$ctime = 36000 # 10 hours
|
||||||
$wal = 0 # valid value is 0, 1, 2
|
$wal = 1 # valid value is 1, 2
|
||||||
$comp = 1 # max=32, automatically trimmed when exceeding
|
$comp = 1 # max=32, automatically trimmed when exceeding
|
||||||
|
|
||||||
sql create database $db replica $replica days $days keep $keep maxrows $rows_db cache $cache ctime $ctime wal $wal comp $comp
|
sql create database $db replica $replica days $days keep $keep maxrows $rows_db cache $cache blocks 4 ctime $ctime wal $wal comp $comp
|
||||||
sql show databases
|
sql show databases
|
||||||
if $rows != 1 then
|
if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
|
@ -129,18 +129,15 @@ if $data06 != 365,365,365 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
print data08 = $data08
|
print data08 = $data08
|
||||||
if $data08 != $rows_db then
|
if $data08 != $cache then
|
||||||
|
print expect $cache, actual:$data08
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data09 != $cache then
|
if $data09 != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
sql drop database $db
|
|
||||||
|
|
||||||
# ablocks_smaller_than_tblocks
|
sql drop database $db
|
||||||
#$ablocks = 50
|
|
||||||
#$tblocks = 100
|
|
||||||
#sql_error create database $db ablocks $ablocks tblocks $tblocks
|
|
||||||
|
|
||||||
## param range tests
|
## param range tests
|
||||||
# replica [1,3]
|
# replica [1,3]
|
||||||
|
@ -160,14 +157,11 @@ sql_error create database $db maxrows 199
|
||||||
#sql_error create database $db maxrows 10001
|
#sql_error create database $db maxrows 10001
|
||||||
|
|
||||||
# cache [100, 10485760]
|
# cache [100, 10485760]
|
||||||
sql_error create database $db cache 99
|
sql_error create database $db cache 0
|
||||||
#sql_error create database $db cache 10485761
|
#sql_error create database $db cache 10485761
|
||||||
|
|
||||||
# ablocks [overwriten by 4*maxtablesPerVnode, 409600]
|
|
||||||
sql_error create database $db ablocks -1
|
|
||||||
#sql_error create database $db ablocks 409601
|
|
||||||
|
|
||||||
# tblocks [32, 4096 overwriten by 4096 if exceeds, Note added:2018-10-24]
|
# blocks [32, 4096 overwriten by 4096 if exceeds, Note added:2018-10-24]
|
||||||
#sql_error create database $db tblocks 31
|
#sql_error create database $db tblocks 31
|
||||||
#sql_error create database $db tblocks 4097
|
#sql_error create database $db tblocks 4097
|
||||||
|
|
||||||
|
@ -175,9 +169,10 @@ sql_error create database $db ablocks -1
|
||||||
sql_error create database $db ctime 29
|
sql_error create database $db ctime 29
|
||||||
sql_error create database $db ctime 40961
|
sql_error create database $db ctime 40961
|
||||||
|
|
||||||
# wal {0, 1}
|
# wal {1, 2}
|
||||||
|
sql_error create database $db wal 0
|
||||||
sql_error create database $db wal -1
|
sql_error create database $db wal -1
|
||||||
#sql_error create database $db wal 2
|
sql_error create database $db wal 3
|
||||||
|
|
||||||
# comp {0, 1, 2}
|
# comp {0, 1, 2}
|
||||||
sql_error create database $db comp -1
|
sql_error create database $db comp -1
|
||||||
|
|
|
@ -117,6 +117,7 @@ $tb = $tbPrefix . 0
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data01 != NULL then
|
if $data01 != NULL then
|
||||||
|
print expect NULL, actual $data01
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data02 != NULL then
|
if $data02 != NULL then
|
||||||
|
@ -213,6 +214,7 @@ $tb = $tbPrefix . 0
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data03 != 0.00000 then
|
if $data03 != 0.00000 then
|
||||||
|
print expect 0.00000, actual:$data03
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
# if $data04 != NULL then
|
# if $data04 != NULL then
|
||||||
|
|
|
@ -400,6 +400,7 @@ endi
|
||||||
$limit = $totalNum / 2
|
$limit = $totalNum / 2
|
||||||
sql select max(c1), min(c2), avg(c3), count(c4), sum(c5), spread(c6), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 1 and t1 < 8 group by t1 order by t1 asc limit $limit offset 0
|
sql select max(c1), min(c2), avg(c3), count(c4), sum(c5), spread(c6), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 1 and t1 < 8 group by t1 order by t1 asc limit $limit offset 0
|
||||||
if $rows != 6 then
|
if $rows != 6 then
|
||||||
|
print expect 6, actual:$rows
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
if $data00 != 9 then
|
if $data00 != 9 then
|
||||||
|
|
|
@ -8,38 +8,38 @@
|
||||||
#sleep 2000
|
#sleep 2000
|
||||||
#run general/parser/auto_create_tb_drop_tb.sim
|
#run general/parser/auto_create_tb_drop_tb.sim
|
||||||
|
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/col_arithmetic_operation.sim
|
#run general/parser/col_arithmetic_operation.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/columnValue.sim
|
#run general/parser/columnValue.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/commit.sim
|
#run general/parser/commit.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/create_db.sim
|
#run general/parser/create_db.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/create_mt.sim
|
#run general/parser/create_mt.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/create_tb.sim
|
#run general/parser/create_tb.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/dbtbnameValidate.sim
|
#run general/parser/dbtbnameValidate.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/import_commit1.sim
|
#run general/parser/import_commit1.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/import_commit2.sim
|
#run general/parser/import_commit2.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/import_commit3.sim
|
#run general/parser/import_commit3.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/insert_tb.sim
|
#run general/parser/insert_tb.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/first_last.sim
|
#run general/parser/first_last.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/import_file.sim
|
##run general/parser/import_file.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/lastrow.sim
|
#run general/parser/lastrow.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/nchar.sim
|
#run general/parser/nchar.sim
|
||||||
sleep 2000
|
#sleep 2000
|
||||||
run general/parser/null_char.sim
|
##run general/parser/null_char.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/single_row_in_tb.sim
|
run general/parser/single_row_in_tb.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
|
@ -62,20 +62,23 @@ sleep 2000
|
||||||
run general/parser/tbnameIn.sim
|
run general/parser/tbnameIn.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/projection_limit_offset.sim
|
run general/parser/projection_limit_offset.sim
|
||||||
|
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/limit2.sim
|
run general/parser/limit2.sim
|
||||||
sleep 2000
|
|
||||||
run general/parser/slimit.sim
|
|
||||||
|
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/fill.sim
|
run general/parser/fill.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/fill_stb.sim
|
run general/parser/fill_stb.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/tags_dynamically_specifiy.sim
|
run general/parser/where.sim
|
||||||
|
sleep 2000
|
||||||
|
run general/parser/slimit.sim
|
||||||
|
sleep 2000
|
||||||
|
run general/parser/select_with_tags.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/interp.sim
|
run general/parser/interp.sim
|
||||||
|
|
||||||
|
sleep 2000
|
||||||
|
run general/parser/tags_dynamically_specifiy.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/set_tag_vals.sim
|
run general/parser/set_tag_vals.sim
|
||||||
|
|
||||||
|
@ -86,8 +89,6 @@ run general/parser/stream_on_sys.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/stream.sim
|
run general/parser/stream.sim
|
||||||
|
|
||||||
sleep 2000
|
|
||||||
run general/parser/where.sim
|
|
||||||
sleep 2000
|
sleep 2000
|
||||||
#run general/parser/repeatAlter.sim
|
#run general/parser/repeatAlter.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
|
@ -97,11 +98,8 @@ run general/parser/join.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/join_multivnode.sim
|
run general/parser/join_multivnode.sim
|
||||||
|
|
||||||
sleep 2000
|
|
||||||
run general/parser/select_with_tags.sim
|
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/groupby.sim
|
run general/parser/groupby.sim
|
||||||
|
|
||||||
sleep 2000
|
sleep 2000
|
||||||
run general/parser/binary_escapeCharacter.sim
|
run general/parser/binary_escapeCharacter.sim
|
||||||
sleep 2000
|
sleep 2000
|
||||||
|
|
|
@ -29,23 +29,23 @@ $i = 0
|
||||||
while $i < $tbNum
|
while $i < $tbNum
|
||||||
$tb = $tbPrefix . $i
|
$tb = $tbPrefix . $i
|
||||||
sql create table $tb using $mt tags( $i )
|
sql create table $tb using $mt tags( $i )
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
while $x < $rowNum
|
while $x < $rowNum
|
||||||
$ms = $x . m
|
$ms = $x . m
|
||||||
$c = $x / 100
|
$c = $x / 100
|
||||||
$c = $c * 100
|
$c = $c * 100
|
||||||
$c = $x - $c
|
$c = $x - $c
|
||||||
$binary = 'binary . $c
|
$binary = 'binary . $c
|
||||||
$binary = $binary . '
|
$binary = $binary . '
|
||||||
$nchar = 'nchar . $c
|
$nchar = 'nchar . $c
|
||||||
$nchar = $nchar . '
|
$nchar = $nchar . '
|
||||||
sql insert into $tb values (now + $ms , $c , $c , $c , $c , $c , $c , $c , $binary , $nchar )
|
sql insert into $tb values (now + $ms , $c , $c , $c , $c , $c , $c , $c , $binary , $nchar )
|
||||||
$x = $x + 1
|
$x = $x + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
$i = $i + 1
|
$i = $i + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
sleep 100
|
sleep 100
|
||||||
|
|
||||||
|
@ -78,12 +78,16 @@ sql select tbname from $mt where t1 < 2
|
||||||
if $rows != 2 then
|
if $rows != 2 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
print $tbPrefix
|
||||||
$tb = $tbPrefix . 0
|
$tb = $tbPrefix . 0
|
||||||
if $data00 != $tb then
|
if $data00 != wh_tb1 then
|
||||||
|
print expect wh_tb1, actual:$data00
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
$tb = $tbPrefix . 1
|
$tb = $tbPrefix . 1
|
||||||
if $data10 != $tb then
|
if $data10 != wh_tb0 then
|
||||||
|
print expect wh_tb0, actual:$data00
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
|
|
@ -63,4 +63,4 @@ sql close
|
||||||
sql connect
|
sql connect
|
||||||
sleep 2000
|
sleep 2000
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -1,5 +1,3 @@
|
||||||
cd ../../debug; cmake ..
|
|
||||||
cd ../../debug; make
|
|
||||||
cd ../../../debug; cmake ..
|
cd ../../../debug; cmake ..
|
||||||
cd ../../../debug; make
|
cd ../../../debug; make
|
||||||
|
|
||||||
|
@ -61,7 +59,7 @@ cd ../../../debug; make
|
||||||
./test.sh -f general/db/delete_writing1.sim
|
./test.sh -f general/db/delete_writing1.sim
|
||||||
./test.sh -f general/db/delete_writing2.sim
|
./test.sh -f general/db/delete_writing2.sim
|
||||||
./test.sh -f general/db/delete.sim
|
./test.sh -f general/db/delete.sim
|
||||||
./test.sh -f general/db/dropdnodes.sim
|
#not test ./test.sh -f general/db/dropdnodes.sim
|
||||||
./test.sh -f general/db/len.sim
|
./test.sh -f general/db/len.sim
|
||||||
./test.sh -f general/db/repeat.sim
|
./test.sh -f general/db/repeat.sim
|
||||||
./test.sh -f general/db/tables.sim
|
./test.sh -f general/db/tables.sim
|
||||||
|
@ -235,78 +233,78 @@ cd ../../../debug; make
|
||||||
./test.sh -f general/vector/table_query.sim
|
./test.sh -f general/vector/table_query.sim
|
||||||
./test.sh -f general/vector/table_time.sim
|
./test.sh -f general/vector/table_time.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/account/account_create.sim
|
./test.sh -f unique/account/account_create.sim
|
||||||
./test.sh -u -f unique/account/account_delete.sim
|
./test.sh -f unique/account/account_delete.sim
|
||||||
./test.sh -u -f unique/account/account_len.sim
|
./test.sh -f unique/account/account_len.sim
|
||||||
./test.sh -u -f unique/account/authority.sim
|
./test.sh -f unique/account/authority.sim
|
||||||
./test.sh -u -f unique/account/basic.sim
|
./test.sh -f unique/account/basic.sim
|
||||||
./test.sh -u -f unique/account/paras.sim
|
./test.sh -f unique/account/paras.sim
|
||||||
./test.sh -u -f unique/account/pass_alter.sim
|
./test.sh -f unique/account/pass_alter.sim
|
||||||
./test.sh -u -f unique/account/pass_len.sim
|
./test.sh -f unique/account/pass_len.sim
|
||||||
./test.sh -u -f unique/account/usage.sim
|
./test.sh -f unique/account/usage.sim
|
||||||
./test.sh -u -f unique/account/user_create.sim
|
./test.sh -f unique/account/user_create.sim
|
||||||
./test.sh -u -f unique/account/user_len.sim
|
./test.sh -f unique/account/user_len.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/big/balance.sim
|
./test.sh -f unique/big/balance.sim
|
||||||
./test.sh -u -f unique/big/maxvnodes.sim
|
./test.sh -f unique/big/maxvnodes.sim
|
||||||
./test.sh -u -f unique/big/tcp.sim
|
./test.sh -f unique/big/tcp.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/cluster/balance1.sim
|
./test.sh -f unique/cluster/balance1.sim
|
||||||
./test.sh -u -f unique/cluster/balance2.sim
|
./test.sh -f unique/cluster/balance2.sim
|
||||||
./test.sh -u -f unique/cluster/balance3.sim
|
./test.sh -f unique/cluster/balance3.sim
|
||||||
./test.sh -u -f unique/cluster/cache.sim
|
./test.sh -f unique/cluster/cache.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/column/replica3.sim
|
./test.sh -f unique/column/replica3.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/db/commit.sim
|
./test.sh -f unique/db/commit.sim
|
||||||
./test.sh -u -f unique/db/delete.sim
|
./test.sh -f unique/db/delete.sim
|
||||||
./test.sh -u -f unique/db/delete_part.sim
|
./test.sh -f unique/db/delete_part.sim
|
||||||
./test.sh -u -f unique/db/replica_add12.sim
|
./test.sh -f unique/db/replica_add12.sim
|
||||||
./test.sh -u -f unique/db/replica_add13.sim
|
./test.sh -f unique/db/replica_add13.sim
|
||||||
./test.sh -u -f unique/db/replica_add23.sim
|
./test.sh -f unique/db/replica_add23.sim
|
||||||
./test.sh -u -f unique/db/replica_reduce21.sim
|
./test.sh -f unique/db/replica_reduce21.sim
|
||||||
./test.sh -u -f unique/db/replica_reduce32.sim
|
./test.sh -f unique/db/replica_reduce32.sim
|
||||||
./test.sh -u -f unique/db/replica_reduce31.sim
|
./test.sh -f unique/db/replica_reduce31.sim
|
||||||
./test.sh -u -f unique/db/replica_part.sim
|
./test.sh -f unique/db/replica_part.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/dnode/alternativeRole.sim
|
./test.sh -f unique/dnode/alternativeRole.sim
|
||||||
./test.sh -u -f unique/dnode/balance1.sim
|
./test.sh -f unique/dnode/balance1.sim
|
||||||
./test.sh -u -f unique/dnode/balance2.sim
|
./test.sh -f unique/dnode/balance2.sim
|
||||||
./test.sh -u -f unique/dnode/balance3.sim
|
./test.sh -f unique/dnode/balance3.sim
|
||||||
./test.sh -u -f unique/dnode/balancex.sim
|
./test.sh -f unique/dnode/balancex.sim
|
||||||
./test.sh -u -f unique/dnode/offline1.sim
|
./test.sh -f unique/dnode/offline1.sim
|
||||||
./test.sh -u -f unique/dnode/offline2.sim
|
./test.sh -f unique/dnode/offline2.sim
|
||||||
./test.sh -u -f unique/dnode/remove1.sim
|
./test.sh -f unique/dnode/remove1.sim
|
||||||
./test.sh -u -f unique/dnode/remove2.sim
|
./test.sh -f unique/dnode/remove2.sim
|
||||||
./test.sh -u -f unique/dnode/vnode_clean.sim
|
./test.sh -f unique/dnode/vnode_clean.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/http/admin.sim
|
./test.sh -f unique/http/admin.sim
|
||||||
./test.sh -u -f unique/http/opentsdb.sim
|
./test.sh -f unique/http/opentsdb.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/import/replica2.sim
|
./test.sh -f unique/import/replica2.sim
|
||||||
./test.sh -u -f unique/import/replica3.sim
|
./test.sh -f unique/import/replica3.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/stable/balance_replica1.sim
|
./test.sh -f unique/stable/balance_replica1.sim
|
||||||
./test.sh -u -f unique/stable/dnode2_stop.sim
|
./test.sh -f unique/stable/dnode2_stop.sim
|
||||||
./test.sh -u -f unique/stable/dnode2.sim
|
./test.sh -f unique/stable/dnode2.sim
|
||||||
./test.sh -u -f unique/stable/dnode3.sim
|
./test.sh -f unique/stable/dnode3.sim
|
||||||
./test.sh -u -f unique/stable/replica2_dnode4.sim
|
./test.sh -f unique/stable/replica2_dnode4.sim
|
||||||
./test.sh -u -f unique/stable/replica2_vnode3.sim
|
./test.sh -f unique/stable/replica2_vnode3.sim
|
||||||
./test.sh -u -f unique/stable/replica3_dnode6.sim
|
./test.sh -f unique/stable/replica3_dnode6.sim
|
||||||
./test.sh -u -f unique/stable/replica3_vnode3.sim
|
./test.sh -f unique/stable/replica3_vnode3.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/mnode/mgmt22.sim
|
./test.sh -f unique/mnode/mgmt22.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt23.sim
|
./test.sh -f unique/mnode/mgmt23.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt24.sim
|
./test.sh -f unique/mnode/mgmt24.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt25.sim
|
./test.sh -f unique/mnode/mgmt25.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt26.sim
|
./test.sh -f unique/mnode/mgmt26.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt33.sim
|
./test.sh -f unique/mnode/mgmt33.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt34.sim
|
./test.sh -f unique/mnode/mgmt34.sim
|
||||||
./test.sh -u -f unique/mnode/mgmtr2.sim
|
./test.sh -f unique/mnode/mgmtr2.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/vnode/many.sim
|
./test.sh -f unique/vnode/many.sim
|
||||||
./test.sh -u -f unique/vnode/replica2_basic2.sim
|
./test.sh -f unique/vnode/replica2_basic2.sim
|
||||||
./test.sh -u -f unique/vnode/replica2_repeat.sim
|
./test.sh -f unique/vnode/replica2_repeat.sim
|
||||||
./test.sh -u -f unique/vnode/replica3_basic.sim
|
./test.sh -f unique/vnode/replica3_basic.sim
|
||||||
./test.sh -u -f unique/vnode/replica3_repeat.sim
|
./test.sh -f unique/vnode/replica3_repeat.sim
|
||||||
./test.sh -u -f unique/vnode/replica3_vgroup.sim
|
./test.sh -f unique/vnode/replica3_vgroup.sim
|
||||||
|
|
|
@ -1,79 +1,77 @@
|
||||||
cd ../../debug; cmake ..
|
|
||||||
cd ../../debug; make
|
|
||||||
cd ../../../debug; cmake ..
|
cd ../../../debug; cmake ..
|
||||||
cd ../../../debug; make
|
cd ../../../debug; make
|
||||||
|
|
||||||
./test.sh -u -f unique/account/account_create.sim
|
./test.sh -f unique/account/account_create.sim
|
||||||
./test.sh -u -f unique/account/account_delete.sim
|
./test.sh -f unique/account/account_delete.sim
|
||||||
./test.sh -u -f unique/account/account_len.sim
|
./test.sh -f unique/account/account_len.sim
|
||||||
./test.sh -u -f unique/account/authority.sim
|
./test.sh -f unique/account/authority.sim
|
||||||
./test.sh -u -f unique/account/basic.sim
|
./test.sh -f unique/account/basic.sim
|
||||||
./test.sh -u -f unique/account/paras.sim
|
./test.sh -f unique/account/paras.sim
|
||||||
./test.sh -u -f unique/account/pass_alter.sim
|
./test.sh -f unique/account/pass_alter.sim
|
||||||
./test.sh -u -f unique/account/pass_len.sim
|
./test.sh -f unique/account/pass_len.sim
|
||||||
./test.sh -u -f unique/account/usage.sim
|
./test.sh -f unique/account/usage.sim
|
||||||
./test.sh -u -f unique/account/user_create.sim
|
./test.sh -f unique/account/user_create.sim
|
||||||
./test.sh -u -f unique/account/user_len.sim
|
./test.sh -f unique/account/user_len.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/big/balance.sim
|
./test.sh -f unique/big/balance.sim
|
||||||
./test.sh -u -f unique/big/maxvnodes.sim
|
./test.sh -f unique/big/maxvnodes.sim
|
||||||
./test.sh -u -f unique/big/tcp.sim
|
./test.sh -f unique/big/tcp.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/cluster/balance1.sim
|
./test.sh -f unique/cluster/balance1.sim
|
||||||
./test.sh -u -f unique/cluster/balance2.sim
|
./test.sh -f unique/cluster/balance2.sim
|
||||||
./test.sh -u -f unique/cluster/balance3.sim
|
./test.sh -f unique/cluster/balance3.sim
|
||||||
./test.sh -u -f unique/cluster/cache.sim
|
./test.sh -f unique/cluster/cache.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/column/replica3.sim
|
./test.sh -f unique/column/replica3.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/db/commit.sim
|
./test.sh -f unique/db/commit.sim
|
||||||
./test.sh -u -f unique/db/delete.sim
|
./test.sh -f unique/db/delete.sim
|
||||||
./test.sh -u -f unique/db/delete_part.sim
|
./test.sh -f unique/db/delete_part.sim
|
||||||
./test.sh -u -f unique/db/replica_add12.sim
|
./test.sh -f unique/db/replica_add12.sim
|
||||||
./test.sh -u -f unique/db/replica_add13.sim
|
./test.sh -f unique/db/replica_add13.sim
|
||||||
./test.sh -u -f unique/db/replica_add23.sim
|
./test.sh -f unique/db/replica_add23.sim
|
||||||
./test.sh -u -f unique/db/replica_reduce21.sim
|
./test.sh -f unique/db/replica_reduce21.sim
|
||||||
./test.sh -u -f unique/db/replica_reduce32.sim
|
./test.sh -f unique/db/replica_reduce32.sim
|
||||||
./test.sh -u -f unique/db/replica_reduce31.sim
|
./test.sh -f unique/db/replica_reduce31.sim
|
||||||
./test.sh -u -f unique/db/replica_part.sim
|
./test.sh -f unique/db/replica_part.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/dnode/balance1.sim
|
./test.sh -f unique/dnode/balance1.sim
|
||||||
./test.sh -u -f unique/dnode/balance2.sim
|
./test.sh -f unique/dnode/balance2.sim
|
||||||
./test.sh -u -f unique/dnode/balance3.sim
|
./test.sh -f unique/dnode/balance3.sim
|
||||||
./test.sh -u -f unique/dnode/balancex.sim
|
./test.sh -f unique/dnode/balancex.sim
|
||||||
./test.sh -u -f unique/dnode/offline1.sim
|
./test.sh -f unique/dnode/offline1.sim
|
||||||
./test.sh -u -f unique/dnode/offline2.sim
|
./test.sh -f unique/dnode/offline2.sim
|
||||||
./test.sh -u -f unique/dnode/remove1.sim
|
./test.sh -f unique/dnode/remove1.sim
|
||||||
./test.sh -u -f unique/dnode/remove2.sim
|
./test.sh -f unique/dnode/remove2.sim
|
||||||
./test.sh -u -f unique/dnode/vnode_clean.sim
|
./test.sh -f unique/dnode/vnode_clean.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/http/admin.sim
|
./test.sh -f unique/http/admin.sim
|
||||||
./test.sh -u -f unique/http/opentsdb.sim
|
./test.sh -f unique/http/opentsdb.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/import/replica2.sim
|
./test.sh -f unique/import/replica2.sim
|
||||||
./test.sh -u -f unique/import/replica3.sim
|
./test.sh -f unique/import/replica3.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/stable/balance_replica1.sim
|
./test.sh -f unique/stable/balance_replica1.sim
|
||||||
./test.sh -u -f unique/stable/dnode2_stop.sim
|
./test.sh -f unique/stable/dnode2_stop.sim
|
||||||
./test.sh -u -f unique/stable/dnode2.sim
|
./test.sh -f unique/stable/dnode2.sim
|
||||||
./test.sh -u -f unique/stable/dnode3.sim
|
./test.sh -f unique/stable/dnode3.sim
|
||||||
./test.sh -u -f unique/stable/replica2_dnode4.sim
|
./test.sh -f unique/stable/replica2_dnode4.sim
|
||||||
./test.sh -u -f unique/stable/replica2_vnode3.sim
|
./test.sh -f unique/stable/replica2_vnode3.sim
|
||||||
./test.sh -u -f unique/stable/replica3_dnode6.sim
|
./test.sh -f unique/stable/replica3_dnode6.sim
|
||||||
./test.sh -u -f unique/stable/replica3_vnode3.sim
|
./test.sh -f unique/stable/replica3_vnode3.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/mnode/mgmt22.sim
|
./test.sh -f unique/mnode/mgmt22.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt23.sim
|
./test.sh -f unique/mnode/mgmt23.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt24.sim
|
./test.sh -f unique/mnode/mgmt24.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt25.sim
|
./test.sh -f unique/mnode/mgmt25.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt26.sim
|
./test.sh -f unique/mnode/mgmt26.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt33.sim
|
./test.sh -f unique/mnode/mgmt33.sim
|
||||||
./test.sh -u -f unique/mnode/mgmt34.sim
|
./test.sh -f unique/mnode/mgmt34.sim
|
||||||
./test.sh -u -f unique/mnode/mgmtr2.sim
|
./test.sh -f unique/mnode/mgmtr2.sim
|
||||||
|
|
||||||
./test.sh -u -f unique/vnode/many.sim
|
./test.sh -f unique/vnode/many.sim
|
||||||
./test.sh -u -f unique/vnode/replica2_basic2.sim
|
./test.sh -f unique/vnode/replica2_basic2.sim
|
||||||
./test.sh -u -f unique/vnode/replica2_repeat.sim
|
./test.sh -f unique/vnode/replica2_repeat.sim
|
||||||
./test.sh -u -f unique/vnode/replica3_basic.sim
|
./test.sh -f unique/vnode/replica3_basic.sim
|
||||||
./test.sh -u -f unique/vnode/replica3_repeat.sim
|
./test.sh -f unique/vnode/replica3_repeat.sim
|
||||||
./test.sh -u -f unique/vnode/replica3_vgroup.sim
|
./test.sh -f unique/vnode/replica3_vgroup.sim
|
||||||
|
|
|
@ -1,109 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# if [ $# != 4 || $# != 5 ]; then
|
|
||||||
# echo "argument list need input : "
|
|
||||||
# echo " -n nodeName"
|
|
||||||
# echo " -s start/stop"
|
|
||||||
# echo " -c clear"
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
|
|
||||||
NODE_NAME=
|
|
||||||
EXEC_OPTON=
|
|
||||||
CLEAR_OPTION="false"
|
|
||||||
while getopts "n:s:u:x:ct" arg
|
|
||||||
do
|
|
||||||
case $arg in
|
|
||||||
n)
|
|
||||||
NODE_NAME=$OPTARG
|
|
||||||
;;
|
|
||||||
s)
|
|
||||||
EXEC_OPTON=$OPTARG
|
|
||||||
;;
|
|
||||||
c)
|
|
||||||
CLEAR_OPTION="clear"
|
|
||||||
;;
|
|
||||||
t)
|
|
||||||
SHELL_OPTION="true"
|
|
||||||
;;
|
|
||||||
u)
|
|
||||||
USERS=$OPTARG
|
|
||||||
;;
|
|
||||||
x)
|
|
||||||
SIGNAL=$OPTARG
|
|
||||||
;;
|
|
||||||
?)
|
|
||||||
echo "unkown argument"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
SCRIPT_DIR=`dirname $0`
|
|
||||||
cd $SCRIPT_DIR/../
|
|
||||||
SCRIPT_DIR=`pwd`
|
|
||||||
|
|
||||||
TDINTERNAL="TDinternal"
|
|
||||||
if [[ "$SCRIPT_DIR" == *"$TDINTERNAL"* ]]; then
|
|
||||||
cd ../../..
|
|
||||||
else
|
|
||||||
cd ../../
|
|
||||||
fi
|
|
||||||
|
|
||||||
TAOS_DIR=`pwd`
|
|
||||||
|
|
||||||
BIN_DIR=`find . -name "taosd"|grep bin| cut -d '/' --fields=2,3`
|
|
||||||
|
|
||||||
BUILD_DIR=$TAOS_DIR/$BIN_DIR
|
|
||||||
|
|
||||||
SIM_DIR=$TAOS_DIR/sim
|
|
||||||
NODE_DIR=$SIM_DIR/$NODE_NAME
|
|
||||||
EXE_DIR=$BUILD_DIR/bin
|
|
||||||
CFG_DIR=$NODE_DIR/cfg
|
|
||||||
LOG_DIR=$NODE_DIR/log
|
|
||||||
DATA_DIR=$NODE_DIR/data
|
|
||||||
MGMT_DIR=$NODE_DIR/data/mgmt
|
|
||||||
TSDB_DIR=$NODE_DIR/data/tsdb
|
|
||||||
|
|
||||||
TAOS_CFG=$NODE_DIR/cfg/taos.cfg
|
|
||||||
|
|
||||||
echo ------------ $EXEC_OPTON $NODE_NAME
|
|
||||||
|
|
||||||
TAOS_FLAG=$SIM_DIR/tsim/flag
|
|
||||||
if [ -f "$TAOS_FLAG" ]; then
|
|
||||||
EXE_DIR=/usr/local/bin/taos
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$CLEAR_OPTION" = "clear" ]; then
|
|
||||||
echo rm -rf $MGMT_DIR $TSDB_DIR
|
|
||||||
rm -rf $TSDB_DIR
|
|
||||||
rm -rf $MGMT_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$EXEC_OPTON" = "start" ]; then
|
|
||||||
echo "ExcuteCmd:" $EXE_DIR/taosd -c $CFG_DIR
|
|
||||||
|
|
||||||
if [ "$SHELL_OPTION" = "true" ]; then
|
|
||||||
nohup valgrind --log-file=${LOG_DIR}/valgrind.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &
|
|
||||||
else
|
|
||||||
nohup $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &
|
|
||||||
fi
|
|
||||||
|
|
||||||
#TT=`date +%s`
|
|
||||||
#mkdir ${LOG_DIR}/${TT}
|
|
||||||
#echo valgrind --log-file=${LOG_DIR}/${TT}/valgrind.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR
|
|
||||||
#nohup valgrind --log-file=${LOG_DIR}/${TT}/valgrind.log --tool=memcheck --leak-check=full --show-reachable=no --track-origins=yes --show-leak-kinds=all -v --workaround-gcc296-bugs=yes $EXE_DIR/taosd -c $CFG_DIR > /dev/null 2>&1 &
|
|
||||||
|
|
||||||
else
|
|
||||||
#relative path
|
|
||||||
RCFG_DIR=sim/$NODE_NAME/cfg
|
|
||||||
PID=`ps -ef|grep taosd | grep $RCFG_DIR | grep -v grep | awk '{print $2}'`
|
|
||||||
if [ -n "$PID" ]; then
|
|
||||||
if [ "$SIGNAL" = "SIGINT" ]; then
|
|
||||||
echo killed by signal
|
|
||||||
kill -SIGINT $PID
|
|
||||||
else
|
|
||||||
kill -9 $PID
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
@ -77,4 +77,4 @@ if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -1,7 +1,7 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
@ -96,4 +96,4 @@ if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -1,7 +1,7 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
@ -89,4 +89,4 @@ if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -2,7 +2,7 @@ system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
||||||
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
|
system sh/cfg.sh -n dnode1 -c numOfTotalVnodes -v 8
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
@ -344,4 +344,4 @@ sql drop database d2
|
||||||
sql drop database d3
|
sql drop database d3
|
||||||
sql drop database d4
|
sql drop database d4
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -1,6 +1,6 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
|
@ -43,4 +43,4 @@ endi
|
||||||
print $data00 $data01 $data02
|
print $data00 $data01 $data02
|
||||||
print $data10 $data11 $data22
|
print $data10 $data11 $data22
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -1,6 +1,6 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
|
@ -111,4 +111,4 @@ if $data16 != 0.000/10.000 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -1,7 +1,7 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
@ -113,4 +113,4 @@ sql drop account oroot
|
||||||
sql drop user read
|
sql drop user read
|
||||||
sql drop user write
|
sql drop user write
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -1,7 +1,7 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
@ -78,4 +78,4 @@ if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -1,6 +1,6 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
|
@ -57,4 +57,4 @@ endi
|
||||||
print =============== check grant
|
print =============== check grant
|
||||||
sql_error create database d6
|
sql_error create database d6
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -1,7 +1,7 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
@ -81,4 +81,4 @@ step42:
|
||||||
|
|
||||||
sql drop user read
|
sql drop user read
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -1,7 +1,7 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
@ -91,4 +91,4 @@ if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -56,13 +56,13 @@ print ============== step0: start tarbitrator
|
||||||
system sh/exec_tarbitrator.sh -s start
|
system sh/exec_tarbitrator.sh -s start
|
||||||
|
|
||||||
print ============== step1: start dnode1, only deploy mnode
|
print ============== step1: start dnode1, only deploy mnode
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
print ============== step2: start dnode2/dnode3 and add into cluster, then create database, create table , and insert data
|
print ============== step2: start dnode2/dnode3 and add into cluster, then create database, create table , and insert data
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 1000
|
sleep 1000
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
|
@ -108,7 +108,7 @@ if $data00 != $totalRows then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step3: add one new dnode4 expect auto balancing
|
print ============== step3: add one new dnode4 expect auto balancing
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
sleep 10000
|
sleep 10000
|
||||||
sql select count(*) from $stb
|
sql select count(*) from $stb
|
||||||
|
@ -119,7 +119,7 @@ endi
|
||||||
|
|
||||||
|
|
||||||
print ============== step4: stop dnode3, after offlineThreshold, dnode3 will be dropped for cluster
|
print ============== step4: stop dnode3, after offlineThreshold, dnode3 will be dropped for cluster
|
||||||
system sh/exec_up.sh -n dnode3 -s stop
|
system sh/exec.sh -n dnode3 -s stop
|
||||||
sql select count(*) from $stb
|
sql select count(*) from $stb
|
||||||
print data00 $data00
|
print data00 $data00
|
||||||
if $data00 != $totalRows then
|
if $data00 != $totalRows then
|
||||||
|
@ -182,7 +182,7 @@ endi
|
||||||
print ============== step5: start dnode5 and add into cluster , drop database
|
print ============== step5: start dnode5 and add into cluster , drop database
|
||||||
sql drop database $db
|
sql drop database $db
|
||||||
sleep 1000
|
sleep 1000
|
||||||
system sh/exec_up.sh -n dnode5 -s start
|
system sh/exec.sh -n dnode5 -s start
|
||||||
sql create dnode $hostname5
|
sql create dnode $hostname5
|
||||||
sleep 3000
|
sleep 3000
|
||||||
wait_dnode5:
|
wait_dnode5:
|
||||||
|
|
|
@ -24,7 +24,7 @@ system sh/exec_tarbitrator.sh -s start
|
||||||
|
|
||||||
|
|
||||||
print ============== step1: replica is 1, and start 1 dnode
|
print ============== step1: replica is 1, and start 1 dnode
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ while $i < $tblNum
|
||||||
endw
|
endw
|
||||||
|
|
||||||
print ============== step2: add 1 new dnode, expect balanced
|
print ============== step2: add 1 new dnode, expect balanced
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
|
|
||||||
# expect after balanced, 2 vondes in dnode1, 1 vonde in dnode2
|
# expect after balanced, 2 vondes in dnode1, 1 vonde in dnode2
|
||||||
|
@ -81,7 +81,7 @@ if $data2_2 != 1 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step4: stop dnode1, and wait dnode2 master
|
print ============== step4: stop dnode1, and wait dnode2 master
|
||||||
system sh/exec_up.sh -n dnode1 -s stop
|
system sh/exec.sh -n dnode1 -s stop
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
loop_wait:
|
loop_wait:
|
||||||
|
|
|
@ -20,7 +20,7 @@ system sh/cfg.sh -n dnode5 -c numOfTotalVnodes -v 4
|
||||||
system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 1000
|
system sh/cfg.sh -n dnode5 -c maxtablesPerVnode -v 1000
|
||||||
|
|
||||||
print =============== prepare data
|
print =============== prepare data
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ endi
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show1:
|
show1:
|
||||||
|
@ -142,7 +142,7 @@ endi
|
||||||
|
|
||||||
print ========== step2
|
print ========== step2
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 10000
|
sleep 10000
|
||||||
|
|
||||||
print ========== step3
|
print ========== step3
|
||||||
|
@ -170,7 +170,7 @@ if $data2_3 != 2 then
|
||||||
goto show3
|
goto show3
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
@ -226,7 +226,7 @@ if $data2_3 != null then
|
||||||
goto show4
|
goto show4
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
|
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
@ -262,7 +262,7 @@ if $data00 != $totalNum then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========== step5
|
print ========== step5
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
|
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
@ -319,11 +319,11 @@ if $data00 != $totalNum then
|
||||||
goto show5
|
goto show5
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -15,7 +15,7 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v $totalVnodes
|
||||||
|
|
||||||
|
|
||||||
print ========== prepare data
|
print ========== prepare data
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
sql create database db blocks 2 cache 1 maxTables $maxTables
|
sql create database db blocks 2 cache 1 maxTables $maxTables
|
||||||
|
@ -45,7 +45,7 @@ endi
|
||||||
|
|
||||||
print ========== step3
|
print ========== step3
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show3:
|
show3:
|
||||||
|
@ -78,11 +78,11 @@ endi
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -15,7 +15,7 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v $totalVnodes
|
||||||
|
|
||||||
|
|
||||||
print ========== prepare data
|
print ========== prepare data
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
sql create database db blocks 2 cache 1 maxTables $maxTables
|
sql create database db blocks 2 cache 1 maxTables $maxTables
|
||||||
|
@ -33,11 +33,11 @@ while $x < $totalRows
|
||||||
endw
|
endw
|
||||||
|
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -14,7 +14,7 @@ system sh/cfg.sh -n dnode1 -c adminDebugFlag -v 131
|
||||||
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
|
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
|
||||||
system sh/cfg.sh -n dnode1 -c debugFlag -v 131
|
system sh/cfg.sh -n dnode1 -c debugFlag -v 131
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
print ======================== dnode1 start
|
print ======================== dnode1 start
|
||||||
|
@ -104,11 +104,11 @@ while $i < 10
|
||||||
$i = $i + 1
|
$i = $i + 1
|
||||||
endw
|
endw
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
||||||
|
|
|
@ -46,7 +46,7 @@ system sh/cfg.sh -n dnode8 -c wallevel -v 1
|
||||||
|
|
||||||
print ============== step1
|
print ============== step1
|
||||||
print ========= start dnode1
|
print ========= start dnode1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql create database c_b1_d1 maxTables 4
|
sql create database c_b1_d1 maxTables 4
|
||||||
|
@ -85,7 +85,7 @@ print ============================== step2
|
||||||
print ========= start dnode2
|
print ========= start dnode2
|
||||||
sleep 2000
|
sleep 2000
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -162,9 +162,9 @@ print dnode4 ==> $dnode4Role
|
||||||
|
|
||||||
print ============================== step5
|
print ============================== step5
|
||||||
print ========= add dnode2
|
print ========= add dnode2
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 3000
|
sleep 3000
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
sleep 9000
|
sleep 9000
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ endi
|
||||||
|
|
||||||
print ============================== step9
|
print ============================== step9
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
sleep 9000
|
sleep 9000
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -333,7 +333,7 @@ sql_error create table c_b1_t5 (t timestamp, i int) -x error3
|
||||||
|
|
||||||
print ============================== step13
|
print ============================== step13
|
||||||
sql create dnode $hostname5
|
sql create dnode $hostname5
|
||||||
system sh/exec_up.sh -n dnode5 -s start
|
system sh/exec.sh -n dnode5 -s start
|
||||||
sleep 9000
|
sleep 9000
|
||||||
|
|
||||||
sql show mnodes
|
sql show mnodes
|
||||||
|
@ -381,7 +381,7 @@ endi
|
||||||
|
|
||||||
print ============================== step14
|
print ============================== step14
|
||||||
sql create dnode $hostname6
|
sql create dnode $hostname6
|
||||||
system sh/exec_up.sh -n dnode6 -s start
|
system sh/exec.sh -n dnode6 -s start
|
||||||
sleep 15000
|
sleep 15000
|
||||||
|
|
||||||
sql create database c_b1_d7 maxTables 4
|
sql create database c_b1_d7 maxTables 4
|
||||||
|
@ -554,11 +554,11 @@ if $data41 != 85 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============================================ over=
|
print ============================================ over=
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -46,14 +46,14 @@ system sh/cfg.sh -n dnode8 -c mnodeEqualVnodeNum -v 0
|
||||||
|
|
||||||
print ============== step1
|
print ============== step1
|
||||||
print ========= start dnode1
|
print ========= start dnode1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sql connect
|
sql connect
|
||||||
sleep 4001
|
sleep 4001
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 4001
|
sleep 4001
|
||||||
|
|
||||||
sql create database c_b2_d1 replica 2 maxTables 4
|
sql create database c_b2_d1 replica 2 maxTables 4
|
||||||
|
@ -148,12 +148,12 @@ print dnode2 ==> $dnode2Role
|
||||||
print dnode3 ==> $dnode3Role
|
print dnode3 ==> $dnode3Role
|
||||||
print dnode4 ==> $dnode4Role
|
print dnode4 ==> $dnode4Role
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
||||||
print ============================== step3
|
print ============================== step3
|
||||||
print ========= start dnode4
|
print ========= start dnode4
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
sleep 10000
|
sleep 10000
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -259,12 +259,12 @@ if $dnode4Role != slave then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
|
|
||||||
print ============================== step5
|
print ============================== step5
|
||||||
print ========= start dnode3
|
print ========= start dnode3
|
||||||
sql create dnode $hostname5
|
sql create dnode $hostname5
|
||||||
system sh/exec_up.sh -n dnode5 -s start
|
system sh/exec.sh -n dnode5 -s start
|
||||||
sleep 9000
|
sleep 9000
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -301,7 +301,7 @@ print dnode4 ==> $dnode4Role
|
||||||
print dnode5 ==> $dnode5Role
|
print dnode5 ==> $dnode5Role
|
||||||
|
|
||||||
print ============================== step6
|
print ============================== step6
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
print stop dnode1 and sleep 10000
|
print stop dnode1 and sleep 10000
|
||||||
sleep 10000
|
sleep 10000
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ if $dnode1Role != offline then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============================== step6.1
|
print ============================== step6.1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show6:
|
show6:
|
||||||
|
@ -357,7 +357,7 @@ print dnode1 ==> $dnode1Role
|
||||||
print dnode4 ==> $dnode4Role
|
print dnode4 ==> $dnode4Role
|
||||||
print dnode5 ==> $dnode5Role
|
print dnode5 ==> $dnode5Role
|
||||||
|
|
||||||
#system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
#system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
||||||
print ============================== step12
|
print ============================== step12
|
||||||
print ========= check data
|
print ========= check data
|
||||||
|
@ -421,11 +421,11 @@ if $data41 != 35 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============================================ over
|
print ============================================ over
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
||||||
|
|
|
@ -47,14 +47,14 @@ system sh/cfg.sh -n dnode8 -c wallevel -v 1
|
||||||
|
|
||||||
print ============== step1
|
print ============== step1
|
||||||
print ========= start dnode1
|
print ========= start dnode1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sleep 2001
|
sleep 2001
|
||||||
|
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 3001
|
sleep 3001
|
||||||
|
|
||||||
sql create database c_b3_d1 replica 3
|
sql create database c_b3_d1 replica 3
|
||||||
|
@ -117,7 +117,7 @@ endi
|
||||||
print ============================== step2
|
print ============================== step2
|
||||||
print ========= start dnode4
|
print ========= start dnode4
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
sleep 9000
|
sleep 9000
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -176,11 +176,11 @@ if $dnode4Vnodes != 3 then
|
||||||
goto show3
|
goto show3
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
||||||
print ============================== step4
|
print ============================== step4
|
||||||
sql create dnode $hostname5
|
sql create dnode $hostname5
|
||||||
system sh/exec_up.sh -n dnode5 -s start
|
system sh/exec.sh -n dnode5 -s start
|
||||||
sleep 10000
|
sleep 10000
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -239,11 +239,11 @@ if $dnode4Vnodes != 3 then
|
||||||
goto show5
|
goto show5
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
|
|
||||||
print ============================== step6
|
print ============================== step6
|
||||||
sql create dnode $hostname6
|
sql create dnode $hostname6
|
||||||
system sh/exec_up.sh -n dnode6 -s start
|
system sh/exec.sh -n dnode6 -s start
|
||||||
sleep 9000
|
sleep 9000
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -302,11 +302,11 @@ if $dnode4Vnodes != null then
|
||||||
goto show7
|
goto show7
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
|
|
||||||
print ============================== step8
|
print ============================== step8
|
||||||
sql create dnode $hostname7
|
sql create dnode $hostname7
|
||||||
system sh/exec_up.sh -n dnode7 -s start
|
system sh/exec.sh -n dnode7 -s start
|
||||||
sleep 9000
|
sleep 9000
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -332,7 +332,7 @@ endi
|
||||||
|
|
||||||
print ============================== step9
|
print ============================== step9
|
||||||
print ========= drop dnode1
|
print ========= drop dnode1
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
print stop dnode1 and sleep 10000
|
print stop dnode1 and sleep 10000
|
||||||
sleep 10000
|
sleep 10000
|
||||||
|
|
||||||
|
@ -353,7 +353,7 @@ if $dnode1Role != offline then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============================== step9.1
|
print ============================== step9.1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show9:
|
show9:
|
||||||
|
@ -380,7 +380,7 @@ if $dnode7Vnodes != 3 then
|
||||||
goto show9
|
goto show9
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
||||||
print ============================== step11
|
print ============================== step11
|
||||||
print ========= add db4
|
print ========= add db4
|
||||||
|
@ -428,7 +428,7 @@ if $dnode7Vnodes != 4 then
|
||||||
goto show11
|
goto show11
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
||||||
print ============================== step13
|
print ============================== step13
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
|
@ -492,11 +492,11 @@ if $data41 != 35 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============================================ over
|
print ============================================ over
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
||||||
|
|
|
@ -10,12 +10,12 @@ system sh/cfg.sh -n dnode1 -c numOfMnodes -v 3
|
||||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
|
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
|
||||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
|
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
|
||||||
sql create database db replica 3
|
sql create database db replica 3
|
||||||
sql use db
|
sql use db
|
||||||
|
@ -33,11 +33,11 @@ sql_error create database d1 replica 2 wal 0
|
||||||
sql create database d2 replica 1 wal 0
|
sql create database d2 replica 1 wal 0
|
||||||
sql_error alter database d2 replica 2
|
sql_error alter database d2 replica 2
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -14,13 +14,13 @@ system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 4
|
||||||
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
|
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 4
|
||||||
|
|
||||||
print ========= start dnode1 as master
|
print ========= start dnode1 as master
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
print ========= start other dnodes
|
print ========= start other dnodes
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
print ======== step1 create db
|
print ======== step1 create db
|
||||||
|
@ -47,9 +47,9 @@ if $data01 != 40 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ======== step2 stop dnode
|
print ======== step2 stop dnode
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql select * from tb order by ts desc
|
sql select * from tb order by ts desc
|
||||||
|
@ -98,9 +98,9 @@ if $data01 != 40 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ======== step5 stop dnode
|
print ======== step5 stop dnode
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql select * from tb
|
sql select * from tb
|
||||||
|
@ -115,11 +115,11 @@ if $data01 != 40 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -14,13 +14,13 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 10
|
||||||
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
|
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 10
|
||||||
|
|
||||||
print ========= start dnodes
|
print ========= start dnodes
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
sql create database db replica 3 blocks 2 maxtables 1000
|
sql create database db replica 3 blocks 2 maxtables 1000
|
||||||
|
@ -65,14 +65,14 @@ endi
|
||||||
|
|
||||||
print ======== step3
|
print ======== step3
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
|
|
||||||
sleep 1000
|
sleep 1000
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
step3:
|
step3:
|
||||||
|
@ -90,11 +90,11 @@ endi
|
||||||
|
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -30,11 +30,11 @@ system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||||
|
|
||||||
print ========= start dnodes
|
print ========= start dnodes
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
$loop = 0
|
$loop = 0
|
||||||
begin:
|
begin:
|
||||||
|
@ -137,14 +137,14 @@ begin:
|
||||||
|
|
||||||
print ======== step2 $loop
|
print ======== step2 $loop
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop
|
system sh/exec.sh -n dnode2 -s stop
|
||||||
sleep 1000
|
sleep 1000
|
||||||
print ==> drop database $db
|
print ==> drop database $db
|
||||||
sql drop database $db
|
sql drop database $db
|
||||||
|
|
||||||
print ======== step3 $loop
|
print ======== step3 $loop
|
||||||
sleep 2000
|
sleep 2000
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 15000
|
sleep 15000
|
||||||
|
|
||||||
sql show dnodes
|
sql show dnodes
|
||||||
|
@ -175,11 +175,11 @@ begin:
|
||||||
|
|
||||||
goto begin
|
goto begin
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -26,12 +26,12 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
||||||
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
||||||
|
|
||||||
print ========= start dnodes
|
print ========= start dnodes
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
|
@ -145,7 +145,7 @@ sql reset query cache
|
||||||
sleep 2000
|
sleep 2000
|
||||||
|
|
||||||
print ========= step5
|
print ========= step5
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql select * from d1.t1
|
sql select * from d1.t1
|
||||||
|
@ -196,7 +196,7 @@ if $rows != 2 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step6
|
print ========= step6
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(now, 3)
|
sql insert into d1.t1 values(now, 3)
|
||||||
|
@ -226,7 +226,7 @@ endi
|
||||||
|
|
||||||
print ========= step61
|
print ========= step61
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql_error insert into d1.t1 values(now, 3)
|
sql_error insert into d1.t1 values(now, 3)
|
||||||
|
@ -255,7 +255,7 @@ if $rows != 3 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step7
|
print ========= step7
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(now, 5)
|
sql insert into d1.t1 values(now, 5)
|
||||||
|
@ -283,11 +283,11 @@ if $rows != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -26,14 +26,14 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
||||||
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
||||||
|
|
||||||
print ========= start dnodes
|
print ========= start dnodes
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
|
@ -139,7 +139,7 @@ endi
|
||||||
print ========= step5
|
print ========= step5
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 1000
|
sleep 1000
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(1589529000013, 3)
|
sql insert into d1.t1 values(1589529000013, 3)
|
||||||
|
@ -168,9 +168,9 @@ if $rows != 3 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step6
|
print ========= step6
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql insert into d1.t1 values(1589529000014, 4)
|
sql insert into d1.t1 values(1589529000014, 4)
|
||||||
|
@ -203,9 +203,9 @@ if $rows != 4 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step7
|
print ========= step7
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql insert into d1.t1 values(1589529000015, 5)
|
sql insert into d1.t1 values(1589529000015, 5)
|
||||||
|
@ -234,9 +234,9 @@ if $rows != 5 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step8
|
print ========= step8
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql insert into d1.t1 values(1589529000016, 6)
|
sql insert into d1.t1 values(1589529000016, 6)
|
||||||
|
@ -264,11 +264,11 @@ if $rows != 6 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -26,14 +26,14 @@ system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
||||||
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
system sh/cfg.sh -n dnode4 -c numOfTotalVnodes -v 4
|
||||||
|
|
||||||
print ========= start dnodes
|
print ========= start dnodes
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
|
@ -140,7 +140,7 @@ sql reset query cache
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
|
||||||
print ========= step5
|
print ========= step5
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(1588262400003, 3)
|
sql insert into d1.t1 values(1588262400003, 3)
|
||||||
|
@ -169,9 +169,9 @@ if $rows != 3 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step6
|
print ========= step6
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(1588262400004, 4)
|
sql insert into d1.t1 values(1588262400004, 4)
|
||||||
|
@ -200,9 +200,9 @@ if $rows != 4 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step7
|
print ========= step7
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(1588262400005, 5)
|
sql insert into d1.t1 values(1588262400005, 5)
|
||||||
|
@ -231,9 +231,9 @@ if $rows != 5 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step8
|
print ========= step8
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(1588262400006, 6)
|
sql insert into d1.t1 values(1588262400006, 6)
|
||||||
|
@ -261,11 +261,11 @@ if $rows != 6 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -18,12 +18,12 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
|
||||||
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
||||||
|
|
||||||
print ========= start dnodes
|
print ========= start dnodes
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
|
@ -63,7 +63,7 @@ if $rows != 1 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step2 alter db
|
print ========= step2 alter db
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
sql alter database d1 replica 2
|
sql alter database d1 replica 2
|
||||||
sql alter database d2 replica 2
|
sql alter database d2 replica 2
|
||||||
|
@ -72,7 +72,7 @@ sql alter database d4 replica 2
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
print ========= step3
|
print ========= step3
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 10000
|
sleep 10000
|
||||||
|
|
||||||
print ========= step4
|
print ========= step4
|
||||||
|
@ -102,7 +102,7 @@ if $rows != 2 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step5
|
print ========= step5
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
|
@ -118,9 +118,9 @@ sql insert into d4.t4 values(now, 3) -x s4
|
||||||
s4:
|
s4:
|
||||||
|
|
||||||
print ========= step6
|
print ========= step6
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(now, 4) -x s5
|
sql insert into d1.t1 values(now, 4) -x s5
|
||||||
|
@ -133,7 +133,7 @@ sql insert into d4.t4 values(now, 4) -x s8
|
||||||
s8:
|
s8:
|
||||||
|
|
||||||
print ========= step7
|
print ========= step7
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(now, 5)
|
sql insert into d1.t1 values(now, 5)
|
||||||
|
@ -146,11 +146,11 @@ sql select * from d2.t2
|
||||||
sql select * from d3.t3
|
sql select * from d3.t3
|
||||||
sql select * from d4.t4
|
sql select * from d4.t4
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -18,10 +18,10 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
|
||||||
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
||||||
|
|
||||||
print ========= start dnodes
|
print ========= start dnodes
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
|
@ -117,7 +117,7 @@ if $rows != 2 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ======== step9 stop dnode2
|
print ======== step9 stop dnode2
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql insert into d5.t5 values(now, 3)
|
sql insert into d5.t5 values(now, 3)
|
||||||
|
@ -145,11 +145,11 @@ if $rows != 3 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -18,12 +18,12 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
|
||||||
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
||||||
|
|
||||||
print ========= start dnodes
|
print ========= start dnodes
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
|
@ -139,7 +139,7 @@ if $rows != 3 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========= step4
|
print ========= step4
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
|
@ -155,9 +155,9 @@ sql insert into d4.t4 values(now, 4) -x step4
|
||||||
step4:
|
step4:
|
||||||
|
|
||||||
print ========= step5
|
print ========= step5
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(now, 5) -x step5
|
sql insert into d1.t1 values(now, 5) -x step5
|
||||||
|
@ -170,7 +170,7 @@ sql insert into d4.t4 values(now, 5) -x step8
|
||||||
step8:
|
step8:
|
||||||
|
|
||||||
print ========= step6
|
print ========= step6
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(now, 6)
|
sql insert into d1.t1 values(now, 6)
|
||||||
|
@ -183,11 +183,11 @@ sql select * from d2.t2
|
||||||
sql select * from d3.t3
|
sql select * from d3.t3
|
||||||
sql select * from d4.t4
|
sql select * from d4.t4
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -18,12 +18,12 @@ system sh/cfg.sh -n dnode2 -c numOfTotalVnodes -v 4
|
||||||
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
system sh/cfg.sh -n dnode3 -c numOfTotalVnodes -v 4
|
||||||
|
|
||||||
print ========= start dnodes
|
print ========= start dnodes
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
print ======== step1
|
print ======== step1
|
||||||
|
@ -99,7 +99,7 @@ sql reset query cache
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
|
||||||
print ========= step4
|
print ========= step4
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(now, 3) -x step1
|
sql insert into d1.t1 values(now, 3) -x step1
|
||||||
|
@ -117,10 +117,10 @@ sql select * from d3.t3
|
||||||
sql select * from d4.t4
|
sql select * from d4.t4
|
||||||
|
|
||||||
print ========= step5
|
print ========= step5
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
|
@ -136,7 +136,7 @@ sql insert into d4.t4 values(now, 3) -x step41
|
||||||
step41:
|
step41:
|
||||||
|
|
||||||
print ========= step6
|
print ========= step6
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
sql insert into d1.t1 values(now, 5)
|
sql insert into d1.t1 values(now, 5)
|
||||||
|
@ -156,11 +156,11 @@ print d3.t3 $rows
|
||||||
sql select * from d4.t4
|
sql select * from d4.t4
|
||||||
print d4.t4 $rows
|
print d4.t4 $rows
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -17,13 +17,13 @@ system sh/cfg.sh -n dnode2 -c numOfMnodes -v 3
|
||||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
|
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 3
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql show dnodes
|
sql show dnodes
|
||||||
|
@ -81,11 +81,11 @@ if $data2_3 != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -26,7 +26,7 @@ system sh/cfg.sh -n dnode3 -c wallevel -v 2
|
||||||
system sh/cfg.sh -n dnode4 -c wallevel -v 2
|
system sh/cfg.sh -n dnode4 -c wallevel -v 2
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ endi
|
||||||
print ========== step2
|
print ========== step2
|
||||||
sleep 2000
|
sleep 2000
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show2:
|
show2:
|
||||||
|
@ -110,11 +110,11 @@ if $rows != 1 then
|
||||||
goto show4
|
goto show4
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
||||||
print ========== step5
|
print ========== step5
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show5:
|
show5:
|
||||||
|
@ -164,7 +164,7 @@ endi
|
||||||
|
|
||||||
print ========== step7
|
print ========== step7
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show7:
|
show7:
|
||||||
|
@ -250,7 +250,7 @@ if $data2_4 != 4 then
|
||||||
goto show9
|
goto show9
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
|
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
@ -328,11 +328,11 @@ if $data41 != 45 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -19,13 +19,13 @@ system sh/cfg.sh -n dnode4 -c wallevel -v 1
|
||||||
system sh/cfg.sh -n dnode5 -c wallevel -v 1
|
system sh/cfg.sh -n dnode5 -c wallevel -v 1
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql create database d1 replica 2 maxTables 4
|
sql create database d1 replica 2 maxTables 4
|
||||||
|
@ -83,11 +83,11 @@ if $data2_3 != 2 then
|
||||||
goto show2
|
goto show2
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
||||||
print ========== step3
|
print ========== step3
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show3:
|
show3:
|
||||||
|
@ -144,7 +144,7 @@ endi
|
||||||
|
|
||||||
print ========== step5
|
print ========== step5
|
||||||
sql create dnode $hostname5
|
sql create dnode $hostname5
|
||||||
system sh/exec_up.sh -n dnode5 -s start
|
system sh/exec.sh -n dnode5 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show5:
|
show5:
|
||||||
|
@ -209,7 +209,7 @@ if $data2_5 != 3 then
|
||||||
goto show6
|
goto show6
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
@ -269,11 +269,11 @@ if $data41 != 35 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -22,15 +22,15 @@ system sh/cfg.sh -n dnode5 -c wallevel -v 1
|
||||||
system sh/cfg.sh -n dnode6 -c wallevel -v 1
|
system sh/cfg.sh -n dnode6 -c wallevel -v 1
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql create database d1 replica 3 maxTables 4
|
sql create database d1 replica 3 maxTables 4
|
||||||
|
@ -98,11 +98,11 @@ if $data2_4 != 2 then
|
||||||
goto show2
|
goto show2
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
||||||
print ========== step
|
print ========== step
|
||||||
sql create dnode $hostname5
|
sql create dnode $hostname5
|
||||||
system sh/exec_up.sh -n dnode5 -s start
|
system sh/exec.sh -n dnode5 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show3:
|
show3:
|
||||||
|
@ -178,7 +178,7 @@ endi
|
||||||
print ========== step5
|
print ========== step5
|
||||||
sql create dnode $hostname6
|
sql create dnode $hostname6
|
||||||
system sh/deploy.sh -n dnode6 -i 6
|
system sh/deploy.sh -n dnode6 -i 6
|
||||||
system sh/exec_up.sh -n dnode6 -s start
|
system sh/exec.sh -n dnode6 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show5:
|
show5:
|
||||||
|
@ -238,7 +238,7 @@ if $data2_5 != 3 then
|
||||||
goto show6
|
goto show6
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
|
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
@ -298,11 +298,11 @@ if $data41 != 35 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -16,7 +16,7 @@ system sh/cfg.sh -n dnode3 -c wallevel -v 1
|
||||||
system sh/cfg.sh -n dnode4 -c wallevel -v 1
|
system sh/cfg.sh -n dnode4 -c wallevel -v 1
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ endi
|
||||||
|
|
||||||
print ========== step2
|
print ========== step2
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show2:
|
show2:
|
||||||
|
@ -92,7 +92,7 @@ endi
|
||||||
|
|
||||||
print ========== step3
|
print ========== step3
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show4:
|
show4:
|
||||||
|
@ -139,7 +139,7 @@ if $data2_3 != 3 then
|
||||||
goto show5
|
goto show5
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
||||||
sql reset query cache
|
sql reset query cache
|
||||||
sleep 1000
|
sleep 1000
|
||||||
|
@ -199,11 +199,11 @@ if $data41 != 35 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -1,8 +1,8 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/deploy.sh -n dnode2 -i 2
|
system sh/deploy.sh -n dnode2 -i 2
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
print =============== show dnodes
|
print =============== show dnodes
|
||||||
|
|
|
@ -13,7 +13,7 @@ system sh/cfg.sh -n dnode1 -c monitor -v 1
|
||||||
system sh/cfg.sh -n dnode2 -c monitor -v 0
|
system sh/cfg.sh -n dnode2 -c monitor -v 0
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ endi
|
||||||
|
|
||||||
print ========== step2
|
print ========== step2
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show2:
|
show2:
|
||||||
|
|
|
@ -21,10 +21,10 @@ system sh/cfg.sh -n dnode2 -c wallevel -v 1
|
||||||
system sh/cfg.sh -n dnode3 -c wallevel -v 1
|
system sh/cfg.sh -n dnode3 -c wallevel -v 1
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql show dnodes
|
sql show dnodes
|
||||||
|
@ -39,7 +39,7 @@ if $data4_2 != ready then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========== step2
|
print ========== step2
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 8000
|
sleep 8000
|
||||||
|
|
||||||
sql show dnodes
|
sql show dnodes
|
||||||
|
@ -67,11 +67,11 @@ if $data4_2 != null then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -21,10 +21,10 @@ system sh/cfg.sh -n dnode2 -c wallevel -v 1
|
||||||
system sh/cfg.sh -n dnode3 -c wallevel -v 1
|
system sh/cfg.sh -n dnode3 -c wallevel -v 1
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
|
||||||
sql create database d1 replica 2 maxTables 4
|
sql create database d1 replica 2 maxTables 4
|
||||||
|
@ -43,7 +43,7 @@ if $data4_2 != ready then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========== step2
|
print ========== step2
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 8000
|
sleep 8000
|
||||||
|
|
||||||
sql show dnodes
|
sql show dnodes
|
||||||
|
@ -73,8 +73,8 @@ endi
|
||||||
|
|
||||||
print ========== step4
|
print ========== step4
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql drop dnode $hostname2
|
sql drop dnode $hostname2
|
||||||
|
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
@ -109,11 +109,11 @@ if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -16,7 +16,7 @@ system sh/cfg.sh -n dnode3 -c wallevel -v 1
|
||||||
system sh/cfg.sh -n dnode4 -c wallevel -v 1
|
system sh/cfg.sh -n dnode4 -c wallevel -v 1
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ endi
|
||||||
|
|
||||||
print ========== step2
|
print ========== step2
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 9000
|
sleep 9000
|
||||||
|
|
||||||
sql create database d3 replica 2 maxTables 4
|
sql create database d3 replica 2 maxTables 4
|
||||||
|
@ -91,7 +91,7 @@ print dnode2 openVnodes $data2_2
|
||||||
|
|
||||||
print ========== step4
|
print ========== step4
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show4:
|
show4:
|
||||||
|
@ -109,11 +109,11 @@ if $data2_2 != null then
|
||||||
goto show4
|
goto show4
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
||||||
print ========== step5
|
print ========== step5
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show5:
|
show5:
|
||||||
|
@ -195,11 +195,11 @@ if $data41 != 35 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -16,7 +16,7 @@ system sh/cfg.sh -n dnode3 -c wallevel -v 2
|
||||||
system sh/cfg.sh -n dnode4 -c wallevel -v 2
|
system sh/cfg.sh -n dnode4 -c wallevel -v 2
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ endi
|
||||||
|
|
||||||
print ========== step2
|
print ========== step2
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 9000
|
sleep 9000
|
||||||
|
|
||||||
sql create database d3 replica 2 maxTables 4
|
sql create database d3 replica 2 maxTables 4
|
||||||
|
@ -74,7 +74,7 @@ if $data2_2 != 3 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ========== step3
|
print ========== step3
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sql drop dnode $hostname2
|
sql drop dnode $hostname2
|
||||||
sleep 4000
|
sleep 4000
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ print dnode2 openVnodes $data2_2
|
||||||
|
|
||||||
print ========== step4
|
print ========== step4
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ if $data2_3 != 0 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============ step 4.1
|
print ============ step 4.1
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show4:
|
show4:
|
||||||
|
@ -146,11 +146,11 @@ if $data41 != 35 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -16,7 +16,7 @@ system sh/cfg.sh -n dnode3 -c wallevel -v 1
|
||||||
system sh/cfg.sh -n dnode4 -c wallevel -v 1
|
system sh/cfg.sh -n dnode4 -c wallevel -v 1
|
||||||
|
|
||||||
print ========== step1
|
print ========== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql create database d1 maxTables 4
|
sql create database d1 maxTables 4
|
||||||
|
@ -35,7 +35,7 @@ endi
|
||||||
|
|
||||||
print ========== step2
|
print ========== step2
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show2:
|
show2:
|
||||||
|
@ -98,12 +98,12 @@ if $rows != 1 then
|
||||||
goto show4
|
goto show4
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
|
|
||||||
print ========== step5
|
print ========== step5
|
||||||
sleep 2000
|
sleep 2000
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show5:
|
show5:
|
||||||
|
@ -143,7 +143,7 @@ endi
|
||||||
|
|
||||||
print ========== step7
|
print ========== step7
|
||||||
sql create dnode $hostname4
|
sql create dnode $hostname4
|
||||||
system sh/exec_up.sh -n dnode4 -s start
|
system sh/exec.sh -n dnode4 -s start
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
show7:
|
show7:
|
||||||
|
@ -222,7 +222,7 @@ if $data2_4 != 4 then
|
||||||
goto show9
|
goto show9
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
|
|
||||||
print ========== step10
|
print ========== step10
|
||||||
sql select * from d1.t1 order by t desc
|
sql select * from d1.t1 order by t desc
|
||||||
|
@ -297,11 +297,11 @@ if $data41 != 45 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -5,7 +5,7 @@ system sh/cfg.sh -n dnode1 -c http -v 1
|
||||||
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
||||||
#system sh/cfg.sh -n dnode1 -c adminRowLimit -v 10
|
#system sh/cfg.sh -n dnode1 -c adminRowLimit -v 10
|
||||||
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
|
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sql connect
|
sql connect
|
||||||
sleep 3000
|
sleep 3000
|
||||||
|
@ -179,11 +179,11 @@ print =============== step8 - monitor dbs
|
||||||
# return -1
|
# return -1
|
||||||
# endi
|
# endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -4,7 +4,7 @@ system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/cfg.sh -n dnode1 -c http -v 1
|
system sh/cfg.sh -n dnode1 -c http -v 1
|
||||||
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
system sh/cfg.sh -n dnode1 -c wallevel -v 0
|
||||||
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
|
system sh/cfg.sh -n dnode1 -c httpDebugFlag -v 135
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
|
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
@ -238,11 +238,11 @@ if $system_content != @{"status":"succ","head":["count(*)"],"data":[[8]],"rows":
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -26,12 +26,12 @@ system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||||
|
|
||||||
print ========= start dnode1
|
print ========= start dnode1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
|
|
||||||
sql create database ir2db replica 2 days 7
|
sql create database ir2db replica 2 days 7
|
||||||
sql use ir2db
|
sql use ir2db
|
||||||
|
@ -95,9 +95,9 @@ if $rows != 14 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ================== dnode restart
|
print ================== dnode restart
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
sql select * from tb;
|
sql select * from tb;
|
||||||
if $rows != 14 then
|
if $rows != 14 then
|
||||||
|
@ -162,9 +162,9 @@ if $rows != 35 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ================= step10
|
print ================= step10
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
sql select * from tb;
|
sql select * from tb;
|
||||||
print $rows
|
print $rows
|
||||||
|
@ -192,9 +192,9 @@ if $rows != 49 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ================= step13
|
print ================= step13
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
print ================= step14
|
print ================= step14
|
||||||
|
@ -213,20 +213,20 @@ if $rows != 52 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ================= step15
|
print ================= step15
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
if $rows != 52 then
|
if $rows != 52 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -26,14 +26,14 @@ system sh/cfg.sh -n dnode3 -c walLevel -v 2
|
||||||
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
system sh/cfg.sh -n dnode4 -c walLevel -v 2
|
||||||
|
|
||||||
print ========= start dnode1
|
print ========= start dnode1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
|
|
||||||
|
|
||||||
sql create database ir3db replica 3 days 7
|
sql create database ir3db replica 3 days 7
|
||||||
|
@ -98,9 +98,9 @@ if $rows != 14 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ================== dnode restart
|
print ================== dnode restart
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
sql select * from tb;
|
sql select * from tb;
|
||||||
if $rows != 14 then
|
if $rows != 14 then
|
||||||
|
@ -165,9 +165,9 @@ if $rows != 35 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ================= step10
|
print ================= step10
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
sql select * from tb;
|
sql select * from tb;
|
||||||
print $rows
|
print $rows
|
||||||
|
@ -195,9 +195,9 @@ if $rows != 49 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ================= step13
|
print ================= step13
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
print ================= step14
|
print ================= step14
|
||||||
|
@ -216,20 +216,20 @@ if $rows != 52 then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ================= step15
|
print ================= step15
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
sleep 5000
|
sleep 5000
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
if $rows != 52 then
|
if $rows != 52 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -8,7 +8,7 @@ system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
|
||||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
|
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
|
||||||
|
|
||||||
print ============== step1
|
print ============== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 3000
|
sleep 3000
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ if $data2_1 != master then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step2
|
print ============== step2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -46,7 +46,7 @@ sql_error drop dnode $hostname1 -x error1
|
||||||
print should not drop master
|
print should not drop master
|
||||||
|
|
||||||
print ============== step4
|
print ============== step4
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sleep 2000
|
sleep 2000
|
||||||
sql_error show mnodes
|
sql_error show mnodes
|
||||||
print error of no master
|
print error of no master
|
||||||
|
@ -56,7 +56,7 @@ sql_error drop dnode $hostname1
|
||||||
print error of no master
|
print error of no master
|
||||||
|
|
||||||
print ============== step6
|
print ============== step6
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sleep 2000
|
sleep 2000
|
||||||
sql close
|
sql close
|
||||||
sql connect
|
sql connect
|
||||||
|
@ -80,7 +80,7 @@ if $data2_2 != slave then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step7
|
print ============== step7
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
sleep 5000
|
sleep 5000
|
||||||
|
|
||||||
|
@ -106,11 +106,11 @@ if $data3_3 != null then
|
||||||
goto show7
|
goto show7
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -8,7 +8,7 @@ system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
|
||||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
|
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
|
||||||
|
|
||||||
print ============== step1
|
print ============== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql show mnodes
|
sql show mnodes
|
||||||
|
@ -19,7 +19,7 @@ if $data2_1 != master then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step2
|
print ============== step2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -41,7 +41,7 @@ if $data2_2 != slave then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step3
|
print ============== step3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
sleep 8000
|
sleep 8000
|
||||||
|
|
||||||
|
@ -85,14 +85,14 @@ if $dnode3Role != slave then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode2 -s stop
|
system sh/exec.sh -n dnode2 -s stop
|
||||||
|
|
||||||
print ============== step5
|
print ============== step5
|
||||||
sleep 2000
|
sleep 2000
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
system sh/deploy.sh -n dnode2 -i 2
|
system sh/deploy.sh -n dnode2 -i 2
|
||||||
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
|
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sleep 8000
|
sleep 8000
|
||||||
|
|
||||||
sql show mnodes
|
sql show mnodes
|
||||||
|
@ -114,7 +114,7 @@ if $dnode3Role != slave then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step6
|
print ============== step6
|
||||||
system sh/exec_up.sh -n dnode1 -s stop
|
system sh/exec.sh -n dnode1 -s stop
|
||||||
sleep 10000
|
sleep 10000
|
||||||
|
|
||||||
sql_error show mnodes
|
sql_error show mnodes
|
||||||
|
@ -122,11 +122,11 @@ sql_error show mnodes
|
||||||
print ============== step7
|
print ============== step7
|
||||||
sql_error drop dnode $hostname1
|
sql_error drop dnode $hostname1
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -8,7 +8,7 @@ system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
|
||||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
|
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
|
||||||
|
|
||||||
print ============== step1
|
print ============== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql show mnodes
|
sql show mnodes
|
||||||
|
@ -19,7 +19,7 @@ if $data2_1 != master then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step2
|
print ============== step2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -41,7 +41,7 @@ if $data2_2 != slave then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step3
|
print ============== step3
|
||||||
system sh/exec_up.sh -n dnode1 -s stop
|
system sh/exec.sh -n dnode1 -s stop
|
||||||
sleep 2000
|
sleep 2000
|
||||||
sql_error show mnodes
|
sql_error show mnodes
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ print ============== step4
|
||||||
sql_error drop dnode $hostname1
|
sql_error drop dnode $hostname1
|
||||||
|
|
||||||
print ============== step5
|
print ============== step5
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql_error create dnode $hostname1
|
sql_error create dnode $hostname1
|
||||||
|
|
||||||
sql close
|
sql close
|
||||||
|
@ -74,11 +74,11 @@ if $data2_2 != slave then
|
||||||
goto step5
|
goto step5
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
|
@ -8,7 +8,7 @@ system sh/cfg.sh -n dnode2 -c numOfMnodes -v 2
|
||||||
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
|
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 2
|
||||||
|
|
||||||
print ============== step1
|
print ============== step1
|
||||||
system sh/exec_up.sh -n dnode1 -s start
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
sql show mnodes
|
sql show mnodes
|
||||||
|
@ -19,7 +19,7 @@ if $data2_1 != master then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step2
|
print ============== step2
|
||||||
system sh/exec_up.sh -n dnode2 -s start
|
system sh/exec.sh -n dnode2 -s start
|
||||||
sql create dnode $hostname2
|
sql create dnode $hostname2
|
||||||
|
|
||||||
$x = 0
|
$x = 0
|
||||||
|
@ -41,7 +41,7 @@ if $data2_2 != slave then
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print ============== step3
|
print ============== step3
|
||||||
system sh/exec_up.sh -n dnode3 -s start
|
system sh/exec.sh -n dnode3 -s start
|
||||||
sql create dnode $hostname3
|
sql create dnode $hostname3
|
||||||
sleep 6000
|
sleep 6000
|
||||||
|
|
||||||
|
@ -85,11 +85,11 @@ if $dnode3Role != slave then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec_up.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode2 -s stop -x SIGINT
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode3 -s stop -x SIGINT
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode4 -s stop -x SIGINT
|
system sh/exec.sh -n dnode4 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode5 -s stop -x SIGINT
|
system sh/exec.sh -n dnode5 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode6 -s stop -x SIGINT
|
system sh/exec.sh -n dnode6 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode7 -s stop -x SIGINT
|
system sh/exec.sh -n dnode7 -s stop -x SIGINT
|
||||||
system sh/exec_up.sh -n dnode8 -s stop -x SIGINT
|
system sh/exec.sh -n dnode8 -s stop -x SIGINT
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue