[td-225] merge develop

This commit is contained in:
Haojun Liao 2020-06-18 16:06:54 +08:00
commit 02f7098d11
62 changed files with 927 additions and 574 deletions

View File

@ -260,19 +260,75 @@ matrix:
- cmake .. > /dev/null
- make > /dev/null
# - os: osx
# language: c
# compiler: clang
# env: DESC="mac/clang build"
# git:
# - depth: 1
# addons:
# homebrew:
# - cmake
#
# script:
# - cd ${TRAVIS_BUILD_DIR}
# - mkdir debug
# - cd debug
# - cmake .. > /dev/null
# - make > /dev/null
- os: linux
arch: arm64
dist: bionic
language: c
compiler: clang
env: DESC="linux/clang build"
git:
- depth: 1
addons:
apt:
packages:
- build-essential
- cmake
before_script:
- cd ${TRAVIS_BUILD_DIR}
- mkdir debug
- cd debug
script:
- if [ "${TRAVIS_CPU_ARCH}" == "arm64" ]; then
cmake .. -DCPUTYPE=aarch64 > /dev/null;
else
cmake .. > /dev/null;
fi
- make > /dev/null
- os: linux
arch: arm64
dist: trusty
language: c
git:
- depth: 1
addons:
apt:
packages:
- build-essential
- cmake
env:
- DESC="trusty/gcc-4.8 build"
before_script:
- cd ${TRAVIS_BUILD_DIR}
- mkdir debug
- cd debug
script:
- if [ "${TRAVIS_CPU_ARCH}" == "arm64" ]; then
cmake .. -DCPUTYPE=aarch64 > /dev/null;
else
cmake .. > /dev/null;
fi
- make > /dev/null
# - os: osx
# language: c
# compiler: clang
# env: DESC="mac/clang build"
# git:
# - depth: 1
# addons:
# homebrew:
# - cmake
#
# script:
# - cd ${TRAVIS_BUILD_DIR}
# - mkdir debug
# - cd debug
# - cmake .. > /dev/null
# - make > /dev/null

View File

@ -53,7 +53,7 @@ STable从属于库一个STable只属于一个库但一个库可以有一
说明:
1. TAGS列总长度不能超过64k bytes
1. TAGS列总长度不能超过16k bytes
2. TAGS列的数据类型不能是timestamp
3. TAGS列名不能与其他列名相同;
4. TAGS列名不能为预留关键字.

View File

@ -22,7 +22,7 @@ New keyword "tags" is introduced, where tag_name is the tag name, and tag_type i
Note
1. The bytes of all tags together shall be less than 64k
1. The bytes of all tags together shall be less than 16k
2. Tag's data type can not be time stamp
3. Tag name shall be different from the field name
4. Tag name shall not be the same as system keywords

View File

@ -63,7 +63,7 @@ TDengine缺省的时间戳是毫秒精度但通过修改配置参数enableMic
| 3 | BIGINT | 8 | 长整型,范围 [-2^63+1, 2^63-1], -2^63用于NULL |
| 4 | FLOAT | 4 | 浮点型有效位数6-7范围 [-3.4E38, 3.4E38] |
| 5 | DOUBLE | 8 | 双精度浮点型有效位数15-16范围 [-1.7E308, 1.7E308] |
| 6 | BINARY | 自定义 | 用于记录字符串,理论上,最长可以有65526字节但由于每行数据最多64K字节实际上限一般小于理论值。 binary仅支持字符串输入字符串两端使用单引号引用否则英文全部自动转化为小写。使用时须指定大小如binary(20)定义了最长为20个字符的字符串每个字符占1byte的存储空间。如果用户字符串超出20字节将会报错。对于字符串内的单引号可以用转义字符反斜线加单引号来表示**\**。 |
| 6 | BINARY | 自定义 | 用于记录字符串,理论上,最长可以有16374字节但由于每行数据最多16K字节实际上限一般小于理论值。 binary仅支持字符串输入字符串两端使用单引号引用否则英文全部自动转化为小写。使用时须指定大小如binary(20)定义了最长为20个字符的字符串每个字符占1byte的存储空间。如果用户字符串超出20字节将会报错。对于字符串内的单引号可以用转义字符反斜线加单引号来表示**\**。 |
| 7 | SMALLINT | 2 | 短整型, 范围 [-32767, 32767], -32768用于NULL |
| 8 | TINYINT | 1 | 单字节整型,范围 [-127, 127], -128用于NULL |
| 9 | BOOL | 1 | 布尔型,{true, false} |
@ -106,7 +106,7 @@ TDengine缺省的时间戳是毫秒精度但通过修改配置参数enableMic
```mysql
CREATE TABLE [IF NOT EXISTS] tb_name (timestamp_field_name TIMESTAMP, field1_name data_type1 [, field2_name data_type2 ...])
```
说明1表的第一个字段必须是TIMESTAMP并且系统自动将其设为主键2表的每行长度不能超过64K字节3使用数据类型binary或nchar需指定其最长的字节数如binary(20)表示20字节。
说明1表的第一个字段必须是TIMESTAMP并且系统自动将其设为主键2表的每行长度不能超过16K字节3使用数据类型binary或nchar需指定其最长的字节数如binary(20)表示20字节。
- **删除数据表**

View File

