Merge branch '3.0' of https://github.com/taosdata/TDengine into fix/TS-2504
This commit is contained in:
commit
b60392b670
10
README-CN.md
10
README-CN.md
|
@ -104,6 +104,16 @@ sudo yum install -y zlib-devel zlib-static xz-devel snappy-devel jansson jansson
|
|||
sudo yum config-manager --set-enabled Powertools
|
||||
```
|
||||
|
||||
#### CentOS + devtoolset
|
||||
|
||||
除上述编译依赖包,需要执行以下命令:
|
||||
|
||||
```
|
||||
sudo yum install centos-release-scl
|
||||
sudo yum install devtoolset-9 devtoolset-9-libatomic-devel
|
||||
scl enable devtoolset-9 -- bash
|
||||
```
|
||||
|
||||
### macOS
|
||||
|
||||
```
|
||||
|
|
10
README.md
10
README.md
|
@ -111,6 +111,16 @@ If the PowerTools installation fails, you can try to use:
|
|||
sudo yum config-manager --set-enabled powertools
|
||||
```
|
||||
|
||||
#### For CentOS + devtoolset
|
||||
|
||||
Besides above dependencies, please run following commands:
|
||||
|
||||
```
|
||||
sudo yum install centos-release-scl
|
||||
sudo yum install devtoolset-9 devtoolset-9-libatomic-devel
|
||||
scl enable devtoolset-9 -- bash
|
||||
```
|
||||
|
||||
### macOS
|
||||
|
||||
```
|
||||
|
|
|
@ -126,6 +126,22 @@ alter_database_option: {
|
|||
}
|
||||
```
|
||||
|
||||
### ALTER CACHESIZE
|
||||
|
||||
The command of changing database configuration parameters is easy to use, but it's hard to determine whether a parameter is proper or not. In this section we will describe how to determine whether cachesize is big enough.
|
||||
|
||||
1. How to check cachesize?
|
||||
|
||||
You can use `select * from information_schema.ins_databases;` to get the value of cachesize.
|
||||
|
||||
2. How to check cacheload?
|
||||
|
||||
You can use `show <db_name>.vgroups;` to check the value of cacheload.
|
||||
|
||||
3. Determine whether cachesize is big engough
|
||||
|
||||
If the value of `cacheload` is very close to the value of `cachesize`, then it's very probably that `cachesize` is too small. If the value of `cacheload` is much smaller than the value of `cachesize`, then `cachesize` is big enough. You can use this simple principle to determine. Depending on how much memory is available in your system, you can choose to double `cachesize` or incrase it by even 5 or more times.
|
||||
|
||||
:::note
|
||||
Other parameters cannot be modified after the database has been created.
|
||||
|
||||
|
|
|
@ -126,6 +126,22 @@ alter_database_option: {
|
|||
}
|
||||
```
|
||||
|
||||
### 修改 CACHESIZE
|
||||
|
||||
修改数据库参数的命令使用简单,难的是如何确定是否需要修改以及如何修改。本小节描述如何判断数据库的 cachesize 是否够用。
|
||||
|
||||
1. 如何查看 cachesize?
|
||||
|
||||
通过 select * from information_schema.ins_databases; 可以查看这些 cachesize 的具体值。
|
||||
|
||||
2. 如何查看 cacheload?
|
||||
|
||||
通过 show <db_name>.vgroups; 可以查看 cacheload
|
||||
|
||||
3. 判断 cachesize 是否够用
|
||||
|
||||
如果 cacheload 非常接近 cachesize,则 cachesize 可能过小。 如果 cacheload 明显小于 cachesize 则 cachesize 是够用的。可以根据这个原则判断是否需要修改 cachesize 。具体修改值可以根据系统可用内存情况来决定是加倍或者是提高几倍。
|
||||
|
||||
:::note
|
||||
其它参数在 3.0.0.0 中暂不支持修改
|
||||
|
||||
|
|
|
@ -26,23 +26,19 @@ typedef struct SEventWindowOperatorInfo {
|
|||
SOptrBasicInfo binfo;
|
||||
SAggSupporter aggSup;
|
||||
SExprSupp scalarSup;
|
||||
SGroupResInfo groupResInfo;
|
||||
SWindowRowsSup winSup;
|
||||
bool hasKey;
|
||||
SStateKeys stateKey;
|
||||
int32_t tsSlotId; // primary timestamp column slot id
|
||||
STimeWindowAggSupp twAggSup;
|
||||
|
||||
SFilterInfo* pStartCondInfo;
|
||||
SFilterInfo* pEndCondInfo;
|
||||
bool inWindow;
|
||||
SResultRow* pRow;
|
||||
uint64_t groupId; // current group id, used to identify the data block from different groups
|
||||
SFilterInfo* pStartCondInfo;
|
||||
SFilterInfo* pEndCondInfo;
|
||||
bool inWindow;
|
||||
SResultRow* pRow;
|
||||
} SEventWindowOperatorInfo;
|
||||
|
||||
static SSDataBlock* eventWindowAggregate(SOperatorInfo* pOperator);
|
||||
static void destroyEWindowOperatorInfo(void* param);
|
||||
static void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock);
|
||||
static SSDataBlock* doEventWindowAgg(SOperatorInfo* pOperator);
|
||||
static int32_t eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock);
|
||||
|
||||
// todo : move to util
|
||||
static void doKeepNewWindowStartInfo(SWindowRowsSup* pRowSup, const int64_t* tsList, int32_t rowIndex,
|
||||
|
@ -176,7 +172,6 @@ void destroyEWindowOperatorInfo(void* param) {
|
|||
colDataDestroy(&pInfo->twAggSup.timeWindowData);
|
||||
|
||||
cleanupAggSup(&pInfo->aggSup);
|
||||
cleanupGroupResInfo(&pInfo->groupResInfo);
|
||||
taosMemoryFreeClear(param);
|
||||
}
|
||||
|
||||
|
@ -254,36 +249,45 @@ static void doEventWindowAggImpl(SEventWindowOperatorInfo* pInfo, SExprSupp* pSu
|
|||
pBlock->info.rows, numOfOutput);
|
||||
}
|
||||
|
||||
void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock) {
|
||||
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
|
||||
SExprSupp* pSup = &pOperator->exprSupp;
|
||||
|
||||
SSDataBlock* pRes = pInfo->binfo.pRes;
|
||||
int64_t gid = pBlock->info.id.groupId;
|
||||
|
||||
int32_t eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock) {
|
||||
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
|
||||
SExprSupp* pSup = &pOperator->exprSupp;
|
||||
SSDataBlock* pRes = pInfo->binfo.pRes;
|
||||
int64_t gid = pBlock->info.id.groupId;
|
||||
SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->tsSlotId);
|
||||
TSKEY* tsList = (TSKEY*)pColInfoData->pData;
|
||||
|
||||
SWindowRowsSup* pRowSup = &pInfo->winSup;
|
||||
SColumnInfoData *ps = NULL, *pe = NULL;
|
||||
int32_t rowIndex = 0;
|
||||
|
||||
SWindowRowsSup* pRowSup = &pInfo->winSup;
|
||||
pRowSup->numOfRows = 0;
|
||||
if (pInfo->groupId == 0) {
|
||||
pInfo->groupId = gid;
|
||||
} else if (pInfo->groupId != gid) {
|
||||
// this is a new group, reset the info
|
||||
pInfo->inWindow = false;
|
||||
}
|
||||
|
||||
SFilterColumnParam param1 = {.numOfCols = taosArrayGetSize(pBlock->pDataBlock), .pDataBlock = pBlock->pDataBlock};
|
||||
int32_t code = filterSetDataFromSlotId(pInfo->pStartCondInfo, ¶m1);
|
||||
|
||||
int32_t code = filterSetDataFromSlotId(pInfo->pStartCondInfo, ¶m1);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t status1 = 0;
|
||||
bool keep1 = filterExecute(pInfo->pStartCondInfo, pBlock, &ps, NULL, param1.numOfCols, &status1);
|
||||
filterExecute(pInfo->pStartCondInfo, pBlock, &ps, NULL, param1.numOfCols, &status1);
|
||||
|
||||
SFilterColumnParam param2 = {.numOfCols = taosArrayGetSize(pBlock->pDataBlock), .pDataBlock = pBlock->pDataBlock};
|
||||
code = filterSetDataFromSlotId(pInfo->pEndCondInfo, ¶m2);
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
return code;
|
||||
}
|
||||
|
||||
int32_t status2 = 0;
|
||||
bool keep2 = filterExecute(pInfo->pEndCondInfo, pBlock, &pe, NULL, param2.numOfCols, &status2);
|
||||
filterExecute(pInfo->pEndCondInfo, pBlock, &pe, NULL, param2.numOfCols, &status2);
|
||||
|
||||
int32_t rowIndex = 0;
|
||||
int32_t startIndex = pInfo->inWindow ? 0 : -1;
|
||||
|
||||
while (rowIndex < pBlock->info.rows) {
|
||||
if (pInfo->inWindow) { // let's find the first end value
|
||||
for (rowIndex = startIndex; rowIndex < pBlock->info.rows; ++rowIndex) {
|
||||
|
@ -294,7 +298,6 @@ void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInf
|
|||
|
||||
if (rowIndex < pBlock->info.rows) {
|
||||
doEventWindowAggImpl(pInfo, pSup, startIndex, rowIndex, pBlock, tsList, pTaskInfo);
|
||||
|
||||
doUpdateNumOfRows(pSup->pCtx, pInfo->pRow, pSup->numOfExprs, pSup->rowEntryInfoOffset);
|
||||
|
||||
// check buffer size
|
||||
|
@ -324,9 +327,9 @@ void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInf
|
|||
}
|
||||
|
||||
if (pInfo->inWindow) {
|
||||
continue;
|
||||
continue; // try to find the end position
|
||||
} else {
|
||||
break;
|
||||
break; // no valid start position, quit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -335,4 +338,6 @@ void eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInf
|
|||
taosMemoryFree(ps);
|
||||
colDataDestroy(pe);
|
||||
taosMemoryFree(pe);
|
||||
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ endi
|
|||
|
||||
if $data01 != 4 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
|
||||
|
||||
|
@ -239,7 +239,7 @@ endi
|
|||
|
||||
if $data01 != 6 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
goto loop5
|
||||
endi
|
||||
|
||||
|
||||
|
|
|
@ -325,19 +325,19 @@ if $rows != 12 then
|
|||
endi
|
||||
if $data21 != 3 then
|
||||
print ====streamt10=data21=$data21
|
||||
return -1
|
||||
goto loop6
|
||||
endi
|
||||
if $data31 != 4 then
|
||||
print ====streamt10=data31=$data31
|
||||
return -1
|
||||
goto loop6
|
||||
endi
|
||||
if $data71 != 8 then
|
||||
print ====streamt10=data71=$data71
|
||||
return -1
|
||||
goto loop6
|
||||
endi
|
||||
if $data91 != 10 then
|
||||
print ====streamt10=data91=$data91
|
||||
return -1
|
||||
goto loop6
|
||||
endi
|
||||
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@ system sh/exec.sh -n dnode1 -s start
|
|||
sleep 200
|
||||
sql connect
|
||||
|
||||
print step 1 start
|
||||
|
||||
sql drop stream if exists streams1;
|
||||
sql drop database if exists test1;
|
||||
sql create database test1 vgroups 1;
|
||||
|
@ -38,161 +40,165 @@ endi
|
|||
|
||||
if $data01 != 2.000000000 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data02 != 1.000000000 then
|
||||
print =====data02=$data02
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data03 != ccc then
|
||||
print =====data03=$data03
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data04 != 1 then
|
||||
print =====data04=$data04
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data11 != 4.000000000 then
|
||||
print =====data11=$data11
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
if $data12 != 2.000000000 then
|
||||
print =====data12=$data12
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
if $data13 != NULL then
|
||||
print =====data13=$data13
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 6.000000000 then
|
||||
print =====data21=$data21
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data22 != 3.000000000 then
|
||||
print =====data22=$data22
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data23 != NULL then
|
||||
print =====data23=$data23
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 8.000000000 then
|
||||
print =====data31=$data31
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data32 != 4.000000000 then
|
||||
print =====data32=$data32
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data33 != aaa then
|
||||
print =====data33=$data33
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data41 != 8.666666667 then
|
||||
print =====data41=$data41
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data42 != 4.333333333 then
|
||||
print =====data42=$data42
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data43 != NULL then
|
||||
print =====data43=$data43
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data51 != 9.333333333 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data52 != 4.666666667 then
|
||||
print =====data52=$data52
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data53 != NULL then
|
||||
print =====data53=$data53
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data61 != 10.000000000 then
|
||||
print =====data61=$data61
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data62 != 5.000000000 then
|
||||
print =====data62=$data62
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data71 != 8.000000000 then
|
||||
print =====data71=$data71
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data72 != 4.000000000 then
|
||||
print =====data72=$data72
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data81 != 6.000000000 then
|
||||
print =====data81=$data81
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data82 != 3.000000000 then
|
||||
print =====data82=$data82
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data91 != 4.000000000 then
|
||||
print =====data91=$data91
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data92 != 2.000000000 then
|
||||
print =====data92=$data92
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
if $data[10][1] != 4.666666667 then
|
||||
print =====data[10][1]=$data[10][1]
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data[10][2] != 2.333333333 then
|
||||
print =====data[10][2]=$data[10][2]
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data[11][1] != 5.333333333 then
|
||||
print =====data[11][1]=$data[11][1]
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data[11][2] != 2.666666667 then
|
||||
print =====data[11][2]=$data[11][2]
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data[12][1] != 6.000000000 then
|
||||
print =====data[12][1]=$data[12][1]
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data[12][2] != 3.000000000 then
|
||||
print =====data[12][2]=$data[12][2]
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
print step 1 end
|
||||
|
||||
print step 2 start
|
||||
|
||||
sql drop stream if exists streams2;
|
||||
sql drop database if exists test2;
|
||||
|
@ -224,161 +230,163 @@ endi
|
|||
|
||||
if $data01 != 2.000000000 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data02 != 1.000000000 then
|
||||
print =====data02=$data02
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data03 != ccc then
|
||||
print =====data03=$data03
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data04 != 1 then
|
||||
print =====data04=$data04
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data11 != 4.000000000 then
|
||||
print =====data11=$data11
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data12 != 2.000000000 then
|
||||
print =====data12=$data12
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data13 != NULL then
|
||||
print =====data13=$data13
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 6.000000000 then
|
||||
print =====data21=$data21
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data22 != 3.000000000 then
|
||||
print =====data22=$data22
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data23 != NULL then
|
||||
print =====data23=$data23
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 8.000000000 then
|
||||
print =====data31=$data31
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data32 != 4.000000000 then
|
||||
print =====data32=$data32
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data33 != aaa then
|
||||
print =====data33=$data33
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data41 != 8.666666667 then
|
||||
print =====data41=$data41
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data42 != 4.333333333 then
|
||||
print =====data42=$data42
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data43 != NULL then
|
||||
print =====data43=$data43
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data51 != 9.333333333 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data52 != 4.666666667 then
|
||||
print =====data52=$data52
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data53 != NULL then
|
||||
print =====data53=$data53
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data61 != 10.000000000 then
|
||||
print =====data61=$data61
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data62 != 5.000000000 then
|
||||
print =====data62=$data62
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data71 != 8.000000000 then
|
||||
print =====data71=$data71
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data72 != 4.000000000 then
|
||||
print =====data72=$data72
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data81 != 6.000000000 then
|
||||
print =====data81=$data81
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data82 != 3.000000000 then
|
||||
print =====data82=$data82
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data91 != 4.000000000 then
|
||||
print =====data91=$data91
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data92 != 2.000000000 then
|
||||
print =====data92=$data92
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
if $data[10][1] != 4.666666667 then
|
||||
print =====data[10][1]=$data[10][1]
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data[10][2] != 2.333333333 then
|
||||
print =====data[10][2]=$data[10][2]
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data[11][1] != 5.333333333 then
|
||||
print =====data[11][1]=$data[11][1]
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data[11][2] != 2.666666667 then
|
||||
print =====data[11][2]=$data[11][2]
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
|
||||
if $data[12][1] != 6.000000000 then
|
||||
print =====data[12][1]=$data[12][1]
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
if $data[12][2] != 3.000000000 then
|
||||
print =====data[12][2]=$data[12][2]
|
||||
return -1
|
||||
goto loop2
|
||||
endi
|
||||
|
||||
print step 2 end
|
||||
|
||||
print step 3 start
|
||||
|
||||
sql drop stream if exists streams3;
|
||||
sql drop database if exists test3;
|
||||
|
@ -412,98 +420,98 @@ endi
|
|||
|
||||
if $data01 != 3 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data02 != 6.000000000 then
|
||||
print =====data02=$data02
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data03 != ccc then
|
||||
print =====data03=$data03
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
|
||||
if $data11 != 3 then
|
||||
print =====data11=$data11
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data12 != 7.000000000 then
|
||||
print =====data12=$data12
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data13 != NULL then
|
||||
print =====data13=$data13
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 4 then
|
||||
print =====data21=$data21
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data22 != 8.000000000 then
|
||||
print =====data22=$data22
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data23 != ddd then
|
||||
print =====data23=$data23
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 2 then
|
||||
print =====data31=$data31
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data32 != 5.000000000 then
|
||||
print =====data32=$data32
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data33 != NULL then
|
||||
print =====data33=$data33
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
|
||||
|
||||
if $data41 != 1 then
|
||||
print =====data41=$data41
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data42 != 2.000000000 then
|
||||
print =====data42=$data42
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data43 != aaa then
|
||||
print =====data43=$data43
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
|
||||
|
||||
if $data51 != 1 then
|
||||
print =====data51=$data51
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data52 != 3.000000000 then
|
||||
print =====data52=$data52
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data53 != NULL then
|
||||
print =====data53=$data53
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
|
||||
|
||||
if $data61 != 2 then
|
||||
print =====data61=$data61
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data62 != 4.000000000 then
|
||||
print =====data62=$data62
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
if $data63 != bbb then
|
||||
print =====data63=$data63
|
||||
return -1
|
||||
goto loop3
|
||||
endi
|
||||
|
||||
|
||||
|
@ -534,42 +542,42 @@ endi
|
|||
|
||||
if $data01 != 6 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
if $data02 != 12.000000000 then
|
||||
print =====data02=$data02
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
if $data03 != fff then
|
||||
print =====data03=$data03
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
|
||||
if $data11 != 6 then
|
||||
print =====data11=$data11
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
if $data12 != 13.000000000 then
|
||||
print =====data12=$data12
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
if $data13 != NULL then
|
||||
print =====data13=$data13
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 7 then
|
||||
print =====data21=$data21
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
if $data22 != 14.000000000 then
|
||||
print =====data22=$data22
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
if $data23 != ggg then
|
||||
print =====data23=$data23
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
|
||||
|
||||
|
@ -626,34 +634,11 @@ if $data[12][3] != hhh then
|
|||
return -1
|
||||
endi
|
||||
|
||||
if $data[13][1] != 8 then
|
||||
print =====data[13][1]=$data[13][1]
|
||||
return -1
|
||||
endi
|
||||
if $data[13][2] != 17.000000000 then
|
||||
print =====data[13][2]=$data[13][2]
|
||||
return -1
|
||||
endi
|
||||
if $data[13][3] != NULL then
|
||||
print =====data[13][3]=$data[13][3]
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data[14][1] != 9 then
|
||||
print =====data[14][1]=$data[14][1]
|
||||
return -1
|
||||
endi
|
||||
if $data[14][2] != 18.000000000 then
|
||||
print =====data[14][2]=$data[14][2]
|
||||
return -1
|
||||
endi
|
||||
if $data[14][3] != iii then
|
||||
print =====data[14][3]=$data[14][3]
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
print step 3 end
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ endi
|
|||
|
||||
if $data04 == 0 then
|
||||
print ====streamt1=data04=$data04
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
|
||||
sql select group_id,count(*) from streamt1 group by group_id;
|
||||
|
@ -168,7 +168,7 @@ endi
|
|||
|
||||
if $data04 == 0 then
|
||||
print ====streamt2=data04=$data04
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
|
||||
sql select group_id,count(*) from streamt2 group by group_id;
|
||||
|
@ -187,7 +187,7 @@ endi
|
|||
|
||||
if $data04 == 0 then
|
||||
print ====streamt3=data04=$data04
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
|
||||
sql select group_id,count(*) from streamt3 group by group_id;
|
||||
|
@ -207,7 +207,7 @@ endi
|
|||
|
||||
if $data04 == 0 then
|
||||
print ====streamt4=data04=$data04
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
|
||||
sql select group_id,count(*) from streamt4 group by group_id;
|
||||
|
@ -226,7 +226,7 @@ endi
|
|||
|
||||
if $data04 == 0 then
|
||||
print ====streamt5=data04=$data04
|
||||
return -1
|
||||
goto loop4
|
||||
endi
|
||||
|
||||
sql select group_id,count(*) from streamt5 group by group_id;
|
||||
|
|
|
@ -228,31 +228,31 @@ endi
|
|||
|
||||
if $data72 != 6.000000000 then
|
||||
print =====data72=$data72
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data73 != 3.000000000 then
|
||||
print =====data73=$data73
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data82 != 6.000000000 then
|
||||
print =====data82=$data82
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data83 != 3.000000000 then
|
||||
print =====data83=$data83
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
if $data92 != 6.000000000 then
|
||||
print =====data92=$data92
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
if $data93 != 3.000000000 then
|
||||
print =====data93=$data93
|
||||
return -1
|
||||
goto loop1
|
||||
endi
|
||||
|
||||
|
||||
|
@ -483,535 +483,33 @@ endi
|
|||
|
||||
if $data72 != 6.000000000 then
|
||||
print =====data72=$data72
|
||||
return -1
|
||||
goto loop6
|
||||
endi
|
||||
if $data73 != 3.000000000 then
|
||||
print =====data73=$data73
|
||||
return -1
|
||||
goto loop6
|
||||
endi
|
||||
|
||||
|
||||
if $data82 != 6.000000000 then
|
||||
print =====data82=$data82
|
||||
return -1
|
||||
goto loop6
|
||||
endi
|
||||
if $data83 != 3.000000000 then
|
||||
print =====data83=$data83
|
||||
return -1
|
||||
goto loop6
|
||||
endi
|
||||
|
||||
|
||||
if $data92 != 6.000000000 then
|
||||
print =====data92=$data92
|
||||
return -1
|
||||
goto loop6
|
||||
endi
|
||||
if $data93 != 3.000000000 then
|
||||
print =====data93=$data93
|
||||
return -1
|
||||
goto loop6
|
||||
endi
|
||||
|
||||
|
||||
|
||||
sql drop stream if exists streams7;
|
||||
sql drop stream if exists streams8;
|
||||
sql drop database if exists test7;
|
||||
sql create database test7 vgroups 1;
|
||||
sql use test7;
|
||||
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
|
||||
sql create stream streams7 trigger at_once into streamt7 as select _wstart as ts, max(a), b+c, s from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(prev);
|
||||
sql create stream streams8 trigger at_once into streamt8 as select _wstart as ts, max(a), 1, b+1 from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(next);
|
||||
sql insert into t1 values(1648791215000,1,1,1,1.0,'aaa');
|
||||
sql insert into t1 values(1648791217000,2,2,2,2.0,'bbb');
|
||||
sql insert into t1 values(1648791211000,3,3,3,3.0,'ccc');
|
||||
sql insert into t1 values(1648791213000,4,4,4,4.0,'ddd');
|
||||
|
||||
|
||||
$loop_count = 0
|
||||
|
||||
loop7:
|
||||
sleep 300
|
||||
sql select * from streamt7 order by ts;
|
||||
|
||||
$loop_count = $loop_count + 1
|
||||
if $loop_count == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $rows != 7 then
|
||||
print =====rows=$rows
|
||||
goto loop7
|
||||
endi
|
||||
|
||||
|
||||
if $data01 != 3 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 6.000000000 then
|
||||
print =====data02=$data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != ccc then
|
||||
print =====data03=$data03
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data11 != 3 then
|
||||
print =====data11=$data11
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6.000000000 then
|
||||
print =====data12=$data12
|
||||
return -1
|
||||
endi
|
||||
if $data13 != ccc then
|
||||
print =====data13=$data13
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 4 then
|
||||
print =====data21=$data21
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 8.000000000 then
|
||||
print =====data22=$data22
|
||||
return -1
|
||||
endi
|
||||
if $data23 != ddd then
|
||||
print =====data23=$data23
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 4 then
|
||||
print =====data31=$data31
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8.000000000 then
|
||||
print =====data32=$data32
|
||||
return -1
|
||||
endi
|
||||
if $data33 != ddd then
|
||||
print =====data33=$data33
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data41 != 1 then
|
||||
print =====data41=$data41
|
||||
return -1
|
||||
endi
|
||||
if $data42 != 2.000000000 then
|
||||
print =====data42=$data42
|
||||
return -1
|
||||
endi
|
||||
if $data43 != aaa then
|
||||
print =====data43=$data43
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data51 != 1 then
|
||||
print =====data51=$data51
|
||||
return -1
|
||||
endi
|
||||
if $data52 != 2.000000000 then
|
||||
print =====data52=$data52
|
||||
return -1
|
||||
endi
|
||||
if $data53 != aaa then
|
||||
print =====data53=$data53
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data61 != 2 then
|
||||
print =====data61=$data61
|
||||
return -1
|
||||
endi
|
||||
if $data62 != 4.000000000 then
|
||||
print =====data62=$data62
|
||||
return -1
|
||||
endi
|
||||
if $data63 != bbb then
|
||||
print =====data63=$data63
|
||||
return -1
|
||||
endi
|
||||
|
||||
#--------------
|
||||
|
||||
sleep 200
|
||||
sql select * from streamt8 order by ts;
|
||||
|
||||
|
||||
if $rows != 7 then
|
||||
print =====rows=$rows
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data01 != 3 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
print =====data02=$data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 4.000000000 then
|
||||
print =====data03=$data03
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data11 != 4 then
|
||||
print =====data11=$data11
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 1 then
|
||||
print =====data12=$data12
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 5.000000000 then
|
||||
print =====data13=$data13
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 4 then
|
||||
print =====data21=$data21
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 1 then
|
||||
print =====data22=$data22
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 5.000000000 then
|
||||
print =====data23=$data23
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 1 then
|
||||
print =====data31=$data31
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 1 then
|
||||
print =====data32=$data32
|
||||
return -1
|
||||
endi
|
||||
if $data33 != 2.000000000 then
|
||||
print =====data33=$data33
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data41 != 1 then
|
||||
print =====data41=$data41
|
||||
return -1
|
||||
endi
|
||||
if $data42 != 1 then
|
||||
print =====data42=$data42
|
||||
return -1
|
||||
endi
|
||||
if $data43 != 2.000000000 then
|
||||
print =====data43=$data43
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data51 != 2 then
|
||||
print =====data51=$data51
|
||||
return -1
|
||||
endi
|
||||
if $data52 != 1 then
|
||||
print =====data52=$data52
|
||||
return -1
|
||||
endi
|
||||
if $data53 != 3.000000000 then
|
||||
print =====data53=$data53
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data61 != 2 then
|
||||
print =====data61=$data61
|
||||
return -1
|
||||
endi
|
||||
if $data62 != 1 then
|
||||
print =====data62=$data62
|
||||
return -1
|
||||
endi
|
||||
if $data63 != 3.000000000 then
|
||||
print =====data63=$data63
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql insert into t1 values(1648791212000,5,5,5,5.0,'eee');
|
||||
sql insert into t1 values(1648791207000,6,6,6,6.0,'fff') (1648791209000,7,7,7,7.0,'ggg') (1648791219000,8,8,8,8.0,'hhh') (1648791221000,9,9,9,9.0,'iii');
|
||||
|
||||
|
||||
|
||||
$loop_count = 0
|
||||
|
||||
loop8:
|
||||
sleep 200
|
||||
sql select * from streamt7 order by ts;
|
||||
|
||||
$loop_count = $loop_count + 1
|
||||
if $loop_count == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $rows != 15 then
|
||||
print =====rows=$rows
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
if $data01 != 6 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 12.000000000 then
|
||||
print =====data02=$data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != fff then
|
||||
print =====data03=$data03
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data11 != 6 then
|
||||
print =====data11=$data11
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 12.000000000 then
|
||||
print =====data12=$data12
|
||||
return -1
|
||||
endi
|
||||
if $data13 != fff then
|
||||
print =====data13=$data13
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 7 then
|
||||
print =====data21=$data21
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 14.000000000 then
|
||||
print =====data22=$data22
|
||||
return -1
|
||||
endi
|
||||
if $data23 != ggg then
|
||||
print =====data23=$data23
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 7 then
|
||||
print =====data31=$data31
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 14.000000000 then
|
||||
print =====data32=$data32
|
||||
return -1
|
||||
endi
|
||||
if $data33 != ggg then
|
||||
print =====data33=$data33
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data51 != 5 then
|
||||
print =====data51=$data51
|
||||
return -1
|
||||
endi
|
||||
if $data52 != 10.000000000 then
|
||||
print =====data52=$data52
|
||||
return -1
|
||||
endi
|
||||
if $data53 != eee then
|
||||
print =====data53=$data53
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data[11][1] != 2 then
|
||||
print =====data[11][1]=$data[11][1]
|
||||
return -1
|
||||
endi
|
||||
if $data[11][2] != 4.000000000 then
|
||||
print =====data[11][2]=$data[11][2]
|
||||
return -1
|
||||
endi
|
||||
if $data[11][3] != bbb then
|
||||
print =====data[11][3]=$data[11][3]
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data[12][1] != 8 then
|
||||
print =====data[12][1]=$data[12][1]
|
||||
return -1
|
||||
endi
|
||||
if $data[12][2] != 16.000000000 then
|
||||
print =====data[12][2]=$data[12][2]
|
||||
return -1
|
||||
endi
|
||||
if $data[12][3] != hhh then
|
||||
print =====data[12][3]=$data[12][3]
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data[13][1] != 8 then
|
||||
print =====data[13][1]=$data[13][1]
|
||||
return -1
|
||||
endi
|
||||
if $data[13][2] != 16.000000000 then
|
||||
print =====data[13][2]=$data[13][2]
|
||||
return -1
|
||||
endi
|
||||
if $data[13][3] != hhh then
|
||||
print =====data[13][3]=$data[13][3]
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data[14][1] != 9 then
|
||||
print =====data[14][1]=$data[14][1]
|
||||
return -1
|
||||
endi
|
||||
if $data[14][2] != 18.000000000 then
|
||||
print =====data[14][2]=$data[14][2]
|
||||
return -1
|
||||
endi
|
||||
if $data[14][3] != iii then
|
||||
print =====data[14][3]=$data[14][3]
|
||||
return -1
|
||||
endi
|
||||
|
||||
print fill next-----------------890
|
||||
sql use test7;
|
||||
sql select * from streamt8 order by ts;
|
||||
|
||||
if $rows != 15 then
|
||||
print =====rows=$rows
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
if $data01 != 6 then
|
||||
print =====data01=$data01
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
print =====data02=$data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 7.000000000 then
|
||||
print =====data03=$data03
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data11 != 7 then
|
||||
print =====data11=$data11
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 8.000000000 then
|
||||
print =====data13=$data13
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 7 then
|
||||
print =====data21=$data21
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 8.000000000 then
|
||||
print =====data23=$data23
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 3 then
|
||||
print =====data31=$data31
|
||||
return -1
|
||||
endi
|
||||
if $data33 != 4.000000000 then
|
||||
print =====data33=$data33
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data51 != 5 then
|
||||
print =====data51=$data51
|
||||
return -1
|
||||
endi
|
||||
if $data53 != 6.000000000 then
|
||||
print =====data53=$data53
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $data[11][1] != 8 then
|
||||
print =====data[11][1]=$data[11][1]
|
||||
return -1
|
||||
endi
|
||||
if $data[11][2] != 1 then
|
||||
print =====data[11][2]=$data[11][2]
|
||||
return -1
|
||||
endi
|
||||
if $data[11][3] != 9.000000000 then
|
||||
print =====data[11][3]=$data[11][3]
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data[12][1] != 8 then
|
||||
print =====data[12][1]=$data[12][1]
|
||||
return -1
|
||||
endi
|
||||
if $data[12][3] != 9.000000000 then
|
||||
print =====data[12][3]=$data[12][3]
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data[13][1] != 9 then
|
||||
print =====data[13][1]=$data[13][1]
|
||||
return -1
|
||||
endi
|
||||
if $data[13][3] != 10.000000000 then
|
||||
print =====data[13][3]=$data[13][3]
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data[14][1] != 9 then
|
||||
print =====data[14][1]=$data[14][1]
|
||||
return -1
|
||||
endi
|
||||
if $data[14][3] != 10.000000000 then
|
||||
print =====data[14][3]=$data[14][3]
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#==system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -0,0 +1,559 @@
|
|||
$loop_all = 0
|
||||
looptest:
|
||||
|
||||
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 dnode1 -s start -v
|
||||
|
||||
sleep 200
|
||||
sql connect
|
||||
|
||||
|
||||
sql drop stream if exists streams7;
|
||||
sql drop stream if exists streams8;
|
||||
sql drop database if exists test7;
|
||||
sql create database test7 vgroups 1;
|
||||
sql use test7;
|
||||
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
|
||||
sql create stream streams7 trigger at_once into streamt7 as select _wstart as ts, max(a), b+c, s from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(prev);
|
||||
sql create stream streams8 trigger at_once into streamt8 as select _wstart as ts, max(a), 1, b+1 from t1 where ts >= 1648791150000 and ts < 1648791261000 interval(1s) fill(next);
|
||||
sql insert into t1 values(1648791215000,1,1,1,1.0,'aaa');
|
||||
sql insert into t1 values(1648791217000,2,2,2,2.0,'bbb');
|
||||
sql insert into t1 values(1648791211000,3,3,3,3.0,'ccc');
|
||||
sql insert into t1 values(1648791213000,4,4,4,4.0,'ddd');
|
||||
|
||||
|
||||
$loop_count = 0
|
||||
|
||||
loop7:
|
||||
sleep 300
|
||||
sql select * from streamt7 order by ts;
|
||||
|
||||
$loop_count = $loop_count + 1
|
||||
if $loop_count == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $rows != 7 then
|
||||
print =====rows=$rows
|
||||
goto loop7
|
||||
endi
|
||||
|
||||
|
||||
if $data01 != 3 then
|
||||
print =====data01=$data01
|
||||
goto loop7
|
||||
endi
|
||||
if $data02 != 6.000000000 then
|
||||
print =====data02=$data02
|
||||
goto loop7
|
||||
endi
|
||||
if $data03 != ccc then
|
||||
print =====data03=$data03
|
||||
goto loop7
|
||||
endi
|
||||
|
||||
if $data11 != 3 then
|
||||
print =====data11=$data11
|
||||
goto loop7
|
||||
endi
|
||||
if $data12 != 6.000000000 then
|
||||
print =====data12=$data12
|
||||
goto loop7
|
||||
endi
|
||||
if $data13 != ccc then
|
||||
print =====data13=$data13
|
||||
goto loop7
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 4 then
|
||||
print =====data21=$data21
|
||||
goto loop7
|
||||
endi
|
||||
if $data22 != 8.000000000 then
|
||||
print =====data22=$data22
|
||||
goto loop7
|
||||
endi
|
||||
if $data23 != ddd then
|
||||
print =====data23=$data23
|
||||
goto loop7
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 4 then
|
||||
print =====data31=$data31
|
||||
goto loop7
|
||||
endi
|
||||
if $data32 != 8.000000000 then
|
||||
print =====data32=$data32
|
||||
goto loop7
|
||||
endi
|
||||
if $data33 != ddd then
|
||||
print =====data33=$data33
|
||||
goto loop7
|
||||
endi
|
||||
|
||||
|
||||
if $data41 != 1 then
|
||||
print =====data41=$data41
|
||||
goto loop7
|
||||
endi
|
||||
if $data42 != 2.000000000 then
|
||||
print =====data42=$data42
|
||||
goto loop7
|
||||
endi
|
||||
if $data43 != aaa then
|
||||
print =====data43=$data43
|
||||
goto loop7
|
||||
endi
|
||||
|
||||
|
||||
if $data51 != 1 then
|
||||
print =====data51=$data51
|
||||
goto loop7
|
||||
endi
|
||||
if $data52 != 2.000000000 then
|
||||
print =====data52=$data52
|
||||
goto loop7
|
||||
endi
|
||||
if $data53 != aaa then
|
||||
print =====data53=$data53
|
||||
goto loop7
|
||||
endi
|
||||
|
||||
|
||||
if $data61 != 2 then
|
||||
print =====data61=$data61
|
||||
goto loop7
|
||||
endi
|
||||
if $data62 != 4.000000000 then
|
||||
print =====data62=$data62
|
||||
goto loop7
|
||||
endi
|
||||
if $data63 != bbb then
|
||||
print =====data63=$data63
|
||||
goto loop7
|
||||
endi
|
||||
|
||||
#--------------
|
||||
|
||||
loop71:
|
||||
|
||||
$loop_count = 0
|
||||
sleep 300
|
||||
|
||||
sql select * from streamt8 order by ts;
|
||||
|
||||
$loop_count = $loop_count + 1
|
||||
if $loop_count == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $rows != 7 then
|
||||
print =====rows=$rows
|
||||
goto loop71
|
||||
endi
|
||||
|
||||
|
||||
if $data01 != 3 then
|
||||
print =====data01=$data01
|
||||
goto loop71
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
print =====data02=$data02
|
||||
goto loop71
|
||||
endi
|
||||
if $data03 != 4.000000000 then
|
||||
print =====data03=$data03
|
||||
goto loop71
|
||||
endi
|
||||
|
||||
if $data11 != 4 then
|
||||
print =====data11=$data11
|
||||
goto loop71
|
||||
endi
|
||||
if $data12 != 1 then
|
||||
print =====data12=$data12
|
||||
goto loop71
|
||||
endi
|
||||
if $data13 != 5.000000000 then
|
||||
print =====data13=$data13
|
||||
goto loop71
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 4 then
|
||||
print =====data21=$data21
|
||||
goto loop71
|
||||
endi
|
||||
if $data22 != 1 then
|
||||
print =====data22=$data22
|
||||
goto loop71
|
||||
endi
|
||||
if $data23 != 5.000000000 then
|
||||
print =====data23=$data23
|
||||
goto loop71
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 1 then
|
||||
print =====data31=$data31
|
||||
goto loop71
|
||||
endi
|
||||
if $data32 != 1 then
|
||||
print =====data32=$data32
|
||||
goto loop71
|
||||
endi
|
||||
if $data33 != 2.000000000 then
|
||||
print =====data33=$data33
|
||||
goto loop71
|
||||
endi
|
||||
|
||||
|
||||
if $data41 != 1 then
|
||||
print =====data41=$data41
|
||||
goto loop71
|
||||
endi
|
||||
if $data42 != 1 then
|
||||
print =====data42=$data42
|
||||
goto loop71
|
||||
endi
|
||||
if $data43 != 2.000000000 then
|
||||
print =====data43=$data43
|
||||
goto loop71
|
||||
endi
|
||||
|
||||
|
||||
if $data51 != 2 then
|
||||
print =====data51=$data51
|
||||
goto loop71
|
||||
endi
|
||||
if $data52 != 1 then
|
||||
print =====data52=$data52
|
||||
goto loop71
|
||||
endi
|
||||
if $data53 != 3.000000000 then
|
||||
print =====data53=$data53
|
||||
goto loop71
|
||||
endi
|
||||
|
||||
|
||||
if $data61 != 2 then
|
||||
print =====data61=$data61
|
||||
goto loop71
|
||||
endi
|
||||
if $data62 != 1 then
|
||||
print =====data62=$data62
|
||||
goto loop71
|
||||
endi
|
||||
if $data63 != 3.000000000 then
|
||||
print =====data63=$data63
|
||||
goto loop71
|
||||
endi
|
||||
|
||||
sql insert into t1 values(1648791212000,5,5,5,5.0,'eee');
|
||||
sql insert into t1 values(1648791207000,6,6,6,6.0,'fff') (1648791209000,7,7,7,7.0,'ggg') (1648791219000,8,8,8,8.0,'hhh') (1648791221000,9,9,9,9.0,'iii');
|
||||
|
||||
|
||||
|
||||
$loop_count = 0
|
||||
|
||||
loop8:
|
||||
sleep 200
|
||||
sql select * from streamt7 order by ts;
|
||||
|
||||
$loop_count = $loop_count + 1
|
||||
if $loop_count == 10 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
if $rows != 15 then
|
||||
print =====rows=$rows
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
if $data01 != 6 then
|
||||
print =====data01=$data01
|
||||
goto loop8
|
||||
endi
|
||||
if $data02 != 12.000000000 then
|
||||
print =====data02=$data02
|
||||
goto loop8
|
||||
endi
|
||||
if $data03 != fff then
|
||||
print =====data03=$data03
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
if $data11 != 6 then
|
||||
print =====data11=$data11
|
||||
goto loop8
|
||||
endi
|
||||
if $data12 != 12.000000000 then
|
||||
print =====data12=$data12
|
||||
goto loop8
|
||||
endi
|
||||
if $data13 != fff then
|
||||
print =====data13=$data13
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 7 then
|
||||
print =====data21=$data21
|
||||
goto loop8
|
||||
endi
|
||||
if $data22 != 14.000000000 then
|
||||
print =====data22=$data22
|
||||
goto loop8
|
||||
endi
|
||||
if $data23 != ggg then
|
||||
print =====data23=$data23
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 7 then
|
||||
print =====data31=$data31
|
||||
goto loop8
|
||||
endi
|
||||
if $data32 != 14.000000000 then
|
||||
print =====data32=$data32
|
||||
goto loop8
|
||||
endi
|
||||
if $data33 != ggg then
|
||||
print =====data33=$data33
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
if $data51 != 5 then
|
||||
print =====data51=$data51
|
||||
goto loop8
|
||||
endi
|
||||
if $data52 != 10.000000000 then
|
||||
print =====data52=$data52
|
||||
goto loop8
|
||||
endi
|
||||
if $data53 != eee then
|
||||
print =====data53=$data53
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
if $data[11][1] != 2 then
|
||||
print =====data[11][1]=$data[11][1]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[11][2] != 4.000000000 then
|
||||
print =====data[11][2]=$data[11][2]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[11][3] != bbb then
|
||||
print =====data[11][3]=$data[11][3]
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
if $data[12][1] != 8 then
|
||||
print =====data[12][1]=$data[12][1]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[12][2] != 16.000000000 then
|
||||
print =====data[12][2]=$data[12][2]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[12][3] != hhh then
|
||||
print =====data[12][3]=$data[12][3]
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
if $data[13][1] != 8 then
|
||||
print =====data[13][1]=$data[13][1]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[13][2] != 16.000000000 then
|
||||
print =====data[13][2]=$data[13][2]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[13][3] != hhh then
|
||||
print =====data[13][3]=$data[13][3]
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
if $data[14][1] != 9 then
|
||||
print =====data[14][1]=$data[14][1]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[14][2] != 18.000000000 then
|
||||
print =====data[14][2]=$data[14][2]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[14][3] != iii then
|
||||
print =====data[14][3]=$data[14][3]
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
print fill next-----------------890
|
||||
sql use test7;
|
||||
sql select * from streamt8 order by ts;
|
||||
|
||||
if $rows != 15 then
|
||||
print =====rows=$rows
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
if $data01 != 6 then
|
||||
print =====data01=$data01
|
||||
goto loop8
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
print =====data02=$data02
|
||||
goto loop8
|
||||
endi
|
||||
if $data03 != 7.000000000 then
|
||||
print =====data03=$data03
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
if $data11 != 7 then
|
||||
print =====data11=$data11
|
||||
goto loop8
|
||||
endi
|
||||
if $data13 != 8.000000000 then
|
||||
print =====data13=$data13
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
if $data21 != 7 then
|
||||
print =====data21=$data21
|
||||
goto loop8
|
||||
endi
|
||||
if $data23 != 8.000000000 then
|
||||
print =====data23=$data23
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
if $data31 != 3 then
|
||||
print =====data31=$data31
|
||||
goto loop8
|
||||
endi
|
||||
if $data33 != 4.000000000 then
|
||||
print =====data33=$data33
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
if $data51 != 5 then
|
||||
print =====data51=$data51
|
||||
goto loop8
|
||||
endi
|
||||
if $data53 != 6.000000000 then
|
||||
print =====data53=$data53
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
if $data[11][1] != 8 then
|
||||
print =====data[11][1]=$data[11][1]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[11][2] != 1 then
|
||||
print =====data[11][2]=$data[11][2]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[11][3] != 9.000000000 then
|
||||
print =====data[11][3]=$data[11][3]
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
if $data[12][1] != 8 then
|
||||
print =====data[12][1]=$data[12][1]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[12][3] != 9.000000000 then
|
||||
print =====data[12][3]=$data[12][3]
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
if $data[13][1] != 9 then
|
||||
print =====data[13][1]=$data[13][1]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[13][3] != 10.000000000 then
|
||||
print =====data[13][3]=$data[13][3]
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
if $data[14][1] != 9 then
|
||||
print =====data[14][1]=$data[14][1]
|
||||
goto loop8
|
||||
endi
|
||||
if $data[14][3] != 10.000000000 then
|
||||
print =====data[14][3]=$data[14][3]
|
||||
goto loop8
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#==system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
#==print =============== check
|
||||
#==$null=
|
||||
|
||||
#==system_content sh/checkValgrind.sh -n dnode1
|
||||
#==print cmd return result ----> [ $system_content ]
|
||||
#==if $system_content > 0 then
|
||||
#== return -1
|
||||
#==endi
|
||||
|
||||
#==if $system_content == $null then
|
||||
#== return -1
|
||||
#==endi
|
||||
#==return 1
|
||||
|
||||
|
||||
|
||||
sql drop stream if exists streams0;
|
||||
sql drop stream if exists streams1;
|
||||
sql drop stream if exists streams2;
|
||||
sql drop stream if exists streams3;
|
||||
sql drop stream if exists streams4;
|
||||
sql drop stream if exists streams5;
|
||||
sql drop stream if exists streams6;
|
||||
sql drop stream if exists streams7;
|
||||
sql drop stream if exists streams8;
|
||||
|
||||
sql use test7;
|
||||
sql select * from t1;
|
||||
print $data00
|
||||
|
||||
$loop_all = $loop_all + 1
|
||||
print ============loop_all=$loop_all
|
||||
|
||||
system sh/stop_dnodes.sh
|
||||
|
||||
#goto looptest
|
Loading…
Reference in New Issue