@ -39,7 +39,7 @@ The full list of data types is listed below. For string types of data, we will
| 6 | DOUBLE | 8 | A standard nullable double float type with 15-16 significant digits and a range of [-1.7E308, 1.7E308] |
| 7 | BOOL | 1 | A nullable boolean type, [**`true`**, **`false`**] |
| 8 | TIMESTAMP | 8 | A nullable timestamp type with the same usage as the primary column timestamp |
| 9 | BINARY(*M*) | *M* | A nullable string type whose length is *M*, error should be threw with exceeded chars, the maximum length of *M* is 65526, but as maximum row size is 64K bytes, the actual upper limit will generally less than 65526. This type of string only supports ASCii encoded chars. |
| 9 | BINARY(*M*) | *M* | A nullable string type whose length is *M*, error should be threw with exceeded chars, the maximum length of *M* is 16374, but as maximum row size is 16K bytes, the actual upper limit will generally less than 16374. This type of string only supports ASCii encoded chars. |
| 10 | NCHAR(*M*) | 4 * *M* | A nullable string type whose length is *M*, error should be threw with exceeded chars. The **`NCHAR`** type supports Unicode encoded chars. |
All the keywords in a SQL statement are case-insensitive, but strings values are case-sensitive and must be quoted by a pair of `'` or `"`. To quote a `'` or a `"` , you can use the escape character `\`.
@ -86,7 +86,7 @@ All the keywords in a SQL statement are case-insensitive, but strings values are
1) The first column must be a `timestamp`, and the system will set it as the primary key.
2) The record size is limited to 64k bytes
2) The record size is limited to 16k bytes
3) For `binary` or `nchar` data types, the length must be specified. For example, binary(20) means a binary data type with 20 bytes.

View File

@ -182,8 +182,12 @@ static int32_t tscSetValueToResObj(SSqlObj *pSql, int32_t rowLen) {
// type length
int32_t bytes = pSchema[i].bytes;
pField = tscFieldInfoGetField(&pQueryInfo->fieldsInfo, 2);
if (pSchema[i].type == TSDB_DATA_TYPE_NCHAR) {
bytes = bytes / TSDB_NCHAR_SIZE;
if (pSchema[i].type == TSDB_DATA_TYPE_BINARY || pSchema[i].type == TSDB_DATA_TYPE_NCHAR) {
bytes -= VARSTR_HEADER_SIZE;
if (pSchema[i].type == TSDB_DATA_TYPE_NCHAR) {
bytes = bytes / TSDB_NCHAR_SIZE;
}
}
*(int32_t *)(pRes->data + tscFieldInfoGetOffset(pQueryInfo, 2) * totalNumOfRows + pField->bytes * i) = bytes;

View File

@ -407,11 +407,7 @@ static void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
pMnodeInfo->nodeId = htonl(pMnodeInfo->nodeId);
}
SDMVgroupAccess *pVgAcccess = pStatusRsp->vgAccess;
for (int32_t i = 0; i < pCfg->numOfVnodes; ++i) {
pVgAcccess[i].vgId = htonl(pVgAcccess[i].vgId);
}
vnodeSetAccess(pStatusRsp->vgAccess, pCfg->numOfVnodes);
dnodeProcessModuleStatus(pCfg->moduleStatus);
dnodeUpdateDnodeCfg(pCfg);

View File

@ -55,7 +55,7 @@ typedef enum {
typedef struct taosField {
char name[65];
uint8_t type;
uint16_t bytes;
int16_t bytes;
} TAOS_FIELD;
#ifdef _TD_GO_DLL_

View File

@ -113,12 +113,12 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_QUERY_ID, 0, 0x030C, "mnode inva
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_STREAM_ID, 0, 0x030D, "mnode invalid stream id")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_CONN_ID, 0, 0x030E, "mnode invalid connection")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_OBJ_ALREADY_THERE, 0, 0x0320, "[sdb] object already there")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_ERROR, 0, 0x0321, "[sdb] app error")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_INVALID_TABLE_TYPE, 0, 0x0322, "[sdb] invalid table type")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_OBJ_NOT_THERE, 0, 0x0323, "[sdb] object not there")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_INVAID_META_ROW, 0, 0x0324, "[sdb] invalid meta row")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_INVAID_KEY_TYPE, 0, 0x0325, "[sdb] invalid key type")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_OBJ_ALREADY_THERE, 0, 0x0320, "sdb object already there")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_ERROR, 0, 0x0321, "sdb app error")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_INVALID_TABLE_TYPE, 0, 0x0322, "sdb invalid table type")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_OBJ_NOT_THERE, 0, 0x0323, "sdb object not there")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_INVAID_META_ROW, 0, 0x0324, "sdb invalid meta row")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_SDB_INVAID_KEY_TYPE, 0, 0x0325, "sdb invalid key type")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DNODE_ALREADY_EXIST, 0, 0x0330, "mnode dnode already exist")
TAOS_DEFINE_ERROR(TSDB_CODE_MND_DNODE_NOT_EXIST, 0, 0x0331, "mnode dnode not exist")
@ -179,6 +179,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_DISK_PERMISSIONS, 0, 0x0506, "vnode no d
TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_SUCH_FILE_OR_DIR, 0, 0x0507, "vnode no such file or directory")
TAOS_DEFINE_ERROR(TSDB_CODE_VND_OUT_OF_MEMORY, 0, 0x0508, "vnode out of memory")
TAOS_DEFINE_ERROR(TSDB_CODE_VND_APP_ERROR, 0, 0x0509, "vnode app error")
TAOS_DEFINE_ERROR(TSDB_CODE_VND_NO_WRITE_AUTH, 0, 0x0214, "vnode no write auth")
// tsdb
TAOS_DEFINE_ERROR(TSDB_CODE_TDB_INVALID_TABLE_ID, 0, 0x0600, "tsdb invalid table id")

View File

@ -543,6 +543,7 @@ typedef struct {
int32_t dnodeId;
uint32_t moduleStatus;
uint32_t numOfVnodes;
uint32_t reserved;
} SDMDnodeCfg;
typedef struct {

View File

@ -58,6 +58,7 @@ void* vnodeGetWal(void *pVnode);
int32_t vnodeProcessWrite(void *pVnode, int qtype, void *pHead, void *item);
void vnodeBuildStatusMsg(void * param);
void vnodeSetAccess(SDMVgroupAccess *pAccess, int32_t numOfVnodes);
int32_t vnodeProcessRead(void *pVnode, SReadMsg *pReadMsg);

View File

@ -122,7 +122,8 @@ typedef struct SVgObj {
int32_t lbDnodeId;
int32_t lbTime;
int8_t inUse;
int8_t reserved[13];
int8_t accessState;
int8_t reserved[12];
int8_t updateEnd[1];
int32_t refCount;
struct SVgObj *prev, *next;

View File

@ -34,7 +34,8 @@ void mnodeUpdateAllDbVgroups(SDbObj *pAlterDb);
void * mnodeGetNextVgroup(void *pIter, SVgObj **pVgroup);
void mnodeUpdateVgroup(SVgObj *pVgroup);
void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *dnodeId, SVnodeLoad *pVload);
void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVload);
void mnodeCheckUnCreatedVgroup(SDnodeObj *pDnode, SVnodeLoad *pVloads, int32_t openVnodes);
int32_t mnodeCreateVgroup(struct SMnodeMsg *pMsg, SDbObj *pDb);
void mnodeDropVgroup(SVgObj *pVgroup, void *ahandle);

View File

@ -39,6 +39,7 @@ static int32_t mnodeAcctActionDestroy(SSdbOper *pOper) {
static int32_t mnodeAcctActionInsert(SSdbOper *pOper) {
SAcctObj *pAcct = pOper->pObj;
memset(&pAcct->acctInfo, 0, sizeof(SAcctInfo));
pAcct->acctInfo.accessState = TSDB_VN_ALL_ACCCESS;
pthread_mutex_init(&pAcct->mutex, NULL);
return TSDB_CODE_SUCCESS;
}

View File

@ -335,6 +335,19 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
}
int32_t openVnodes = htons(pStatus->openVnodes);
int32_t contLen = sizeof(SDMStatusRsp) + openVnodes * sizeof(SDMVgroupAccess);
SDMStatusRsp *pRsp = rpcMallocCont(contLen);
if (pRsp == NULL) {
mnodeDecDnodeRef(pDnode);
return TSDB_CODE_MND_OUT_OF_MEMORY;
}
pRsp->dnodeCfg.dnodeId = htonl(pDnode->dnodeId);
pRsp->dnodeCfg.moduleStatus = htonl((int32_t)pDnode->isMgmt);
pRsp->dnodeCfg.numOfVnodes = htonl(openVnodes);
mnodeGetMnodeInfos(&pRsp->mnodes);
SDMVgroupAccess *pAccess = (SDMVgroupAccess *)((char *)pRsp + sizeof(SDMStatusRsp));
for (int32_t j = 0; j < openVnodes; ++j) {
SVnodeLoad *pVload = &pStatus->load[j];
pVload->vgId = htonl(pVload->vgId);
@ -347,6 +360,8 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
mnodeSendDropVnodeMsg(pVload->vgId, &ipSet, NULL);
} else {
mnodeUpdateVgroupStatus(pVgroup, pDnode, pVload);
pAccess->vgId = htonl(pVload->vgId);
pAccess->accessState = pVgroup->accessState;
mnodeDecVgroupRef(pVgroup);
}
}
@ -366,25 +381,12 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) {
balanceNotify();
}
mnodeDecDnodeRef(pDnode);
int32_t contLen = sizeof(SDMStatusRsp) + TSDB_MAX_VNODES * sizeof(SDMVgroupAccess);
SDMStatusRsp *pRsp = rpcMallocCont(contLen);
if (pRsp == NULL) {
return TSDB_CODE_MND_OUT_OF_MEMORY;
if (openVnodes != pDnode->openVnodes) {
mnodeCheckUnCreatedVgroup(pDnode, pStatus->load, openVnodes);
}
pDnode->lastAccess = tsAccessSquence;
mnodeGetMnodeInfos(&pRsp->mnodes);
pRsp->dnodeCfg.dnodeId = htonl(pDnode->dnodeId);
pRsp->dnodeCfg.moduleStatus = htonl((int32_t)pDnode->isMgmt);
pRsp->dnodeCfg.numOfVnodes = 0;
contLen = sizeof(SDMStatusRsp);
//TODO: set vnode access
mnodeDecDnodeRef(pDnode);
pMsg->rpcRsp.len = contLen;
pMsg->rpcRsp.rsp = pRsp;

View File

@ -74,6 +74,7 @@ static int32_t mnodeVgroupActionInsert(SSdbOper *pOper) {
pVgroup->pDb = pDb;
pVgroup->prev = NULL;
pVgroup->next = NULL;
pVgroup->accessState = TSDB_VN_ALL_ACCCESS;
int32_t size = sizeof(SChildTableObj *) * pDb->cfg.maxTables;
pVgroup->tableList = calloc(pDb->cfg.maxTables, sizeof(SChildTableObj *));
@ -255,6 +256,8 @@ void mnodeUpdateVgroup(SVgObj *pVgroup) {
mnodeSendCreateVgroupMsg(pVgroup, NULL);
}
void mnodeCheckUnCreatedVgroup(SDnodeObj *pDnode, SVnodeLoad *pVloads, int32_t openVnodes) {}
void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVload) {
bool dnodeExist = false;
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
@ -324,6 +327,7 @@ int32_t mnodeCreateVgroup(SMnodeMsg *pMsg, SDbObj *pDb) {
strcpy(pVgroup->dbName, pDb->name);
pVgroup->numOfVnodes = pDb->cfg.replications;
pVgroup->createdTime = taosGetTimestampMs();
pVgroup->accessState = TSDB_VN_ALL_ACCCESS;
if (balanceAllocVnodes(pVgroup) != 0) {
mError("db:%s, no enough dnode to alloc %d vnodes to vgroup", pDb->name, pVgroup->numOfVnodes);
free(pVgroup);

View File

@ -4259,7 +4259,7 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
while (pQInfo->groupIndex < numOfGroups) {
SArray* group = taosArrayGetP(pQInfo->groupInfo.pGroupList, pQInfo->groupIndex);
qTrace("QInfo:%p last_row query on group:%d, total group:%d, current group:%d", pQInfo, pQInfo->groupIndex,
qTrace("QInfo:%p last_row query on group:%d, total group:%u, current group:%p", pQInfo, pQInfo->groupIndex,
numOfGroups, group);
STsdbQueryCond cond = {
@ -4510,7 +4510,7 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
}
qTrace(
"QInfo %p numOfTables:%d, index:%d, numOfGroups:%d, %d points returned, total:%"PRId64", offset:%" PRId64,
"QInfo %p numOfTables:%"PRIu64", index:%d, numOfGroups:%d, %"PRId64" points returned, total:%"PRId64", offset:%" PRId64,
pQInfo, pQInfo->groupInfo.numOfTables, pQInfo->tableIndex, numOfGroups, pQuery->rec.rows, pQuery->rec.total,
pQuery->limit.offset);
}
@ -4597,7 +4597,7 @@ static void multiTableQueryProcess(SQInfo *pQInfo) {
copyFromWindowResToSData(pQInfo, pRuntimeEnv->windowResInfo.pResult);
}
qTrace("QInfo:%p current:%lld, total:%lld", pQInfo, pQuery->rec.rows, pQuery->rec.total);
qTrace("QInfo:%p current:%"PRId64", total:%"PRId64"", pQInfo, pQuery->rec.rows, pQuery->rec.total);
return;
}
@ -4869,13 +4869,13 @@ static void tableQueryImpl(SQInfo *pQInfo) {
clearFirstNTimeWindow(pRuntimeEnv, pQInfo->groupIndex);
if (pQuery->rec.rows > 0) {
qTrace("QInfo:%p %d rows returned from group results, total:%d", pQInfo, pQuery->rec.rows, pQuery->rec.total);
qTrace("QInfo:%p %"PRId64" rows returned from group results, total:%"PRId64"", pQInfo, pQuery->rec.rows, pQuery->rec.total);
return;
}
}
}
qTrace("QInfo:%p query over, %d rows are returned", pQInfo, pQuery->rec.total);
qTrace("QInfo:%p query over, %"PRId64" rows are returned", pQInfo, pQuery->rec.total);
return;
}
@ -4931,7 +4931,7 @@ static void stableQueryImpl(SQInfo *pQInfo) {
pQInfo->runtimeEnv.summary.elapsedTime += (taosGetTimestampUs() - st);
if (pQuery->rec.rows == 0) {
qTrace("QInfo:%p over, %d tables queried, %d rows are returned", pQInfo, pQInfo->groupInfo.numOfTables, pQuery->rec.total);
qTrace("QInfo:%p over, %d tables queried, %"PRId64" rows are returned", pQInfo, pQInfo->groupInfo.numOfTables, pQuery->rec.total);
}
}
@ -6041,7 +6041,7 @@ int32_t qRetrieveQueryResultInfo(qinfo_t qinfo) {
}
sem_wait(&pQInfo->dataReady);
qTrace("QInfo:%p retrieve result info, rowsize:%d, rows:%d, code:%d", pQInfo, pQuery->rowSize, pQuery->rec.rows,
qTrace("QInfo:%p retrieve result info, rowsize:%d, rows:%"PRId64", code:%d", pQInfo, pQuery->rowSize, pQuery->rec.rows,
pQInfo->code);
return pQInfo->code;

View File

@ -577,8 +577,7 @@ static void tQueryIndexColumn(SSkipList* pSkipList, tQueryInfo* pQueryInfo, SArr
assert(0);
}
} else {
int32_t optr = cond.end->optr;
int32_t optr = cond.end ? cond.end->optr : TSDB_RELATION_INVALID;
if (optr == TSDB_RELATION_LESS || optr == TSDB_RELATION_LESS_EQUAL) {
bool comp = true;
int32_t ret = 0;

View File

@ -283,7 +283,7 @@ tMemBucket *tMemBucketCreate(int32_t totalSlots, int32_t nBufferSize, int16_t nE
break;
};
default: {
uError("MemBucket:%p,not support data type %d,failed", *pBucket, pBucket->dataType);
uError("MemBucket:%p,not support data type %d,failed", pBucket, pBucket->dataType);
tfree(pBucket);
return NULL;
}

View File

@ -120,6 +120,7 @@ static FORCE_INLINE int32_t isValidNumber(const SSQLToken* pToken) {
type = TK_FLOAT;
goto _end;
break;
}
case '0': {

View File

@ -95,9 +95,6 @@ void* taosArrayGetP(const SArray* pArray, size_t index) {
assert(index < pArray->size);
void* d = TARRAY_GET_ELEM(pArray, index);
if (d == NULL) {
return NULL;
}
return *(void**)d;
}

View File

@ -119,7 +119,7 @@ static FORCE_INLINE void taosCacheReleaseNode(SCacheObj *pCacheObj, SCacheDataNo
int32_t size = pNode->size;
taosHashRemove(pCacheObj->pHashTable, pNode->key, pNode->keySize);
uTrace("key:%s is removed from cache,total:%d,size:%ldbytes", pNode->key, pCacheObj->totalSize, size);
uTrace("key:%s is removed from cache,total:%" PRId64 ",size:%dbytes", pNode->key, pCacheObj->totalSize, size);
if (pCacheObj->freeFp) pCacheObj->freeFp(pNode->data);
free(pNode);
}
@ -288,7 +288,7 @@ void *taosCachePut(SCacheObj *pCacheObj, const char *key, const void *pData, siz
if (NULL != pNode) {
pCacheObj->totalSize += pNode->size;
uTrace("key:%s %p added into cache, added:%" PRIu64 ", expire:%" PRIu64 ", total:%d, size:%" PRId64 " bytes",
uTrace("key:%s %p added into cache, added:%" PRIu64 ", expire:%" PRIu64 ", total:%" PRId64 ", size:%" PRId64 " bytes",
key, pNode, pNode->addedTime, pNode->expiredTime, pCacheObj->totalSize, dataSize);
} else {
uError("key:%s failed to added into cache, out of memory", key);
@ -433,7 +433,6 @@ void taosCacheEmpty(SCacheObj *pCacheObj) {
__cache_wr_lock(pCacheObj);
while (taosHashIterNext(pIter)) {
if (pCacheObj->deleting == 1) {
taosHashDestroyIter(pIter);
break;
}
@ -507,7 +506,7 @@ void taosAddToTrash(SCacheObj *pCacheObj, SCacheDataNode *pNode) {
void taosRemoveFromTrashCan(SCacheObj *pCacheObj, STrashElem *pElem) {
if (pElem->pData->signature != (uint64_t)pElem->pData) {
uError("key:sig:%d %p data has been released, ignore", pElem->pData->signature, pElem->pData);
uError("key:sig:0x%x %p data has been released, ignore", pElem->pData->signature, pElem->pData);
return;
}
@ -561,7 +560,6 @@ void taosTrashCanEmpty(SCacheObj *pCacheObj, bool force) {
}
}
assert(pCacheObj->numOfElemsInTrash >= 0);
__cache_unlock(pCacheObj);
}

View File

@ -551,7 +551,7 @@ int tsDecompressTimestampImp(const char *const input, const int nelements, char
delta_of_delta = 0;
} else {
if (is_bigendian()) {
memcpy(&dd1 + LONG_BYTES - nbytes, input + ipos, nbytes);
memcpy(((char *)(&dd1)) + LONG_BYTES - nbytes, input + ipos, nbytes);
} else {
memcpy(&dd1, input + ipos, nbytes);
}
@ -576,7 +576,7 @@ int tsDecompressTimestampImp(const char *const input, const int nelements, char
delta_of_delta = 0;
} else {
if (is_bigendian()) {
memcpy(&dd2 + LONG_BYTES - nbytes, input + ipos, nbytes);
memcpy(((char *)(&dd2)) + LONG_BYTES - nbytes, input + ipos, nbytes);
} else {
memcpy(&dd2, input + ipos, nbytes);
}

View File

@ -74,7 +74,7 @@ static void taosReadInt32Config(SGlobalCfg *cfg, char *input_value) {
*option = value;
cfg->cfgStatus = TAOS_CFG_CSTATUS_FILE;
} else {
uWarn("config option:%s, input value:%s, is configured by %s, use %s", cfg->option, input_value,
uWarn("config option:%s, input value:%s, is configured by %s, use %d", cfg->option, input_value,
tsCfgStatusStr[cfg->cfgStatus], *option);
}
}
@ -106,7 +106,11 @@ static void taosReadDirectoryConfig(SGlobalCfg *cfg, char *input_value) {
} else {
if (cfg->cfgStatus <= TAOS_CFG_CSTATUS_FILE) {
wordexp_t full_path;
wordexp(input_value, &full_path, 0);
if (0 != wordexp(input_value, &full_path, 0)) {
printf("\nconfig dir: %s wordexp fail! reason:%s\n", input_value, strerror(errno));
wordfree(&full_path);
return;
}
if (full_path.we_wordv != NULL && full_path.we_wordv[0] != NULL) {
strcpy(option, full_path.we_wordv[0]);
}
@ -240,7 +244,12 @@ void taosReadGlobalLogCfg() {
sdbDebugFlag = 135;
wordexp_t full_path;
wordexp(configDir, &full_path, 0);
if ( 0 != wordexp(configDir, &full_path, 0)) {
printf("\nconfig file: %s wordexp fail! reason:%s\n", configDir, strerror(errno));
wordfree(&full_path);
return;
}
if (full_path.we_wordv != NULL && full_path.we_wordv[0] != NULL) {
if (strlen(full_path.we_wordv[0]) >= TSDB_FILENAME_LEN) {
printf("\nconfig file: %s path overflow max len %d, all variables are set to default\n", full_path.we_wordv[0], TSDB_FILENAME_LEN - 1);

View File

@ -736,7 +736,7 @@ static uint32_t table[16][256] = {
0x9c221d09, 0x6e2e10f7, 0x7dd67004, 0x8fda7dfa}
};
#ifndef _TD_ARM_
static uint32_t long_shifts[4][256] = {
{0x00000000, 0xe040e0ac, 0xc56db7a9, 0x252d5705, 0x8f3719a3, 0x6f77f90f,
0x4a5aae0a, 0xaa1a4ea6, 0x1b8245b7, 0xfbc2a51b, 0xdeeff21e, 0x3eaf12b2,
@ -1090,7 +1090,7 @@ static uint32_t short_shifts[4][256] = {
0x3c3f083d, 0x1984fde6, 0x7748e38b, 0x52f31650, 0xaad0df51, 0x8f6b2a8a,
0xe1a734e7, 0xc41cc13c, 0x140cd014, 0x31b725cf, 0x5f7b3ba2, 0x7ac0ce79,
0x82e30778, 0xa758f2a3, 0xc994ecce, 0xec2f1915}};
#endif
#if 0
static uint32_t append_trivial(uint32_t crc, crc_stream input, size_t length) {
for (size_t i = 0; i < length; ++i) {
@ -1187,13 +1187,13 @@ uint32_t crc32c_sf(uint32_t crci, crc_stream input, size_t length) {
}
return (uint32_t)crc ^ 0xffffffff;
}
#ifndef _TD_ARM_
/* Apply the zeros operator table to crc. */
static uint32_t shift_crc(uint32_t shift_table[][256], uint32_t crc) {
return shift_table[0][crc & 0xff] ^ shift_table[1][(crc >> 8) & 0xff] ^
shift_table[2][(crc >> 16) & 0xff] ^ shift_table[3][crc >> 24];
}
#endif
/* Compute a CRC-32C. If the crc32 instruction is available, use the hardware
version. Otherwise, use the software version. */
uint32_t (*crc32c)(uint32_t crci, crc_stream bytes, size_t len) = crc32c_sf;

View File

@ -537,5 +537,6 @@ static int tdRestoreKVStore(SKVStore *pStore) {
_err:
tfree(buf);
taosHashDestroyIter(pIter);
return -1;
}

View File

@ -142,6 +142,10 @@ static void *taosThreadToOpenNewFile(void *param) {
umask(0);
int32_t fd = open(name, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRWXG | S_IRWXO);
if (fd < 0) {
uError("open new log file fail! fd:%d reason:%s", fd, strerror(errno));
return NULL;
}
taosLockFile(fd);
lseek(fd, 0, SEEK_SET);
@ -184,7 +188,7 @@ void taosResetLog() {
tsLogObj.lines = tsLogObj.maxLines + 10;
taosOpenNewLogFile();
remove(lastName);
(void)remove(lastName);
uPrint("==================================");
uPrint(" reset log file ");
@ -279,7 +283,10 @@ static int32_t taosOpenLogFile(char *fn, int32_t maxLines, int32_t maxFileNum) {
// only an estimate for number of lines
struct stat filestat;
fstat(tsLogObj.logHandle->fd, &filestat);
if (fstat(tsLogObj.logHandle->fd, &filestat) < 0) {
printf("\nfailed to fstat log file:%s, reason:%s\n", name, strerror(errno));
return -1;
}
size = (int32_t)filestat.st_size;
tsLogObj.lines = size / 60;

View File

@ -214,7 +214,10 @@ int taosOpenNoteWithMaxLines(char *fn, int maxLines, int maxNoteNum, taosNoteInf
// only an estimate for number of lines
struct stat filestat;
fstat(pNote->taosNoteFd, &filestat);
if (fstat(pNote->taosNoteFd, &filestat) < 0) {
fprintf(stderr, "failed to fstat note file:%s reason:%s\n", name, strerror(errno));
return -1;
}
size = (int)filestat.st_size;
pNote->taosNoteLines = size / 60;
@ -226,7 +229,7 @@ int taosOpenNoteWithMaxLines(char *fn, int maxLines, int maxNoteNum, taosNoteInf
void taosNotePrint(taosNoteInfo * pNote, const char * const format, ...)
{
va_list argpointer;
char buffer[MAX_NOTE_LINE_SIZE];
char buffer[MAX_NOTE_LINE_SIZE+2];
int len;
struct tm Tm, *ptm;
struct timeval timeSecs;

View File

@ -278,7 +278,7 @@ int taosOpenUdpSocket(uint32_t ip, uint16_t port) {
/* bind socket to local address */
if (bind(sockFd, (struct sockaddr *)&localAddr, sizeof(localAddr)) < 0) {
uError("failed to bind udp socket: %d (%s), 0x%x:%hu", errno, strerror(errno), ip, port);
taosCloseSocket(sockFd);
close(sockFd);
return -1;
}
@ -321,7 +321,7 @@ int taosOpenTcpClientSocket(uint32_t destIp, uint16_t destPort, uint32_t clientI
if (ret != 0) {
//uError("failed to connect socket, ip:0x%x, port:%hu(%s)", destIp, destPort, strerror(errno));
taosCloseSocket(sockFd);
close(sockFd);
sockFd = -1;
}

View File

@ -72,49 +72,6 @@ void deltaToUtcInitOnce() {
return;
}
int64_t user_mktime(struct tm * tm)
{
#define TAOS_MINUTE 60
#define TAOS_HOUR (60*TAOS_MINUTE)
#define TAOS_DAY (24*TAOS_HOUR)
#define TAOS_YEAR (365*TAOS_DAY)
static int month[12] = {
0,
TAOS_DAY*(31),
TAOS_DAY*(31+29),
TAOS_DAY*(31+29+31),
TAOS_DAY*(31+29+31+30),
TAOS_DAY*(31+29+31+30+31),
TAOS_DAY*(31+29+31+30+31+30),
TAOS_DAY*(31+29+31+30+31+30+31),
TAOS_DAY*(31+29+31+30+31+30+31+31),
TAOS_DAY*(31+29+31+30+31+30+31+31+30),
TAOS_DAY*(31+29+31+30+31+30+31+31+30+31),
TAOS_DAY*(31+29+31+30+31+30+31+31+30+31+30)
};
int64_t res;
int year;
year= tm->tm_year - 70;
res= TAOS_YEAR*year + TAOS_DAY*((year+1)/4);
res+= month[tm->tm_mon];
if(tm->tm_mon > 1 && ((year+2)%4)) {
res-= TAOS_DAY;
}
res+= TAOS_DAY*(tm->tm_mday-1);
res+= TAOS_HOUR*tm->tm_hour;
res+= TAOS_MINUTE*tm->tm_min;
res+= tm->tm_sec;
return res + m_deltaUtc;
}
static int64_t parseFraction(char* str, char** end, int32_t timePrec);
static int32_t parseTimeWithTz(char* timestr, int64_t* time, int32_t timePrec);
static int32_t parseLocaltime(char* timestr, int64_t* time, int32_t timePrec);

View File

@ -139,7 +139,7 @@ static void unlockTimerList(timer_list_t* list) {
int64_t tid = taosGetPthreadId();
if (atomic_val_compare_exchange_64(&(list->lockedBy), tid, 0) != tid) {
assert(false);
tmrError("%d trying to unlock a timer list not locked by current thread.", tid);
tmrError("%" PRId64 " trying to unlock a timer list not locked by current thread.", tid);
}
}
@ -290,6 +290,7 @@ static void addToExpired(tmr_obj_t* head) {
SSchedMsg schedMsg;
schedMsg.fp = NULL;
schedMsg.tfp = processExpiredTimer;
schedMsg.msg = NULL;
schedMsg.ahandle = head;
schedMsg.thandle = NULL;
taosScheduleTask(tmrQhandle, &schedMsg);
@ -513,14 +514,17 @@ static void taosTmrModuleInit(void) {
tmrError("failed to create the mutex for wheel, reason:%s", strerror(errno));
return;
}
pthread_mutex_lock(&wheel->mutex);
wheel->nextScanAt = now + wheel->resolution;
wheel->index = 0;
wheel->slots = (tmr_obj_t**)calloc(wheel->size, sizeof(tmr_obj_t*));
if (wheel->slots == NULL) {
tmrError("failed to allocate wheel slots");
pthread_mutex_unlock(&wheel->mutex);
return;
}
timerMap.size += wheel->size;
pthread_mutex_unlock(&wheel->mutex);
}
timerMap.count = 0;

View File

@ -557,7 +557,7 @@ bool taosGetVersionNumber(char *versionStr, int *versionNubmer) {
return false;
}
int versionNumberPos[4] = {0};
int versionNumberPos[5] = {0};
int len = strlen(versionStr);
int dot = 0;
for (int pos = 0; pos < len && dot < 4; ++pos) {
@ -709,7 +709,7 @@ void taosRemoveDir(char *rootDir) {
if (de->d_type & DT_DIR) {
taosRemoveDir(filename);
} else {
remove(filename);
(void)remove(filename);
uPrint("file:%s is removed", filename);
}
}

View File

@ -37,6 +37,7 @@ typedef struct {
int32_t refCount; // reference count
int status;
int8_t role;
int8_t accessState;
int64_t version; // current version
int64_t fversion; // version on saved data file
void *wqueue;

View File

@ -195,6 +195,7 @@ int32_t vnodeOpen(int32_t vnode, char *rootDir) {
pVnode->version = 0;
pVnode->tsdbCfg.tsdbId = pVnode->vgId;
pVnode->rootDir = strdup(rootDir);
pVnode->accessState = TSDB_VN_ALL_ACCCESS;
int32_t code = vnodeReadCfg(pVnode);
if (code != TSDB_CODE_SUCCESS) {
@ -431,6 +432,20 @@ void vnodeBuildStatusMsg(void *param) {
taosHashDestroyIter(pIter);
}
void vnodeSetAccess(SDMVgroupAccess *pAccess, int32_t numOfVnodes) {
for (int32_t i = 0; i < numOfVnodes; ++i) {
pAccess[i].vgId = htonl(pAccess[i].vgId);
SVnodeObj *pVnode = vnodeAccquireVnode(pAccess[i].vgId);
if (pVnode != NULL) {
pVnode->accessState = pAccess[i].accessState;
if (pVnode->accessState != TSDB_VN_ALL_ACCCESS) {
vTrace("vgId:%d, access state is set to %d", pAccess[i].vgId)
}
vnodeRelease(pVnode);
}
}
}
static void vnodeCleanUp(SVnodeObj *pVnode) {
// remove from hash, so new messages wont be consumed
taosHashRemove(tsDnodeVnodesHash, (const char *)&pVnode->vgId, sizeof(int32_t));

View File

@ -53,6 +53,10 @@ int32_t vnodeProcessWrite(void *param1, int qtype, void *param2, void *item) {
if (vnodeProcessWriteMsgFp[pHead->msgType] == NULL)
return TSDB_CODE_VND_MSG_NOT_PROCESSED;
if (!(pVnode->accessState & TSDB_VN_WRITE_ACCCESS)) {
return TSDB_CODE_VND_NO_WRITE_AUTH;
}
if (pHead->version == 0) { // from client or CQ
if (pVnode->status != TAOS_VN_STATUS_READY)
return TSDB_CODE_VND_INVALID_VGROUP_ID; // it may be in deleting or closing state

View File

@ -25,7 +25,6 @@ class TDTestCase:
def run(self):
tdSql.prepare()
tdSql.error('create table tb (ts timestamp, col nchar(1022))')
tdSql.execute('create table tb (ts timestamp, col nchar(1021))')
tdSql.execute("insert into tb values (now, 'taosdata')")
tdSql.query("select * from tb")

View File

@ -17,6 +17,7 @@ from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import *
import codecs
class Test:
@ -93,14 +94,13 @@ class Test:
self.last_stb = current_stb
current_tb = "tb%d" % int(round(time.time() * 1000))
tdSql.execute(
"create table %s using %s tags (1, '表1')" %
(current_tb, self.last_stb))
sqlcmd = "create table %s using %s tags (1, 'test')" %(current_tb, self.last_stb)
tdSql.execute(sqlcmd)
self.last_tb = current_tb
self.written = 0
tdSql.execute(
"insert into %s values (now, 27, '我是nchar字符串')" %
"insert into %s values (now, 27, 'wsnchar')" %
self.last_tb)
self.written = self.written + 1

View File

@ -13,7 +13,7 @@ python3 ./test.py -f insert/date.py
python3 ./test.py -f insert/binary.py
python3 ./test.py -f insert/nchar.py
# python3 ./test.py -f insert/nchar-boundary.py
# python3 ./test.py -f insert/nchar-unicode.py
python3 ./test.py -f insert/nchar-unicode.py
python3 ./test.py -f insert/multi.py
python3 ./test.py -f insert/randomNullCommit.py

View File

@ -40,10 +40,18 @@ class TDSql:
def prepare(self):
tdLog.info("prepare database:db")
self.cursor.execute('reset query cache')
self.cursor.execute('drop database if exists db')
self.cursor.execute('create database db')
self.cursor.execute('use db')
s = 'reset query cache'
print(s)
self.cursor.execute(s)
s = 'drop database if exists db'
print(s)
self.cursor.execute(s)
s = 'create database db'
print(s)
self.cursor.execute(s)
s = 'use db'
print(s)
self.cursor.execute(s)
def error(self, sql):
expectErrNotOccured = True
@ -66,6 +74,7 @@ class TDSql:
def query(self, sql):
self.sql = sql
print(sql)
self.cursor.execute(sql)
self.queryResult = self.cursor.fetchall()
self.queryRows = len(self.queryResult)
@ -182,6 +191,7 @@ class TDSql:
def execute(self, sql):
self.sql = sql
print(sql)
self.affectedRows = self.cursor.execute(sql)
return self.affectedRows

View File

@ -1,7 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
@ -56,11 +56,12 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
sleep 5000
sql connect
sleep 3000
sql use $db
sql select * from $stb
print select * from $stb ==> $data00 $data01 $data02
if $rows != 1 then
return -1
endi
@ -72,6 +73,7 @@ if $data02 != 1 then
endi
sql select * from $tb2
print select * from $tb2 ==> $data00 $data01 $data02
if $rows != 1 then
return -1
endi

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
@ -42,9 +41,9 @@ if $data00 != 5 then
return -1
endi
sql_error import into tb values(now-29d, -29, 0)
sql import into tb values(now-29d, -29, 0)
sql select count(b) from tb
if $data00 != 5 then
if $data00 != 6 then
return -1
endi

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
@ -14,41 +13,42 @@ sql use d3
sql create table tb (ts timestamp, a int)
sql insert into tb values(now-28d, -28)
sql select * from tb order by ts desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $rows != 1 then
return -1
endi
if $data01 != -28 then
return -1
endi
if $data02 != NULL then
if $data02 != null then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
if $data06 != NULL then
if $data06 != null then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
print ======== step2
sleep 2500
sql alter table tb add column b smallint
sql insert into tb values(now-25d, -25, 0)
sleep 3000
sql select * from tb order by ts desc
print $rows
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
print $data10 $data11 $data12 $data13 $data14 $data15 $data16
if $rows != 2 then
return -1
endi
@ -64,31 +64,32 @@ endi
if $data12 != NULL then
return -1
endi
if $data13 != NULL then
if $data13 != null then
return -1
endi
if $data14 != NULL then
if $data14 != null then
return -1
endi
if $data15 != NULL then
if $data15 != null then
return -1
endi
if $data16 != NULL then
if $data16 != null then
return -1
endi
if $data17 != NULL then
if $data17 != null then
return -1
endi
if $data18 != NULL then
if $data18 != null then
return -1
endi
print ======== step3
sleep 2500
sql alter table tb add column c tinyint
sql insert into tb values(now-22d, -22, 3, 0)
sleep 3000
sql select * from tb order by ts asc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
print $data10 $data11 $data12 $data13 $data14 $data15 $data16
print $data20 $data21 $data22 $data23 $data24 $data25 $data26
if $rows != 3 then then
return -1
endi
@ -101,19 +102,19 @@ endi
if $data03 != NULL then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
if $data06 != NULL then
if $data06 != null then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
if $data11 != -25 then
@ -125,19 +126,19 @@ endi
if $data13 != NULL then
return -1
endi
if $data14 != NULL then
if $data14 != null then
return -1
endi
if $data15 != NULL then
if $data15 != null then
return -1
endi
if $data16 != NULL then
if $data16 != null then
return -1
endi
if $data17 != NULL then
if $data17 != null then
return -1
endi
if $data18 != NULL then
if $data18 != null then
return -1
endi
if $data21 != -22 then
@ -149,27 +150,25 @@ endi
if $data23 != 0 then
return -1
endi
if $data24 != NULL then
if $data24 != null then
return -1
endi
if $data25 != NULL then
if $data25 != null then
return -1
endi
if $data26 != NULL then
if $data26 != null then
return -1
endi
if $data27 != NULL then
if $data27 != null then
return -1
endi
if $data28 != NULL then
if $data28 != null then
return -1
endi
print ======== step4
sleep 2500
sql alter table tb add column d int
sql insert into tb values(now-19d, -19, 6, 3, 0)
sleep 3000
sql select * from tb order by ts asc
if $rows != 4 then then
return -1
@ -186,16 +185,16 @@ endi
if $data04 != NULL then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
if $data06 != NULL then
if $data06 != null then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
if $data11 != -25 then
@ -210,16 +209,16 @@ endi
if $data14 != NULL then
return -1
endi
if $data15 != NULL then
if $data15 != null then
return -1
endi
if $data16 != NULL then
if $data16 != null then
return -1
endi
if $data17 != NULL then
if $data17 != null then
return -1
endi
if $data18 != NULL then
if $data18 != null then
return -1
endi
if $data21 != -22 then
@ -234,16 +233,16 @@ endi
if $data24 != NULL then
return -1
endi
if $data25 != NULL then
if $data25 != null then
return -1
endi
if $data26 != NULL then
if $data26 != null then
return -1
endi
if $data27 != NULL then
if $data27 != null then
return -1
endi
if $data28 != NULL then
if $data28 != null then
return -1
endi
if $data31 != -19 then
@ -258,24 +257,22 @@ endi
if $data34 != 0 then
return -1
endi
if $data35 != NULL then
if $data35 != null then
return -1
endi
if $data36 != NULL then
if $data36 != null then
return -1
endi
if $data37 != NULL then
if $data37 != null then
return -1
endi
if $data38 != NULL then
if $data38 != null then
return -1
endi
print ======== step5
sleep 2500
sql alter table tb add column e bigint
sql insert into tb values(now-16d, -16, 9, 5, 4, 3)
sleep 3000
sql select count(e) from tb
if $data00 != 1 then
return -1
@ -303,13 +300,13 @@ endi
if $data05 != NULL then
return -1
endi
if $data06 != NULL then
if $data06 != null then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
if $data11 != -25 then
@ -327,13 +324,13 @@ endi
if $data15 != NULL then
return -1
endi
if $data16 != NULL then
if $data16 != null then
return -1
endi
if $data17 != NULL then
if $data17 != null then
return -1
endi
if $data18 != NULL then
if $data18 != null then
return -1
endi
if $data21 != -22 then
@ -351,13 +348,13 @@ endi
if $data25 != NULL then
return -1
endi
if $data26 != NULL then
if $data26 != null then
return -1
endi
if $data27 != NULL then
if $data27 != null then
return -1
endi
if $data28 != NULL then
if $data28 != null then
return -1
endi
if $data31 != -19 then
@ -375,13 +372,13 @@ endi
if $data35 != NULL then
return -1
endi
if $data36 != NULL then
if $data36 != null then
return -1
endi
if $data37 != NULL then
if $data37 != null then
return -1
endi
if $data38 != NULL then
if $data38 != null then
return -1
endi
if $data41 != -16 then
@ -399,21 +396,19 @@ endi
if $data45 != 3 then
return -1
endi
if $data46 != NULL then
if $data46 != null then
return -1
endi
if $data47 != NULL then
if $data47 != null then
return -1
endi
if $data48 != NULL then
if $data48 != null then
return -1
endi
print ======== step6
sleep 2500
sql alter table tb add column f float
sql insert into tb values(now-13d, -13, 12, 11, 10, 9, 8)
sleep 3000
sql select * from tb order by ts asc
if $rows != 6 then then
return -1
@ -436,10 +431,10 @@ endi
if $data06 != NULL then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
if $data11 != -25 then
@ -460,10 +455,10 @@ endi
if $data16 != NULL then
return -1
endi
if $data17 != NULL then
if $data17 != null then
return -1
endi
if $data18 != NULL then
if $data18 != null then
return -1
endi
if $data21 != -22 then
@ -484,10 +479,10 @@ endi
if $data26 != NULL then
return -1
endi
if $data27 != NULL then
if $data27 != null then
return -1
endi
if $data28 != NULL then
if $data28 != null then
return -1
endi
if $data31 != -19 then
@ -508,10 +503,10 @@ endi
if $data36 != NULL then
return -1
endi
if $data37 != NULL then
if $data37 != null then
return -1
endi
if $data38 != NULL then
if $data38 != null then
return -1
endi
if $data41 != -16 then
@ -532,10 +527,10 @@ endi
if $data46 != NULL then
return -1
endi
if $data47 != NULL then
if $data47 != null then
return -1
endi
if $data48 != NULL then
if $data48 != null then
return -1
endi
if $data51 != -13 then
@ -556,18 +551,16 @@ endi
if $data56 != 8.00000 then
return -1
endi
if $data57 != NULL then
if $data57 != null then
return -1
endi
if $data58 != NULL then
if $data58 != null then
return -1
endi
print ======== step7
sleep 2500
sql alter table tb add column g double
sql insert into tb values(now-10d, -10, 15, 14, 13, 12, 11, 10)
sleep 3000
sql select * from tb order by ts asc
if $rows != 7 then
return -1
@ -593,7 +586,7 @@ endi
if $data07 != NULL then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
if $data11 != -25 then
@ -617,7 +610,7 @@ endi
if $data17 != NULL then
return -1
endi
if $data18 != NULL then
if $data18 != null then
return -1
endi
if $data21 != -22 then
@ -641,7 +634,7 @@ endi
if $data27 != NULL then
return -1
endi
if $data28 != NULL then
if $data28 != null then
return -1
endi
if $data31 != -19 then
@ -665,7 +658,7 @@ endi
if $data37 != NULL then
return -1
endi
if $data38 != NULL then
if $data38 != null then
return -1
endi
if $data41 != -16 then
@ -689,7 +682,7 @@ endi
if $data47 != NULL then
return -1
endi
if $data48 != NULL then
if $data48 != null then
return -1
endi
if $data51 != -13 then
@ -713,7 +706,7 @@ endi
if $data57 != NULL then
return -1
endi
if $data58 != NULL then
if $data58 != null then
return -1
endi
if $data61 != -10 then
@ -737,15 +730,13 @@ endi
if $data67 != 10.000000000 then
return -1
endi
if $data68 != NULL then
if $data68 != null then
return -1
endi
print ======== step8
sleep 2500
sql alter table tb add column h binary(10)
sql insert into tb values(now-7d, -7, 18, 17, 16, 15, 14, 13, '11')
sleep 3000
sql select * from tb order by ts asc
if $rows != 8 then
return -1
@ -942,17 +933,18 @@ endi
if $data78 != 11 then
return -1
endi
if $data79 != NULL then
if $data79 != null then
return -1
endi
print ======== step9
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 5000
system sh/exec.sh -n dnode1 -s start
sleep 5000
sql select * from tb
sql select * from tb order by ts asc
if $rows != 8 then
return -1
endi
@ -1148,5 +1140,8 @@ endi
if $data78 != 11 then
return -1
endi
if $data79 != null then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c wallevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
@ -43,12 +42,10 @@ if $data08 != 8 then
endi
print ======== step2
sleep 2500
sql_error alter table tb add column b smallint
sql_error alter table tb add column b int
sql alter table tb drop column b
sql insert into tb values(now-25d, 2, 3, 4, 5, 6, 7, 8)
sleep 3000
sql select * from tb order by ts desc
if $rows != 2 then
return -1
@ -74,7 +71,7 @@ endi
if $data07 != 8 then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
if $data11 != 1 then
@ -98,15 +95,13 @@ endi
if $data17 != 8 then
return -1
endi
if $data18 != NULL then
if $data18 != null then
return -1
endi
print ======== step3
sleep 2500
sql alter table tb drop column c
sql insert into tb values(now-22d, 3, 4, 5, 6, 7, 8)
sleep 3000
sql select * from tb order by ts desc
if $rows != 3 then
return -1
@ -129,10 +124,10 @@ endi
if $data06 != 8 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
if $data11 != 2 then
@ -153,10 +148,10 @@ endi
if $data16 != 8 then
return -1
endi
if $data17 != NULL then
if $data17 != null then
return -1
endi
if $data18 != NULL then
if $data18 != null then
return -1
endi
if $data21 != 1 then
@ -177,10 +172,10 @@ endi
if $data26 != 8 then
return -1
endi
if $data27 != NULL then
if $data27 != null then
return -1
endi
if $data28 != NULL then
if $data28 != null then
return -1
endi
@ -206,16 +201,16 @@ endi
if $data04 != 0 then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
if $data06 != NULL then
if $data06 != null then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
if $data11 != 3 then
@ -230,16 +225,16 @@ endi
if $data14 != 8 then
return -1
endi
if $data15 != NULL then
if $data15 != null then
return -1
endi
if $data16 != NULL then
if $data16 != null then
return -1
endi
if $data17 != NULL then
if $data17 != null then
return -1
endi
if $data18 != NULL then
if $data18 != null then
return -1
endi
if $data21 != 2 then
@ -254,16 +249,16 @@ endi
if $data24 != 8 then
return -1
endi
if $data25 != NULL then
if $data25 != null then
return -1
endi
if $data26 != NULL then
if $data26 != null then
return -1
endi
if $data27 != NULL then
if $data27 != null then
return -1
endi
if $data28 != NULL then
if $data28 != null then
return -1
endi
if $data31 != 1 then
@ -278,16 +273,16 @@ endi
if $data34 != 8 then
return -1
endi
if $data35 != NULL then
if $data35 != null then
return -1
endi
if $data36 != NULL then
if $data36 != null then
return -1
endi
if $data37 != NULL then
if $data37 != null then
return -1
endi
if $data38 != NULL then
if $data38 != null then
return -1
endi
@ -313,19 +308,19 @@ endi
if $data03 != 5 then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
if $data06 != NULL then
if $data06 != null then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
if $data11 != -19 then
@ -337,19 +332,19 @@ endi
if $data13 != 0 then
return -1
endi
if $data14 != NULL then
if $data14 != null then
return -1
endi
if $data15 != NULL then
if $data15 != null then
return -1
endi
if $data16 != NULL then
if $data16 != null then
return -1
endi
if $data17 != NULL then
if $data17 != null then
return -1
endi
if $data18 != NULL then
if $data18 != null then
return -1
endi
if $data21 != 3 then
@ -361,19 +356,19 @@ endi
if $data23 != 8 then
return -1
endi
if $data24 != NULL then
if $data24 != null then
return -1
endi
if $data25 != NULL then
if $data25 != null then
return -1
endi
if $data26 != NULL then
if $data26 != null then
return -1
endi
if $data27 != NULL then
if $data27 != null then
return -1
endi
if $data28 != NULL then
if $data28 != null then
return -1
endi
if $data31 != 2 then
@ -385,19 +380,19 @@ endi
if $data33 != 8 then
return -1
endi
if $data34 != NULL then
if $data34 != null then
return -1
endi
if $data35 != NULL then
if $data35 != null then
return -1
endi
if $data36 != NULL then
if $data36 != null then
return -1
endi
if $data37 != NULL then
if $data37 != null then
return -1
endi
if $data38 != NULL then
if $data38 != null then
return -1
endi
if $data41 != 1 then
@ -409,19 +404,19 @@ endi
if $data43 != 8 then
return -1
endi
if $data44 != NULL then
if $data44 != null then
return -1
endi
if $data45 != NULL then
if $data45 != null then
return -1
endi
if $data46 != NULL then
if $data46 != null then
return -1
endi
if $data47 != NULL then
if $data47 != null then
return -1
endi
if $data48 != NULL then
if $data48 != null then
return -1
endi
@ -443,22 +438,22 @@ endi
if $data12 != 5 then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
if $data06 != NULL then
if $data06 != null then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
if $data08 != NULL then
if $data08 != null then
return -1
endi
if $data21 != -19 then
@ -467,22 +462,22 @@ endi
if $data22 != 0 then
return -1
endi
if $data23 != NULL then
if $data23 != null then
return -1
endi
if $data24 != NULL then
if $data24 != null then
return -1
endi
if $data25 != NULL then
if $data25 != null then
return -1
endi
if $data26 != NULL then
if $data26 != null then
return -1
endi
if $data27 != NULL then
if $data27 != null then
return -1
endi
if $data28 != NULL then
if $data28 != null then
return -1
endi
if $data31 != 3 then
@ -491,22 +486,22 @@ endi
if $data32 != 8 then
return -1
endi
if $data33 != NULL then
if $data33 != null then
return -1
endi
if $data34 != NULL then
if $data34 != null then
return -1
endi
if $data35 != NULL then
if $data35 != null then
return -1
endi
if $data36 != NULL then
if $data36 != null then
return -1
endi
if $data37 != NULL then
if $data37 != null then
return -1
endi
if $data38 != NULL then
if $data38 != null then
return -1
endi
if $data41 != 2 then
@ -515,22 +510,22 @@ endi
if $data42 != 8 then
return -1
endi
if $data43 != NULL then
if $data43 != null then
return -1
endi
if $data44 != NULL then
if $data44 != null then
return -1
endi
if $data45 != NULL then
if $data45 != null then
return -1
endi
if $data46 != NULL then
if $data46 != null then
return -1
endi
if $data47 != NULL then
if $data47 != null then
return -1
endi
if $data48 != NULL then
if $data48 != null then
return -1
endi
if $data51 != 1 then
@ -539,19 +534,19 @@ endi
if $data52 != 8 then
return -1
endi
if $data53 != NULL then
if $data53 != null then
return -1
endi
if $data54 != NULL then
if $data54 != null then
return -1
endi
if $data55 != NULL then
if $data55 != null then
return -1
endi
if $data57 != NULL then
if $data57 != null then
return -1
endi
if $data58 != NULL then
if $data58 != null then
return -1
endi
@ -568,52 +563,52 @@ print data01 = $data01
if $data01 != -10 then
return -1
endi
if $data02 != NULL then
if $data02 != null then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
if $data11 != -13 then
return -1
endi
if $data12 != NULL then
if $data12 != null then
return -1
endi
if $data21 != -16 then
return -1
endi
if $data22 != NULL then
if $data22 != null then
return -1
endi
if $data31 != -19 then
return -1
endi
if $data32 != NULL then
if $data32 != null then
return -1
endi
if $data33 != NULL then
if $data33 != null then
return -1
endi
if $data41 != 3 then
return -1
endi
if $data42 != NULL then
if $data42 != null then
return -1
endi
if $data51 != 2 then
return -1
endi
if $data52 != NULL then
if $data52 != null then
return -1
endi
if $data53 != NULL then
if $data53 != null then
return -1
endi
if $data61 != 1 then
return -1
endi
if $data62 != NULL then
if $data62 != null then
return -1
endi
@ -632,52 +627,52 @@ endi
if $data01 != -10 then
return -1
endi
if $data02 != NULL then
if $data02 != null then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
if $data11 != -13 then
return -1
endi
if $data12 != NULL then
if $data12 != null then
return -1
endi
if $data21 != -16 then
return -1
endi
if $data22 != NULL then
if $data22 != null then
return -1
endi
if $data31 != -19 then
return -1
endi
if $data32 != NULL then
if $data32 != null then
return -1
endi
if $data33 != NULL then
if $data33 != null then
return -1
endi
if $data41 != 3 then
return -1
endi
if $data42 != NULL then
if $data42 != null then
return -1
endi
if $data51 != 2 then
return -1
endi
if $data52 != NULL then
if $data52 != null then
return -1
endi
if $data53 != NULL then
if $data53 != null then
return -1
endi
if $data61 != 1 then
return -1
endi
if $data62 != NULL then
if $data62 != null then
return -1
endi

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
@ -42,7 +41,6 @@ endi
print ======== step2
sql alter table mt add column b smallint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -71,7 +69,6 @@ endi
print ======== step3
sql alter table mt add column c tinyint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -106,7 +103,6 @@ endi
print ======== step4
sql alter table mt add column d int
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -147,7 +143,6 @@ endi
print ======== step5
sql alter table mt add column e bigint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -194,7 +189,6 @@ endi
print ======== step6
sql alter table mt add column f float
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -247,7 +241,6 @@ endi
print ======== step7
sql alter table mt add column g double
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -306,7 +299,6 @@ endi
print ======== step8
sql alter table mt add column h binary(10)
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -468,7 +460,6 @@ print ======== step11
print ======== step12
sql alter table mt drop column b
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -530,7 +521,6 @@ endi
print ======== step13
sql alter table mt drop column c
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -586,7 +576,6 @@ endi
print ======== step14
sql alter table mt drop column d
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -636,7 +625,6 @@ endi
print ======== step15
sql alter table mt drop column e
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -680,7 +668,6 @@ endi
print ======== step16
sql alter table mt drop column f
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -718,7 +705,6 @@ endi
print ======== step17
sql alter table mt drop column g
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -750,7 +736,6 @@ endi
print ============= step18
sql alter table mt drop column h
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -770,7 +755,7 @@ endi
if $data21 != INT then
return -1
endi
if $data30 != NULL then
if $data30 != null then
return -1
endi

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
@ -35,7 +34,6 @@ endi
print ======== step2
sql alter table tb add column b smallint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -58,7 +56,6 @@ endi
print ======== step3
sql alter table tb add column c tinyint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -87,7 +84,6 @@ endi
print ======== step4
sql alter table tb add column d int
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -122,7 +118,6 @@ endi
print ======== step5
sql alter table tb add column e bigint
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -163,7 +158,6 @@ endi
print ======== step6
sql alter table tb add column f float
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -210,7 +204,6 @@ endi
print ======== step7
sql alter table tb add column g double
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -263,7 +256,6 @@ endi
print ======== step8
sql alter table tb add column h binary(10)
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -413,7 +405,6 @@ step115:
print ======== step12
sql alter table tb drop column b
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -469,7 +460,6 @@ endi
print ======== step13
sql alter table tb drop column c
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -519,7 +509,6 @@ endi
print ======== step14
sql alter table tb drop column d
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -563,7 +552,6 @@ endi
print ======== step15
sql alter table tb drop column e
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -601,7 +589,6 @@ endi
print ======== step16
sql alter table tb drop column f
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -633,7 +620,6 @@ endi
print ======== step17
sql alter table tb drop column g
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -659,7 +645,6 @@ endi
print ============= step18
sql alter table tb drop column h
sleep 2500
sql describe tb
if $data00 != ts then
return -1
@ -673,7 +658,7 @@ endi
if $data11 != INT then
return -1
endi
if $data20 != NULL then
if $data20 != null then
return -1
endi

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
@ -138,16 +137,17 @@ if $data03 != 2.00000 then
endi
sql describe $tb
print sql describe $tb
if $data21 != BIGINT then
return -1
endi
if $data31 != FLOAT then
return -1
endi
if $data23 != 1 then
if $data23 != TAG then
return -1
endi
if $data33 != 2.000000 then
if $data33 != TAG then
return -1
endi
@ -545,7 +545,7 @@ endi
if $data04 != 0 then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
@ -51,9 +50,9 @@ step21:
sql alter table $mt change tag tgcol1 tgcol2 -x step22
return -1
step22:
sql alter table $mt change tag tgcol1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -x step20
return -1
step20:
#sql alter table $mt change tag tgcol1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -x step20
# return -1
#step20:
sql alter table $mt change tag tgcol1 tgcol3
sql alter table $mt change tag tgcol2 tgcol4
@ -394,7 +393,7 @@ endi
if $data06 != 6 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
@ -421,7 +420,7 @@ endi
if $data06 != 6 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
@ -448,7 +447,7 @@ endi
if $data06 != 6 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
@ -475,7 +474,7 @@ endi
if $data06 != 6 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
@ -502,7 +501,7 @@ endi
if $data06 != 6 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
@ -144,10 +143,10 @@ endi
if $data31 != FLOAT then
return -1
endi
if $data23 != 1 then
if $data23 != TAG then
return -1
endi
if $data33 != 2.000000 then
if $data33 != TAG then
return -1
endi
@ -544,7 +543,7 @@ endi
if $data04 != 0 then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
@ -1054,7 +1053,7 @@ endi
if $data04 != 0 then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
@ -98,7 +97,7 @@ endi
if $data31 != FLOAT then
return -1
endi
if $data23 != 1 then
if $data23 != TAG then
return -1
endi
@ -203,13 +202,13 @@ endi
if $data42 != 10 then
return -1
endi
if $data23 != 1 then
if $data23 != TAG then
return -1
endi
if $data33 != 2 then
if $data33 != TAG then
return -1
endi
if $data43 != 3 then
if $data43 != TAG then
return -1
endi
@ -428,7 +427,7 @@ endi
if $data02 != 1 then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
@ -452,7 +451,7 @@ endi
if $data02 != 1 then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
@ -476,7 +475,7 @@ endi
if $data02 != 1 then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
@ -500,7 +499,7 @@ endi
if $data02 != 1.000000000 then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
@ -524,10 +523,10 @@ endi
if $data02 != 1 then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
@ -554,10 +553,10 @@ endi
if $data02 != 1 then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
@ -584,10 +583,10 @@ endi
if $data02 != 1 then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
@ -614,10 +613,10 @@ endi
if $data02 != 1.000000000 then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
@ -644,13 +643,13 @@ endi
if $data02 != 1 then
return -1
endi
if $data03 != NULL then
if $data03 != null then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
@ -683,13 +682,13 @@ endi
if $data03 != 4.00000 then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
if $data06 != NULL then
if $data06 != null then
return -1
endi
@ -722,16 +721,16 @@ endi
if $data03 != 4.000000000 then
return -1
endi
if $data04 != NULL then
if $data04 != null then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
if $data06 != NULL then
if $data06 != null then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
@ -771,13 +770,13 @@ endi
if $data04 != 5.000000000 then
return -1
endi
if $data05 != NULL then
if $data05 != null then
return -1
endi
if $data06 != NULL then
if $data06 != null then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi

View File

@ -1,8 +1,7 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 0
system sh/cfg.sh -n dnode1 -c walLevel -v 2
system sh/exec.sh -n dnode1 -s start
sleep 3000
@ -91,10 +90,10 @@ endi
if $data31 != INT then
return -1
endi
if $data23 != false then
if $data23 != TAG then
return -1
endi
if $data33 != 4 then
if $data33 != TAG then
return -1
endi
@ -338,7 +337,7 @@ endi
if $data06 != 11 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
@ -365,7 +364,7 @@ endi
if $data06 != 11 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
@ -392,7 +391,7 @@ endi
if $data06 != 11 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
@ -419,7 +418,7 @@ endi
if $data06 != 11 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi
@ -446,7 +445,7 @@ endi
if $data06 != 11 then
return -1
endi
if $data07 != NULL then
if $data07 != null then
return -1
endi

View File

@ -1,13 +1,13 @@
cd ../../../debug; cmake ..
cd ../../../debug; make
#unsupport ./test.sh -f general/alter/cached_schema_after_alter.sim
#unsupport ./test.sh -f general/alter/count.sim
#unsupport ./test.sh -f general/alter/import.sim
#unsupport ./test.sh -f general/alter/insert1.sim
#unsupport ./test.sh -f general/alter/insert2.sim
#unsupport ./test.sh -f general/alter/metrics.sim
#unsupport ./test.sh -f general/alter/table.sim
#./test.sh -f general/alter/cached_schema_after_alter.sim
./test.sh -f general/alter/count.sim
./test.sh -f general/alter/import.sim
#./test.sh -f general/alter/insert1.sim
./test.sh -f general/alter/insert2.sim
./test.sh -f general/alter/metrics.sim
./test.sh -f general/alter/table.sim
./test.sh -f general/cache/new_metrics.sim
./test.sh -f general/cache/restart_metrics.sim
@ -123,33 +123,33 @@ cd ../../../debug; make
#unsupport ./test.sh -f general/parser/null_char.sim
./test.sh -f general/parser/single_row_in_tb.sim
./test.sh -f general/parser/select_from_cache_disk.sim
./test.sh -f general/parser/mixed_blocks.sim
./test.sh -f general/parser/selectResNum.sim
./test.sh -f general/parser/limit.sim
./test.sh -f general/parser/limit1.sim
./test.sh -f general/parser/limit1_tblocks100.sim
./test.sh -f general/parser/mixed_blocks.sim
./test.sh -f general/parser/selectResNum.sim
./test.sh -f general/parser/select_across_vnodes.sim
./test.sh -f general/parser/slimit1.sim
./test.sh -f general/parser/tbnameIn.sim
./test.sh -f general/parser/binary_escapeCharacter.sim
./test.sh -f general/parser/projection_limit_offset.sim
./test.sh -f general/parser/limit2.sim
./test.sh -f general/parser/slimit.sim
./test.sh -f general/parser/fill.sim
./test.sh -f general/parser/fill_stb.sim
./test.sh -f general/parser/interp.sim
./test.sh -f general/parser/where.sim
./test.sh -f general/parser/slimit.sim
./test.sh -f general/parser/select_with_tags.sim
./test.sh -f general/parser/interp.sim
./test.sh -f general/parser/tags_dynamically_specifiy.sim
./test.sh -f general/parser/groupby.sim
./test.sh -f general/parser/set_tag_vals.sim
#./test.sh -f general/parser/slimit_alter_tags.sim
./test.sh -f general/parser/join.sim
./test.sh -f general/parser/join_multivnode.sim
./test.sh -f general/parser/select_with_tags.sim
./test.sh -f general/parser/groupby.sim
./test.sh -f general/parser/binary_escapeCharacter.sim
./test.sh -f general/parser/bug.sim
./test.sh -f general/parser/tags_dynamically_specifiy.sim
./test.sh -f general/parser/set_tag_vals.sim
./test.sh -f general/parser/slimit_alter_tags.sim
./test.sh -f general/parser/stream.sim
./test.sh -f general/parser/repeatAlter.sim
#unsupport ./test.sh -f general/parser/stream_on_sys.sim
#unsupport ./test.sh -f general/parser/stream.sim
#unsupport ./test.sh -f general/parser/repeatStream.sim
./test.sh -f general/stable/disk.sim
@ -206,25 +206,25 @@ cd ../../../debug; make
./test.sh -f general/tag/4.sim
./test.sh -f general/tag/5.sim
./test.sh -f general/tag/6.sim
#unsupport ./test.sh -f general/tag/add.sim
./test.sh -f general/tag/add.sim
./test.sh -f general/tag/bigint.sim
./test.sh -f general/tag/binary_binary.sim
./test.sh -f general/tag/binary.sim
./test.sh -f general/tag/bool_binary.sim
./test.sh -f general/tag/bool_int.sim
./test.sh -f general/tag/bool.sim
#unsupport ./test.sh -f general/tag/change.sim
./test.sh -f general/tag/change.sim
./test.sh -f general/tag/column.sim
#unsupport ./test.sh -f general/tag/commit.sim
#./test.sh -f general/tag/commit.sim
./test.sh -f general/tag/create.sim
#unsupport ./test.sh -f general/tag/delete.sim
./test.sh -f general/tag/delete.sim
./test.sh -f general/tag/double.sim
./test.sh -f general/tag/filter.sim
./test.sh -f general/tag/float.sim
./test.sh -f general/tag/int_binary.sim
./test.sh -f general/tag/int_float.sim
./test.sh -f general/tag/int.sim
#unsupport ./test.sh -f general/tag/set.sim
./test.sh -f general/tag/set.sim
./test.sh -f general/tag/smallint.sim
./test.sh -f general/tag/tinyint.sim
@ -324,18 +324,19 @@ cd ../../../debug; make
./test.sh -f unique/vnode/replica3_vgroup.sim
./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim
./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim # TODO: check file number using sim ?
./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim
./test.sh -f unique/arbitrator/dn3_mn1_full_createTableFail.sim
./test.sh -f unique/arbitrator/dn3_mn1_full_dropDnodeFail.sim
./test.sh -f unique/arbitrator/dn3_mn1_multiCreateDropTable.sim
./test.sh -f unique/arbitrator/dn3_mn1_nw_disable_timeout_autoDropDnode.sim
#./test.sh -f unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim # fail
./test.sh -f unique/arbitrator/dn3_mn1_replica2_wal1_AddDelDnode.sim
./test.sh -f unique/arbitrator/dn3_mn1_replica_change_dropDnod.sim
./test.sh -f unique/arbitrator/dn3_mn1_replica_change.sim
./test.sh -f unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
./test.sh -f unique/arbitrator/dn3_mn1_vnode_change.sim
#./test.sh -f unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim # fail
./test.sh -f unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
./test.sh -f unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
./test.sh -f unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim
#./test.sh -f unique/arbitrator/dn3_mn1_vnode_delDir.sim # unsupport
./test.sh -f unique/arbitrator/dn3_mn1_vnode_nomaster.sim
./test.sh -f unique/arbitrator/dn3_mn2_killDnode.sim
@ -350,7 +351,7 @@ cd ../../../debug; make
./test.sh -f unique/arbitrator/offline_replica3_createTable_online.sim
./test.sh -f unique/arbitrator/offline_replica3_dropDb_online.sim
./test.sh -f unique/arbitrator/offline_replica3_dropTable_online.sim
#./test.sh -f unique/arbitrator/replica_changeWithArbitrator.sim # fail
./test.sh -f unique/arbitrator/replica_changeWithArbitrator.sim
./test.sh -f unique/arbitrator/sync_replica2_alterTable_add.sim
./test.sh -f unique/arbitrator/sync_replica2_alterTable_drop.sim
./test.sh -f unique/arbitrator/sync_replica2_dropDb.sim

View File

@ -1,5 +0,0 @@
cd ../../debug; cmake ..
cd ../../debug; make
./test.sh -f general/db/dropdnodes.sim
./test.sh -f general/user/basic1.sim

View File

@ -1,48 +1,286 @@
cd ../../../debug; cmake ..
cd ../../../debug; make
#./test.sh -f general/parser/lastrow.sim
#./test.sh -f general/parser/nchar.sim
#./test.sh -f general/parser/limit.sim
#./test.sh -f general/parser/limit1.sim
#./test.sh -f general/parser/limit1_tblocks100.sim
#./test.sh -f general/parser/binary_escapeCharacter.sim
#./test.sh -f general/parser/projection_limit_offset.sim
#./test.sh -f general/parser/limit2.sim
#./test.sh -f general/stable/metrics.sim
#./test.sh -f general/table/date.sim
#./test.sh -f unique/big/balance.sim
#./test.sh -f unique/column/replica3.sim
#./test.sh -f unique/db/commit.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete.sim
#unsupport ./test.sh -f general/alter/cached_schema_after_alter.sim
#unsupport ./test.sh -f general/alter/count.sim
#unsupport ./test.sh -f general/alter/import.sim
#unsupport ./test.sh -f general/alter/insert1.sim
#unsupport ./test.sh -f general/alter/insert2.sim
#unsupport ./test.sh -f general/alter/metrics.sim
#unsupport ./test.sh -f general/alter/table.sim
./test.sh -f general/cache/new_metrics.sim
./test.sh -f general/cache/restart_metrics.sim
./test.sh -f general/cache/restart_table.sim
./test.sh -f general/connection/connection.sim
./test.sh -f general/column/commit.sim
./test.sh -f general/column/metrics.sim
./test.sh -f general/column/table.sim
./test.sh -f general/compress/commitlog.sim
./test.sh -f general/compress/compress.sim
./test.sh -f general/compress/compress2.sim
./test.sh -f general/compress/uncompress.sim
./test.sh -f general/compute/avg.sim
./test.sh -f general/compute/bottom.sim
./test.sh -f general/compute/count.sim
./test.sh -f general/compute/diff.sim
./test.sh -f general/compute/diff2.sim
./test.sh -f general/compute/first.sim
./test.sh -f general/compute/interval.sim
./test.sh -f general/compute/last.sim
./test.sh -f general/compute/leastsquare.sim
./test.sh -f general/compute/max.sim
./test.sh -f general/compute/min.sim
./test.sh -f general/compute/null.sim
./test.sh -f general/compute/percentile.sim
./test.sh -f general/compute/stddev.sim
./test.sh -f general/compute/sum.sim
./test.sh -f general/compute/top.sim
./test.sh -f general/db/alter_option.sim
./test.sh -f general/db/alter_tables_d2.sim
./test.sh -f general/db/alter_tables_v1.sim
./test.sh -f general/db/alter_tables_v4.sim
./test.sh -f general/db/alter_vgroups.sim
./test.sh -f general/db/basic.sim
./test.sh -f general/db/basic1.sim
./test.sh -f general/db/basic2.sim
./test.sh -f general/db/basic3.sim
./test.sh -f general/db/basic4.sim
./test.sh -f general/db/basic5.sim
./test.sh -f general/db/delete_reuse1.sim
./test.sh -f general/db/delete_writing1.sim
./test.sh -f general/db/delete.sim
./test.sh -f general/db/len.sim
./test.sh -f general/db/repeat.sim
./test.sh -f general/db/tables.sim
./test.sh -f general/db/vnodes.sim
./test.sh -f general/field/2.sim
./test.sh -f general/field/3.sim
./test.sh -f general/field/4.sim
./test.sh -f general/field/5.sim
./test.sh -f general/field/6.sim
./test.sh -f general/field/bigint.sim
./test.sh -f general/field/binary.sim
./test.sh -f general/field/bool.sim
./test.sh -f general/field/single.sim
./test.sh -f general/field/smallint.sim
./test.sh -f general/field/tinyint.sim
./test.sh -f general/http/restful.sim
./test.sh -f general/http/restful_insert.sim
./test.sh -f general/http/restful_limit.sim
./test.sh -f general/http/restful_full.sim
./test.sh -f general/http/prepare.sim
./test.sh -f general/http/telegraf.sim
./test.sh -f general/http/grafana_bug.sim
./test.sh -f general/http/grafana.sim
./test.sh -f general/import/basic.sim
./test.sh -f general/import/commit.sim
./test.sh -f general/import/large.sim
./test.sh -f general/import/replica1.sim
./test.sh -f general/insert/basic.sim
./test.sh -f general/insert/insert_drop.sim
./test.sh -f general/insert/query_block1_memory.sim
./test.sh -f general/insert/query_block2_memory.sim
./test.sh -f general/insert/query_block1_file.sim
./test.sh -f general/insert/query_block2_file.sim
./test.sh -f general/insert/query_file_memory.sim
./test.sh -f general/insert/query_multi_file.sim
./test.sh -f general/insert/tcp.sim
#./test.sh -f general/parser/alter.sim
./test.sh -f general/parser/alter1.sim
./test.sh -f general/parser/alter_stable.sim
./test.sh -f general/parser/auto_create_tb.sim
./test.sh -f general/parser/auto_create_tb_drop_tb.sim
./test.sh -f general/parser/col_arithmetic_operation.sim
./test.sh -f general/parser/columnValue.sim
./test.sh -f general/parser/commit.sim
./test.sh -f general/parser/create_db.sim
./test.sh -f general/parser/create_mt.sim
./test.sh -f general/parser/create_tb.sim
./test.sh -f general/parser/dbtbnameValidate.sim
./test.sh -f general/parser/import_commit1.sim
./test.sh -f general/parser/import_commit2.sim
./test.sh -f general/parser/import_commit3.sim
./test.sh -f general/parser/insert_tb.sim
./test.sh -f general/parser/first_last.sim
#unsupport ./test.sh -f general/parser/import_file.sim
./test.sh -f general/parser/lastrow.sim
./test.sh -f general/parser/nchar.sim
#unsupport ./test.sh -f general/parser/null_char.sim
./test.sh -f general/parser/single_row_in_tb.sim
./test.sh -f general/parser/select_from_cache_disk.sim
./test.sh -f general/parser/mixed_blocks.sim
./test.sh -f general/parser/selectResNum.sim
./test.sh -f general/parser/limit.sim
./test.sh -f general/parser/limit1.sim
./test.sh -f general/parser/limit1_tblocks100.sim
./test.sh -f general/parser/select_across_vnodes.sim
./test.sh -f general/parser/slimit1.sim
./test.sh -f general/parser/tbnameIn.sim
./test.sh -f general/parser/projection_limit_offset.sim
./test.sh -f general/parser/limit2.sim
./test.sh -f general/parser/fill.sim
./test.sh -f general/parser/fill_stb.sim
./test.sh -f general/parser/where.sim
./test.sh -f general/parser/slimit.sim
./test.sh -f general/parser/select_with_tags.sim
./test.sh -f general/parser/interp.sim
./test.sh -f general/parser/tags_dynamically_specifiy.sim
./test.sh -f general/parser/groupby.sim
./test.sh -f general/parser/set_tag_vals.sim
#./test.sh -f general/parser/slimit_alter_tags.sim
./test.sh -f general/parser/join.sim
./test.sh -f general/parser/join_multivnode.sim
./test.sh -f general/parser/binary_escapeCharacter.sim
./test.sh -f general/parser/bug.sim
#unsupport ./test.sh -f general/parser/stream_on_sys.sim
#unsupport ./test.sh -f general/parser/stream.sim
#unsupport ./test.sh -f general/parser/repeatAlter.sim
#unsupport ./test.sh -f general/parser/repeatStream.sim
./test.sh -f general/stable/disk.sim
./test.sh -f general/stable/dnode3.sim
./test.sh -f general/stable/metrics.sim
./test.sh -f general/stable/show.sim
./test.sh -f general/stable/values.sim
./test.sh -f general/stable/vnode3.sim
#./test.sh -f general/stream/metrics_1.sim
#./test.sh -f general/stream/metrics_del.sim
#./test.sh -f general/stream/metrics_n.sim
#./test.sh -f general/stream/metrics_replica1_vnoden.sim
#./test.sh -f general/stream/new_stream.sim
#./test.sh -f general/stream/restart_stream.sim
#./test.sh -f general/stream/stream_1.sim
#./test.sh -f general/stream/stream_2.sim
#./test.sh -f general/stream/stream_3.sim
#./test.sh -f general/stream/stream_restart.sim
#./test.sh -f general/stream/table_1.sim
#./test.sh -f general/stream/table_del.sim
#./test.sh -f general/stream/table_n.sim
#./test.sh -f general/stream/table_replica1_vnoden.sim
./test.sh -f general/table/autocreate.sim
./test.sh -f general/table/basic1.sim
./test.sh -f general/table/basic2.sim
./test.sh -f general/table/basic3.sim
./test.sh -f general/table/bigint.sim
./test.sh -f general/table/binary.sim
./test.sh -f general/table/bool.sim
./test.sh -f general/table/column_name.sim
./test.sh -f general/table/column_num.sim
./test.sh -f general/table/column_value.sim
./test.sh -f general/table/column2.sim
./test.sh -f general/table/date.sim
./test.sh -f general/table/db.table.sim
./test.sh -f general/table/delete_reuse1.sim
./test.sh -f general/table/describe.sim
./test.sh -f general/table/double.sim
./test.sh -f general/table/fill.sim
./test.sh -f general/table/float.sim
./test.sh -f general/table/int.sim
./test.sh -f general/table/limit.sim
./test.sh -f general/table/smallint.sim
./test.sh -f general/table/table_len.sim
./test.sh -f general/table/table.sim
./test.sh -f general/table/tinyint.sim
./test.sh -f general/table/vgroup.sim
./test.sh -f general/tag/3.sim
./test.sh -f general/tag/4.sim
./test.sh -f general/tag/5.sim
./test.sh -f general/tag/6.sim
#unsupport ./test.sh -f general/tag/add.sim
./test.sh -f general/tag/bigint.sim
./test.sh -f general/tag/binary_binary.sim
./test.sh -f general/tag/binary.sim
./test.sh -f general/tag/bool_binary.sim
./test.sh -f general/tag/bool_int.sim
./test.sh -f general/tag/bool.sim
#unsupport ./test.sh -f general/tag/change.sim
./test.sh -f general/tag/column.sim
#unsupport ./test.sh -f general/tag/commit.sim
./test.sh -f general/tag/create.sim
#unsupport ./test.sh -f general/tag/delete.sim
./test.sh -f general/tag/double.sim
./test.sh -f general/tag/filter.sim
./test.sh -f general/tag/float.sim
./test.sh -f general/tag/int_binary.sim
./test.sh -f general/tag/int_float.sim
./test.sh -f general/tag/int.sim
#unsupport ./test.sh -f general/tag/set.sim
./test.sh -f general/tag/smallint.sim
./test.sh -f general/tag/tinyint.sim
./test.sh -f general/user/authority.sim
./test.sh -f general/user/monitor.sim
./test.sh -f general/user/pass_alter.sim
./test.sh -f general/user/pass_len.sim
./test.sh -f general/user/user_create.sim
./test.sh -f general/user/user_len.sim
./test.sh -f general/vector/metrics_field.sim
./test.sh -f general/vector/metrics_mix.sim
./test.sh -f general/vector/metrics_query.sim
./test.sh -f general/vector/metrics_tag.sim
./test.sh -f general/vector/metrics_time.sim
./test.sh -f general/vector/multi.sim
./test.sh -f general/vector/single.sim
./test.sh -f general/vector/table_field.sim
./test.sh -f general/vector/table_mix.sim
./test.sh -f general/vector/table_query.sim
./test.sh -f general/vector/table_time.sim
./test.sh -f unique/account/account_create.sim
./test.sh -f unique/account/account_delete.sim
./test.sh -f unique/account/account_len.sim
./test.sh -f unique/account/authority.sim
./test.sh -f unique/account/basic.sim
./test.sh -f unique/account/paras.sim
./test.sh -f unique/account/pass_alter.sim
./test.sh -f unique/account/pass_len.sim
./test.sh -f unique/account/usage.sim
./test.sh -f unique/account/user_create.sim
./test.sh -f unique/account/user_len.sim
./test.sh -f unique/cluster/balance1.sim
./test.sh -f unique/cluster/balance2.sim
./test.sh -f unique/column/replica3.sim
./test.sh -f unique/db/commit.sim
./test.sh -f unique/db/delete.sim
#./test.sh -f unique/db/replica_add12.sim
#./test.sh -f unique/db/replica_add13.sim
#./test.sh -f unique/vnode/replica3_basic.sim
#./test.sh -f unique/dnode/balance1.sim
#./test.sh -f unique/dnode/balance2.sim
#./test.sh -f unique/dnode/balance3.sim
#./test.sh -f unique/cluster/balance1.sim
#./test.sh -f unique/cluster/balance2.sim
#./test.sh -f unique/cluster/balance3.sim
./test.sh -f unique/dnode/alternativeRole.sim
./test.sh -f unique/dnode/balance1.sim
./test.sh -f unique/dnode/balance2.sim
./test.sh -f unique/dnode/offline1.sim
./test.sh -f unique/dnode/remove2.sim
./test.sh -f unique/dnode/vnode_clean.sim
./test.sh -f unique/http/admin.sim
./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim
./test.sh -f unique/stable/balance_replica1.sim
./test.sh -f unique/stable/dnode2_stop.sim
./test.sh -f unique/stable/dnode3.sim
./test.sh -f unique/stable/replica2_dnode4.smallint
./test.sh -f unique/mnode/mgmt22.sim
./test.sh -f unique/mnode/mgmt33.sim
./test.sh -f unique/vnode/many.sim
./test.sh -f unique/vnode/replica2_basic2.sim

View File

@ -97,13 +97,17 @@ 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
while [ -n "$PID" ]
do
if [ "$SIGNAL" = "SIGINT" ]; then
echo killed by signal
echo try to kill by signal SIGINT
kill -SIGINT $PID
else
echo try to kill by signal SIGKILL
kill -9 $PID
fi
fi
sleep 1
PID=`ps -ef|grep taosd | grep $RCFG_DIR | grep -v grep | awk '{print $2}'`
done
fi

View File

@ -1,6 +1,8 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
#system sh/exec.sh -n monitor -s 1
system sh/exec.sh -n monitorInterval -s 1
sleep 3000
sql connect
@ -25,13 +27,16 @@ endi
if $data05 != 0/10 then
return -1
endi
if $data06 != 0.000/unlimited then
return -1
endi
print =============== check usage account
sql create database d1
sql create database d2
sql create database d3
sql create database d4
sql create database d5
sql create database d1 wal 2
sql create database d2 wal 2
sql create database d3 wal 2
sql create database d4 wal 2
sql create database d5 wal 2
sql create table d1.t1 (ts timestamp, i int);
sql create user u1 pass "u1"
@ -53,6 +58,75 @@ endi
if $data05 != 0/10 then
return -1
endi
if $data06 != 0.000/unlimited then
return -1
endi
print =============== step2
sql alter account root pass "taosdata" tseries 10 storage 1073741824 streams 10 dbs 5 users 5
sql show accounts
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != root then
return -1
endi
if $data02 != 4/5 then
return -1
endi
if $data03 != 5/5 then
return -1
endi
if $data04 != 1/10 then
return -1
endi
if $data05 != 0/10 then
return -1
endi
if $data06 != 0.000/1.000 then
return -1
endi
print =============== step3
sql alter account root pass "taosdata" tseries 10 storage 16 streams 10 dbs 5 users 5
sql show accounts
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != root then
return -1
endi
if $data02 != 4/5 then
return -1
endi
if $data03 != 5/5 then
return -1
endi
if $data04 != 1/10 then
return -1
endi
if $data05 != 0/10 then
return -1
endi
if $data06 != 0.000/0.000 then
return -1
endi
print =============== step4
sql insert into d1.t1 values(now + 1s, 1)
sql insert into d1.t1 values(now + 2s, 2)
# no write auth
sleep 3000
sql_error insert into d1.t1 values(now + 3s, 2)
sql_error insert into d1.t1 values(now + 4s, 2)
sql alter account root pass "taosdata" tseries 10 storage 36 streams 10 dbs 5 users 5
sleep 3000
sql insert into d1.t1 values(now + 5s, 1)
sql insert into d1.t1 values(now + 6s, 2)
# no write auth
sleep 3000
sql_error insert into d1.t1 values(now + 7s, 2)
sql_error insert into d1.t1 values(now + 8s, 2)
print =============== check grant
sql_error create database d6

View File

@ -158,11 +158,11 @@ if $data00 != $totalRows then
return -1
endi
system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l
print ---->dnode3 data files: $system_content , expect is 9
#if $system_content != @9@ then
# return -1
#endi
system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
print ---->dnode3 data files: $system_content expect: 9
if $system_content != 9 then
return -1
endi
print ============== step5: insert two data rows: now-16d, now+16d,
sql insert into $tb values ( now - 21d , -21 )
@ -175,11 +175,11 @@ if $data00 != $totalRows then
return -1
endi
system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l
print ---->dnode2 data files: $system_content , expect is 3
#if $system_content != @3@ then
# return -1
#endi
system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
print ---->dnode2 data files: $system_content expect: 3
if $system_content != 3 then
return -1
endi
print ============== step7: restart dnode3, waiting sync end
system sh/exec.sh -n dnode3 -s start
@ -215,13 +215,13 @@ if $data00 != $totalRows then
return -1
endi
system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l
print ---->dnode2 data files: $system_content , expect is 3
#if $system_content != @3@ then
# return -1
#endi
system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l
print ---->dnode3 data files: $system_content , expect is 3
#if $system_content != @3@ then
# return -1
#endi
system_content ls ../../../sim/dnode2/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
print ---->dnode2 data files: $system_content expect: 3
if $system_content != 3 then
return -1
endi
system_content ls ../../../sim/dnode3/data/vnode/vnode2/tsdb/data/ -l |grep "^-"|wc -l | tr -d '\n'
print ---->dnode3 data files: $system_content expect: 3
if $system_content != 3 then
return -1
endi

View File

@ -346,10 +346,11 @@ print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $dat
print ============== step7: restart dnode3, and run query
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
sleep $sleepTimer
$loopCnt = 0
wait_dnode3_reready_2:
wait_dnode23_reready_2:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
@ -357,7 +358,7 @@ endi
sql show dnodes
if $rows != 3 then
sleep 2000
goto wait_dnode3_reready_2
goto wait_dnode23_reready_2
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
@ -366,13 +367,18 @@ $dnode1Status = $data4_1
$dnode2Status = $data4_2
$dnode3Status = $data4_3
if $dnode2Status != ready then
sleep 2000
goto wait_dnode23_reready_2
endi
if $dnode3Status != ready then
sleep 2000
goto wait_dnode3_reready_2
goto wait_dnode23_reready_2
endi
$loopCnt = 0
wait_dnode3_vgroup_master_2:
wait_dnode23_vgroup_ok:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
@ -380,7 +386,7 @@ endi
sql show vgroups
if $rows != 1 then
sleep 2000
goto wait_dnode3_vgroup_master_2
goto wait_dnode23_vgroup_ok
endi
print show vgroups:
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
@ -389,13 +395,13 @@ print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $dat
$dnode2Vtatus = $data7_2
$dnode3Vtatus = $data4_2
if $dnode2Vtatus != offline then
if $dnode2Vtatus == offline then
sleep 2000
goto wait_dnode3_vgroup_master_2
goto wait_dnode23_vgroup_ok
endi
if $dnode3Vtatus != master then
if $dnode3Vtatus == offline then
sleep 2000
goto wait_dnode3_vgroup_master_2
goto wait_dnode23_vgroup_ok
endi
sql select count(*) from $stb

View File

@ -345,11 +345,12 @@ print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2 $data5_2 $data6_2 $dat
print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $data7_3 $data8_3 $data9_3
print ============== step7: restart dnode3, and run query
print ============== step7: restart dnode2/dnode3, and run query
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode3 -s start
sleep $sleepTimer
$loopCnt = 0
wait_dnode3_reready_2:
wait_dnode23_reready_2:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
@ -357,7 +358,7 @@ endi
sql show dnodes
if $rows != 3 then
sleep 2000
goto wait_dnode3_reready_2
goto wait_dnode23_reready_2
endi
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1
print $data0_2 $data1_2 $data2_2 $data3_2 $data4_2
@ -366,13 +367,17 @@ $dnode1Status = $data4_1
$dnode2Status = $data4_2
$dnode3Status = $data4_3
if $dnode2Status != ready then
sleep 2000
goto wait_dnode23_reready_2
endi
if $dnode3Status != ready then
sleep 2000
goto wait_dnode3_reready_2
goto wait_dnode23_reready_2
endi
$loopCnt = 0
wait_dnode3_vgroup_master_2:
wait_dnode23_vgroup_ok:
$loopCnt = $loopCnt + 1
if $loopCnt == 10 then
return -1
@ -380,7 +385,7 @@ endi
sql show vgroups
if $rows != 1 then
sleep 2000
goto wait_dnode3_vgroup_master_2
goto wait_dnode23_vgroup_ok
endi
print show vgroups:
print $data0_1 $data1_1 $data2_1 $data3_1 $data4_1 $data5_1 $data6_1 $data7_1 $data8_1 $data9_1
@ -389,13 +394,13 @@ print $data0_3 $data1_3 $data2_3 $data3_3 $data4_3 $data5_3 $data6_3 $dat
$dnode2Vtatus = $data7_2
$dnode3Vtatus = $data4_2
if $dnode2Vtatus != offline then
if $dnode2Vtatus == offline then
sleep 2000
goto wait_dnode3_vgroup_master_2
goto wait_dnode23_vgroup_ok
endi
if $dnode3Vtatus != master then
if $dnode3Vtatus == offline then
sleep 2000
goto wait_dnode3_vgroup_master_2
goto wait_dnode23_vgroup_ok
endi
sql select count(*) from $stb

View File

@ -11,7 +11,8 @@ run unique/arbitrator/dn3_mn1_stopDnode_timeout.sim
run unique/arbitrator/dn3_mn1_vnode_change.sim
run unique/arbitrator/dn3_mn1_vnode_corruptFile_offline.sim
run unique/arbitrator/dn3_mn1_vnode_corruptFile_online.sim
run unique/arbitrator/dn3_mn1_vnode_delDir.sim
run unique/arbitrator/dn3_mn1_vnode_noCorruptFile_offline.sim
####run unique/arbitrator/dn3_mn1_vnode_delDir.sim # unsupport
run unique/arbitrator/dn3_mn1_vnode_nomaster.sim
run unique/arbitrator/dn3_mn2_killDnode.sim
run unique/arbitrator/insert_duplicationTs.sim