Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
918df89b
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
918df89b
编写于
7月 14, 2022
作者:
H
Haojun Liao
提交者:
GitHub
7月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' into feature/3_liaohj
上级
dc4052bd
a497ad72
变更
105
显示空白变更内容
内联
并排
Showing
105 changed file
with
648 addition
and
786 deletion
+648
-786
cmake/cmake.options
cmake/cmake.options
+0
-6
include/libs/nodes/plannodes.h
include/libs/nodes/plannodes.h
+6
-1
source/dnode/mnode/sdb/inc/sdb.h
source/dnode/mnode/sdb/inc/sdb.h
+0
-1
source/libs/command/src/explain.c
source/libs/command/src/explain.c
+10
-10
source/libs/executor/src/cachescanoperator.c
source/libs/executor/src/cachescanoperator.c
+4
-4
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+4
-4
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+22
-28
source/libs/nodes/src/nodesCodeFuncs.c
source/libs/nodes/src/nodesCodeFuncs.c
+34
-4
source/libs/parser/src/parInsert.c
source/libs/parser/src/parInsert.c
+7
-0
source/libs/planner/src/planPhysiCreater.c
source/libs/planner/src/planPhysiCreater.c
+20
-3
source/libs/planner/src/planSpliter.c
source/libs/planner/src/planSpliter.c
+3
-0
source/libs/planner/test/planBasicTest.cpp
source/libs/planner/test/planBasicTest.cpp
+2
-0
source/libs/planner/test/planSubqueryTest.cpp
source/libs/planner/test/planSubqueryTest.cpp
+2
-0
source/libs/scalar/src/sclvector.c
source/libs/scalar/src/sclvector.c
+2
-1
tests/script/general/insert/testSuite.sim
tests/script/general/insert/testSuite.sim
+0
-9
tests/script/general/table/testSuite.sim
tests/script/general/table/testSuite.sim
+0
-27
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+50
-15
tests/script/tsim/cache/new_metrics.sim
tests/script/tsim/cache/new_metrics.sim
+0
-4
tests/script/tsim/cache/restart_metrics.sim
tests/script/tsim/cache/restart_metrics.sim
+0
-2
tests/script/tsim/cache/restart_table.sim
tests/script/tsim/cache/restart_table.sim
+0
-2
tests/script/tsim/compress/commitlog.sim
tests/script/tsim/compress/commitlog.sim
+1
-9
tests/script/tsim/compute/avg.sim
tests/script/tsim/compute/avg.sim
+9
-11
tests/script/tsim/compute/block_dist.sim
tests/script/tsim/compute/block_dist.sim
+0
-2
tests/script/tsim/compute/bottom.sim
tests/script/tsim/compute/bottom.sim
+12
-14
tests/script/tsim/compute/count.sim
tests/script/tsim/compute/count.sim
+13
-16
tests/script/tsim/compute/diff.sim
tests/script/tsim/compute/diff.sim
+8
-10
tests/script/tsim/compute/diff2.sim
tests/script/tsim/compute/diff2.sim
+35
-35
tests/script/tsim/compute/first.sim
tests/script/tsim/compute/first.sim
+13
-15
tests/script/tsim/compute/interval.sim
tests/script/tsim/compute/interval.sim
+16
-16
tests/script/tsim/compute/last.sim
tests/script/tsim/compute/last.sim
+13
-15
tests/script/tsim/compute/last_row.sim
tests/script/tsim/compute/last_row.sim
+1
-4
tests/script/tsim/compute/leastsquare.sim
tests/script/tsim/compute/leastsquare.sim
+6
-8
tests/script/tsim/compute/max.sim
tests/script/tsim/compute/max.sim
+13
-15
tests/script/tsim/compute/min.sim
tests/script/tsim/compute/min.sim
+0
-2
tests/script/tsim/compute/null.sim
tests/script/tsim/compute/null.sim
+4
-3
tests/script/tsim/compute/percentile.sim
tests/script/tsim/compute/percentile.sim
+0
-2
tests/script/tsim/compute/stddev.sim
tests/script/tsim/compute/stddev.sim
+0
-2
tests/script/tsim/compute/sum.sim
tests/script/tsim/compute/sum.sim
+0
-2
tests/script/tsim/compute/top.sim
tests/script/tsim/compute/top.sim
+0
-2
tests/script/tsim/insert/backquote.sim
tests/script/tsim/insert/backquote.sim
+1
-18
tests/script/tsim/insert/basic.sim
tests/script/tsim/insert/basic.sim
+0
-4
tests/script/tsim/insert/basic0.sim
tests/script/tsim/insert/basic0.sim
+0
-17
tests/script/tsim/insert/basic1.sim
tests/script/tsim/insert/basic1.sim
+1
-0
tests/script/tsim/insert/commit-merge0.sim
tests/script/tsim/insert/commit-merge0.sim
+0
-18
tests/script/tsim/insert/insert_drop.sim
tests/script/tsim/insert/insert_drop.sim
+1
-13
tests/script/tsim/insert/null.sim
tests/script/tsim/insert/null.sim
+72
-92
tests/script/tsim/insert/query_block1_file.sim
tests/script/tsim/insert/query_block1_file.sim
+1
-6
tests/script/tsim/insert/query_block1_memory.sim
tests/script/tsim/insert/query_block1_memory.sim
+1
-6
tests/script/tsim/insert/query_block2_file.sim
tests/script/tsim/insert/query_block2_file.sim
+2
-15
tests/script/tsim/insert/query_block2_memory.sim
tests/script/tsim/insert/query_block2_memory.sim
+1
-6
tests/script/tsim/insert/query_file_memory.sim
tests/script/tsim/insert/query_file_memory.sim
+2
-14
tests/script/tsim/insert/query_multi_file.sim
tests/script/tsim/insert/query_multi_file.sim
+2
-14
tests/script/tsim/insert/tcp.sim
tests/script/tsim/insert/tcp.sim
+1
-4
tests/script/tsim/stream/sliding.sim
tests/script/tsim/stream/sliding.sim
+126
-0
tests/script/tsim/table/autocreate.sim
tests/script/tsim/table/autocreate.sim
+1
-2
tests/script/tsim/table/back_insert.sim
tests/script/tsim/table/back_insert.sim
+0
-0
tests/script/tsim/table/basic1.sim
tests/script/tsim/table/basic1.sim
+0
-17
tests/script/tsim/table/basic2.sim
tests/script/tsim/table/basic2.sim
+3
-4
tests/script/tsim/table/basic3.sim
tests/script/tsim/table/basic3.sim
+1
-2
tests/script/tsim/table/bigint.sim
tests/script/tsim/table/bigint.sim
+1
-4
tests/script/tsim/table/binary.sim
tests/script/tsim/table/binary.sim
+1
-4
tests/script/tsim/table/bool.sim
tests/script/tsim/table/bool.sim
+1
-4
tests/script/tsim/table/column2.sim
tests/script/tsim/table/column2.sim
+1
-4
tests/script/tsim/table/column_name.sim
tests/script/tsim/table/column_name.sim
+1
-4
tests/script/tsim/table/column_num.sim
tests/script/tsim/table/column_num.sim
+1
-4
tests/script/tsim/table/column_value.sim
tests/script/tsim/table/column_value.sim
+1
-4
tests/script/tsim/table/createmulti.sim
tests/script/tsim/table/createmulti.sim
+1
-2
tests/script/tsim/table/date.sim
tests/script/tsim/table/date.sim
+9
-12
tests/script/tsim/table/db.table.sim
tests/script/tsim/table/db.table.sim
+1
-4
tests/script/tsim/table/delete_reuse1.sim
tests/script/tsim/table/delete_reuse1.sim
+0
-0
tests/script/tsim/table/delete_reuse2.sim
tests/script/tsim/table/delete_reuse2.sim
+0
-0
tests/script/tsim/table/delete_writing.sim
tests/script/tsim/table/delete_writing.sim
+0
-0
tests/script/tsim/table/describe.sim
tests/script/tsim/table/describe.sim
+1
-4
tests/script/tsim/table/double.sim
tests/script/tsim/table/double.sim
+1
-4
tests/script/tsim/table/float.sim
tests/script/tsim/table/float.sim
+1
-4
tests/script/tsim/table/int.sim
tests/script/tsim/table/int.sim
+24
-31
tests/script/tsim/table/limit.sim
tests/script/tsim/table/limit.sim
+3
-8
tests/script/tsim/table/smallint.sim
tests/script/tsim/table/smallint.sim
+19
-24
tests/script/tsim/table/table.sim
tests/script/tsim/table/table.sim
+3
-7
tests/script/tsim/table/table_len.sim
tests/script/tsim/table/table_len.sim
+1
-4
tests/script/tsim/table/tinyint.sim
tests/script/tsim/table/tinyint.sim
+18
-23
tests/script/tsim/table/vgroup.sim
tests/script/tsim/table/vgroup.sim
+14
-18
tests/script/tsim/tag/bigint.sim
tests/script/tsim/tag/bigint.sim
+0
-1
tests/script/tsim/tag/binary.sim
tests/script/tsim/tag/binary.sim
+0
-1
tests/script/tsim/tag/bool.sim
tests/script/tsim/tag/bool.sim
+0
-1
tests/script/tsim/tag/double.sim
tests/script/tsim/tag/double.sim
+0
-1
tests/script/tsim/tag/float.sim
tests/script/tsim/tag/float.sim
+0
-1
tests/script/tsim/tag/int.sim
tests/script/tsim/tag/int.sim
+0
-1
tests/script/tsim/tag/smallint.sim
tests/script/tsim/tag/smallint.sim
+0
-1
tests/script/tsim/tag/tinyint.sim
tests/script/tsim/tag/tinyint.sim
+0
-1
tests/script/tsim/vector/metrics_field.sim
tests/script/tsim/vector/metrics_field.sim
+0
-2
tests/script/tsim/vector/metrics_mix.sim
tests/script/tsim/vector/metrics_mix.sim
+0
-2
tests/script/tsim/vector/metrics_query.sim
tests/script/tsim/vector/metrics_query.sim
+0
-2
tests/script/tsim/vector/metrics_tag.sim
tests/script/tsim/vector/metrics_tag.sim
+0
-2
tests/script/tsim/vector/metrics_time.sim
tests/script/tsim/vector/metrics_time.sim
+0
-2
tests/script/tsim/vector/multi.sim
tests/script/tsim/vector/multi.sim
+0
-2
tests/script/tsim/vector/single.sim
tests/script/tsim/vector/single.sim
+0
-2
tests/script/tsim/vector/table_field.sim
tests/script/tsim/vector/table_field.sim
+0
-2
tests/script/tsim/vector/table_mix.sim
tests/script/tsim/vector/table_mix.sim
+0
-2
tests/script/tsim/vector/table_query.sim
tests/script/tsim/vector/table_query.sim
+0
-2
tests/script/tsim/vector/table_time.sim
tests/script/tsim/vector/table_time.sim
+0
-2
tests/system-test/2-query/json_tag.py
tests/system-test/2-query/json_tag.py
+8
-17
tests/system-test/7-tmq/dataFromTsdbNWal.py
tests/system-test/7-tmq/dataFromTsdbNWal.py
+9
-10
tests/system-test/7-tmq/tmqCommon.py
tests/system-test/7-tmq/tmqCommon.py
+1
-0
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+1
-0
未找到文件。
cmake/cmake.options
浏览文件 @
918df89b
...
@@ -83,12 +83,6 @@ option(
...
@@ -83,12 +83,6 @@ option(
OFF
OFF
)
)
option(
TDENGINE_3
"TDengine 3.x"
ON
)
option(
option(
BUILD_ADDR2LINE
BUILD_ADDR2LINE
"If build addr2line"
"If build addr2line"
...
...
include/libs/nodes/plannodes.h
浏览文件 @
918df89b
...
@@ -275,7 +275,12 @@ typedef struct SScanPhysiNode {
...
@@ -275,7 +275,12 @@ typedef struct SScanPhysiNode {
typedef
SScanPhysiNode
STagScanPhysiNode
;
typedef
SScanPhysiNode
STagScanPhysiNode
;
typedef
SScanPhysiNode
SBlockDistScanPhysiNode
;
typedef
SScanPhysiNode
SBlockDistScanPhysiNode
;
typedef
SScanPhysiNode
SLastRowScanPhysiNode
;
typedef
struct
SLastRowScanPhysiNode
{
SScanPhysiNode
scan
;
SNodeList
*
pGroupTags
;
bool
groupSort
;
}
SLastRowScanPhysiNode
;
typedef
struct
SSystemTableScanPhysiNode
{
typedef
struct
SSystemTableScanPhysiNode
{
SScanPhysiNode
scan
;
SScanPhysiNode
scan
;
...
...
source/dnode/mnode/sdb/inc/sdb.h
浏览文件 @
918df89b
...
@@ -163,7 +163,6 @@ typedef struct SSdbRow {
...
@@ -163,7 +163,6 @@ typedef struct SSdbRow {
ESdbType
type
;
ESdbType
type
;
ESdbStatus
status
;
ESdbStatus
status
;
int32_t
refCount
;
int32_t
refCount
;
int64_t
forAlign
;
char
pObj
[];
char
pObj
[];
}
SSdbRow
;
}
SSdbRow
;
...
...
source/libs/command/src/explain.c
浏览文件 @
918df89b
...
@@ -206,7 +206,7 @@ int32_t qExplainGenerateResChildren(SPhysiNode *pNode, SExplainGroup *group, SNo
...
@@ -206,7 +206,7 @@ int32_t qExplainGenerateResChildren(SPhysiNode *pNode, SExplainGroup *group, SNo
}
}
case
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
:
{
case
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
:
{
SLastRowScanPhysiNode
*
lastRowPhysiNode
=
(
SLastRowScanPhysiNode
*
)
pNode
;
SLastRowScanPhysiNode
*
lastRowPhysiNode
=
(
SLastRowScanPhysiNode
*
)
pNode
;
pPhysiChildren
=
lastRowPhysiNode
->
node
.
pChildren
;
pPhysiChildren
=
lastRowPhysiNode
->
scan
.
node
.
pChildren
;
break
;
break
;
}
}
case
QUERY_NODE_PHYSICAL_PLAN_GROUP_SORT
:
{
case
QUERY_NODE_PHYSICAL_PLAN_GROUP_SORT
:
{
...
@@ -1209,19 +1209,19 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
...
@@ -1209,19 +1209,19 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
}
}
case
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
:
{
case
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
:
{
SLastRowScanPhysiNode
*
pLastRowNode
=
(
SLastRowScanPhysiNode
*
)
pNode
;
SLastRowScanPhysiNode
*
pLastRowNode
=
(
SLastRowScanPhysiNode
*
)
pNode
;
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_LASTROW_SCAN_FORMAT
,
pLastRowNode
->
tableName
.
tname
);
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_LASTROW_SCAN_FORMAT
,
pLastRowNode
->
scan
.
tableName
.
tname
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_LEFT_PARENTHESIS_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_LEFT_PARENTHESIS_FORMAT
);
if
(
pResNode
->
pExecInfo
)
{
if
(
pResNode
->
pExecInfo
)
{
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
}
}
EXPLAIN_ROW_APPEND
(
EXPLAIN_COLUMNS_FORMAT
,
pLastRowNode
->
pScanCols
->
length
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_COLUMNS_FORMAT
,
pLastRowNode
->
scan
.
pScanCols
->
length
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
if
(
pLastRowNode
->
pScanPseudoCols
)
{
if
(
pLastRowNode
->
scan
.
pScanPseudoCols
)
{
EXPLAIN_ROW_APPEND
(
EXPLAIN_PSEUDO_COLUMNS_FORMAT
,
pLastRowNode
->
pScanPseudoCols
->
length
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_PSEUDO_COLUMNS_FORMAT
,
pLastRowNode
->
scan
.
pScanPseudoCols
->
length
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
}
}
EXPLAIN_ROW_APPEND
(
EXPLAIN_WIDTH_FORMAT
,
pLastRowNode
->
node
.
pOutputDataBlockDesc
->
totalRowSize
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_WIDTH_FORMAT
,
pLastRowNode
->
scan
.
node
.
pOutputDataBlockDesc
->
totalRowSize
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_RIGHT_PARENTHESIS_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_RIGHT_PARENTHESIS_FORMAT
);
EXPLAIN_ROW_END
();
EXPLAIN_ROW_END
();
...
@@ -1230,15 +1230,15 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
...
@@ -1230,15 +1230,15 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
if
(
verbose
)
{
if
(
verbose
)
{
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_OUTPUT_FORMAT
);
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_OUTPUT_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_COLUMNS_FORMAT
,
EXPLAIN_ROW_APPEND
(
EXPLAIN_COLUMNS_FORMAT
,
nodesGetOutputNumFromSlotList
(
pLastRowNode
->
node
.
pOutputDataBlockDesc
->
pSlots
));
nodesGetOutputNumFromSlotList
(
pLastRowNode
->
scan
.
node
.
pOutputDataBlockDesc
->
pSlots
));
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_WIDTH_FORMAT
,
pLastRowNode
->
node
.
pOutputDataBlockDesc
->
outputRowSize
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_WIDTH_FORMAT
,
pLastRowNode
->
scan
.
node
.
pOutputDataBlockDesc
->
outputRowSize
);
EXPLAIN_ROW_END
();
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
if
(
pLastRowNode
->
node
.
pConditions
)
{
if
(
pLastRowNode
->
scan
.
node
.
pConditions
)
{
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_FILTER_FORMAT
);
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_FILTER_FORMAT
);
QRY_ERR_RET
(
nodesNodeToSQL
(
pLastRowNode
->
node
.
pConditions
,
tbuf
+
VARSTR_HEADER_SIZE
,
QRY_ERR_RET
(
nodesNodeToSQL
(
pLastRowNode
->
scan
.
node
.
pConditions
,
tbuf
+
VARSTR_HEADER_SIZE
,
TSDB_EXPLAIN_RESULT_ROW_SIZE
,
&
tlen
));
TSDB_EXPLAIN_RESULT_ROW_SIZE
,
&
tlen
));
EXPLAIN_ROW_END
();
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
...
...
source/libs/executor/src/cachescanoperator.c
浏览文件 @
918df89b
...
@@ -40,10 +40,10 @@ SOperatorInfo* createLastrowScanOperator(SLastRowScanPhysiNode* pScanNode, SRead
...
@@ -40,10 +40,10 @@ SOperatorInfo* createLastrowScanOperator(SLastRowScanPhysiNode* pScanNode, SRead
pInfo
->
pTableList
=
pTableList
;
pInfo
->
pTableList
=
pTableList
;
pInfo
->
readHandle
=
*
readHandle
;
pInfo
->
readHandle
=
*
readHandle
;
pInfo
->
pRes
=
createResDataBlock
(
pScanNode
->
node
.
pOutputDataBlockDesc
);
pInfo
->
pRes
=
createResDataBlock
(
pScanNode
->
scan
.
node
.
pOutputDataBlockDesc
);
int32_t
numOfCols
=
0
;
int32_t
numOfCols
=
0
;
pInfo
->
pColMatchInfo
=
extractColMatchInfo
(
pScanNode
->
pScanCols
,
pScanNode
->
node
.
pOutputDataBlockDesc
,
&
numOfCols
,
pInfo
->
pColMatchInfo
=
extractColMatchInfo
(
pScanNode
->
scan
.
pScanCols
,
pScanNode
->
scan
.
node
.
pOutputDataBlockDesc
,
&
numOfCols
,
COL_MATCH_FROM_COL_ID
);
COL_MATCH_FROM_COL_ID
);
int32_t
code
=
extractTargetSlotId
(
pInfo
->
pColMatchInfo
,
pTaskInfo
,
&
pInfo
->
pSlotIds
);
int32_t
code
=
extractTargetSlotId
(
pInfo
->
pColMatchInfo
,
pTaskInfo
,
&
pInfo
->
pSlotIds
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
@@ -53,10 +53,10 @@ SOperatorInfo* createLastrowScanOperator(SLastRowScanPhysiNode* pScanNode, SRead
...
@@ -53,10 +53,10 @@ SOperatorInfo* createLastrowScanOperator(SLastRowScanPhysiNode* pScanNode, SRead
tsdbLastRowReaderOpen
(
readHandle
->
vnode
,
LASTROW_RETRIEVE_TYPE_SINGLE
,
pTableList
,
taosArrayGetSize
(
pInfo
->
pColMatchInfo
),
tsdbLastRowReaderOpen
(
readHandle
->
vnode
,
LASTROW_RETRIEVE_TYPE_SINGLE
,
pTableList
,
taosArrayGetSize
(
pInfo
->
pColMatchInfo
),
&
pInfo
->
pLastrowReader
);
&
pInfo
->
pLastrowReader
);
if
(
pScanNode
->
pScanPseudoCols
!=
NULL
)
{
if
(
pScanNode
->
scan
.
pScanPseudoCols
!=
NULL
)
{
SExprSupp
*
pPseudoExpr
=
&
pInfo
->
pseudoExprSup
;
SExprSupp
*
pPseudoExpr
=
&
pInfo
->
pseudoExprSup
;
pPseudoExpr
->
pExprInfo
=
createExprInfo
(
pScanNode
->
pScanPseudoCols
,
NULL
,
&
pPseudoExpr
->
numOfExprs
);
pPseudoExpr
->
pExprInfo
=
createExprInfo
(
pScanNode
->
scan
.
pScanPseudoCols
,
NULL
,
&
pPseudoExpr
->
numOfExprs
);
pPseudoExpr
->
pCtx
=
createSqlFunctionCtx
(
pPseudoExpr
->
pExprInfo
,
pPseudoExpr
->
numOfExprs
,
&
pPseudoExpr
->
rowEntryInfoOffset
);
pPseudoExpr
->
pCtx
=
createSqlFunctionCtx
(
pPseudoExpr
->
pExprInfo
,
pPseudoExpr
->
numOfExprs
,
&
pPseudoExpr
->
rowEntryInfoOffset
);
}
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
918df89b
...
@@ -4438,21 +4438,21 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -4438,21 +4438,21 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
// return NULL;
// return NULL;
// }
// }
int32_t
code
=
extractTableSchemaInfo
(
pHandle
,
pScanNode
->
uid
,
pTaskInfo
);
int32_t
code
=
extractTableSchemaInfo
(
pHandle
,
pScanNode
->
scan
.
uid
,
pTaskInfo
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pTaskInfo
->
code
=
code
;
pTaskInfo
->
code
=
code
;
return
NULL
;
return
NULL
;
}
}
pTableListInfo
->
pTableList
=
taosArrayInit
(
4
,
sizeof
(
STableKeyInfo
));
pTableListInfo
->
pTableList
=
taosArrayInit
(
4
,
sizeof
(
STableKeyInfo
));
if
(
pScanNode
->
tableType
==
TSDB_SUPER_TABLE
)
{
if
(
pScanNode
->
scan
.
tableType
==
TSDB_SUPER_TABLE
)
{
code
=
vnodeGetAllTableList
(
pHandle
->
vnode
,
pScanNode
->
uid
,
pTableListInfo
->
pTableList
);
code
=
vnodeGetAllTableList
(
pHandle
->
vnode
,
pScanNode
->
scan
.
uid
,
pTableListInfo
->
pTableList
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pTaskInfo
->
code
=
terrno
;
pTaskInfo
->
code
=
terrno
;
return
NULL
;
return
NULL
;
}
}
}
else
{
// Create one table group.
}
else
{
// Create one table group.
STableKeyInfo
info
=
{.
lastKey
=
0
,
.
uid
=
pScanNode
->
uid
,
.
groupId
=
0
};
STableKeyInfo
info
=
{.
lastKey
=
0
,
.
uid
=
pScanNode
->
scan
.
uid
,
.
groupId
=
0
};
taosArrayPush
(
pTableListInfo
->
pTableList
,
&
info
);
taosArrayPush
(
pTableListInfo
->
pTableList
,
&
info
);
}
}
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
918df89b
...
@@ -402,7 +402,6 @@ typedef struct SGroupKeyInfo {
...
@@ -402,7 +402,6 @@ typedef struct SGroupKeyInfo {
(x) += step; \
(x) += step; \
} while (0)
} while (0)
#define STATE_COMP(_op, _lval, _param) STATE_COMP_IMPL(_op, _lval, GET_STATE_VAL(_param))
#define STATE_COMP(_op, _lval, _param) STATE_COMP_IMPL(_op, _lval, GET_STATE_VAL(_param))
#define GET_STATE_VAL(param) ((param.nType == TSDB_DATA_TYPE_BIGINT) ? (param.i) : (param.d))
#define GET_STATE_VAL(param) ((param.nType == TSDB_DATA_TYPE_BIGINT) ? (param.i) : (param.d))
...
@@ -986,7 +985,7 @@ int32_t avgFunctionMerge(SqlFunctionCtx* pCtx) {
...
@@ -986,7 +985,7 @@ int32_t avgFunctionMerge(SqlFunctionCtx* pCtx) {
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
start
=
pInput
->
startRowIndex
;
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
char
*
data
=
colDataGetData
(
pCol
,
i
);
char
*
data
=
colDataGetData
(
pCol
,
i
);
SAvgRes
*
pInputInfo
=
(
SAvgRes
*
)
varDataVal
(
data
);
SAvgRes
*
pInputInfo
=
(
SAvgRes
*
)
varDataVal
(
data
);
avgTransferInfo
(
pInputInfo
,
pInfo
);
avgTransferInfo
(
pInputInfo
,
pInfo
);
...
@@ -2559,7 +2558,7 @@ int32_t apercentileFunctionMerge(SqlFunctionCtx* pCtx) {
...
@@ -2559,7 +2558,7 @@ int32_t apercentileFunctionMerge(SqlFunctionCtx* pCtx) {
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
start
=
pInput
->
startRowIndex
;
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
char
*
data
=
colDataGetData
(
pCol
,
i
);
char
*
data
=
colDataGetData
(
pCol
,
i
);
SAPercentileInfo
*
pInputInfo
=
(
SAPercentileInfo
*
)
varDataVal
(
data
);
SAPercentileInfo
*
pInputInfo
=
(
SAPercentileInfo
*
)
varDataVal
(
data
);
apercentileTransferInfo
(
pInputInfo
,
pInfo
);
apercentileTransferInfo
(
pInputInfo
,
pInfo
);
...
@@ -2925,7 +2924,7 @@ static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx* pCtx, bool isFirstQuer
...
@@ -2925,7 +2924,7 @@ static int32_t firstLastFunctionMergeImpl(SqlFunctionCtx* pCtx, bool isFirstQuer
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
numOfElems
=
0
;
int32_t
numOfElems
=
0
;
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
char
*
data
=
colDataGetData
(
pCol
,
i
);
char
*
data
=
colDataGetData
(
pCol
,
i
);
SFirstLastRes
*
pInputInfo
=
(
SFirstLastRes
*
)
varDataVal
(
data
);
SFirstLastRes
*
pInputInfo
=
(
SFirstLastRes
*
)
varDataVal
(
data
);
firstLastTransferInfo
(
pCtx
,
pInputInfo
,
pInfo
,
isFirstQuery
);
firstLastTransferInfo
(
pCtx
,
pInputInfo
,
pInfo
,
isFirstQuery
);
...
@@ -2951,7 +2950,7 @@ int32_t firstLastFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
...
@@ -2951,7 +2950,7 @@ int32_t firstLastFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
pResInfo
->
isNullRes
=
(
pResInfo
->
numOfRes
==
0
)
?
1
:
0
;
pResInfo
->
isNullRes
=
(
pResInfo
->
numOfRes
==
0
)
?
1
:
0
;
SFirstLastRes
*
pRes
=
GET_ROWCELL_INTERBUF
(
pResInfo
);
SFirstLastRes
*
pRes
=
GET_ROWCELL_INTERBUF
(
pResInfo
);
colDataAppend
(
pCol
,
pBlock
->
info
.
rows
,
pRes
->
buf
,
pRes
->
isNull
||
pResInfo
->
isNullRes
);
colDataAppend
(
pCol
,
pBlock
->
info
.
rows
,
pRes
->
buf
,
pRes
->
isNull
||
pResInfo
->
isNullRes
);
// handle selectivity
// handle selectivity
STuplePos
*
pTuplePos
=
(
STuplePos
*
)(
pRes
->
buf
+
pRes
->
bytes
+
sizeof
(
TSKEY
));
STuplePos
*
pTuplePos
=
(
STuplePos
*
)(
pRes
->
buf
+
pRes
->
bytes
+
sizeof
(
TSKEY
));
...
@@ -3763,7 +3762,7 @@ int32_t spreadFunctionMerge(SqlFunctionCtx* pCtx) {
...
@@ -3763,7 +3762,7 @@ int32_t spreadFunctionMerge(SqlFunctionCtx* pCtx) {
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
start
=
pInput
->
startRowIndex
;
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
char
*
data
=
colDataGetData
(
pCol
,
i
);
char
*
data
=
colDataGetData
(
pCol
,
i
);
SSpreadInfo
*
pInputInfo
=
(
SSpreadInfo
*
)
varDataVal
(
data
);
SSpreadInfo
*
pInputInfo
=
(
SSpreadInfo
*
)
varDataVal
(
data
);
spreadTransferInfo
(
pInputInfo
,
pInfo
);
spreadTransferInfo
(
pInputInfo
,
pInfo
);
...
@@ -3935,7 +3934,7 @@ int32_t elapsedFunctionMerge(SqlFunctionCtx* pCtx) {
...
@@ -3935,7 +3934,7 @@ int32_t elapsedFunctionMerge(SqlFunctionCtx* pCtx) {
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
start
=
pInput
->
startRowIndex
;
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
char
*
data
=
colDataGetData
(
pCol
,
i
);
char
*
data
=
colDataGetData
(
pCol
,
i
);
SElapsedInfo
*
pInputInfo
=
(
SElapsedInfo
*
)
varDataVal
(
data
);
SElapsedInfo
*
pInputInfo
=
(
SElapsedInfo
*
)
varDataVal
(
data
);
elapsedTransferInfo
(
pInputInfo
,
pInfo
);
elapsedTransferInfo
(
pInputInfo
,
pInfo
);
...
@@ -4200,13 +4199,9 @@ static int32_t histogramFunctionImpl(SqlFunctionCtx* pCtx, bool isPartial) {
...
@@ -4200,13 +4199,9 @@ static int32_t histogramFunctionImpl(SqlFunctionCtx* pCtx, bool isPartial) {
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
histogramFunction
(
SqlFunctionCtx
*
pCtx
)
{
int32_t
histogramFunction
(
SqlFunctionCtx
*
pCtx
)
{
return
histogramFunctionImpl
(
pCtx
,
false
);
}
return
histogramFunctionImpl
(
pCtx
,
false
);
}
int32_t
histogramFunctionPartial
(
SqlFunctionCtx
*
pCtx
)
{
int32_t
histogramFunctionPartial
(
SqlFunctionCtx
*
pCtx
)
{
return
histogramFunctionImpl
(
pCtx
,
true
);
}
return
histogramFunctionImpl
(
pCtx
,
true
);
}
static
void
histogramTransferInfo
(
SHistoFuncInfo
*
pInput
,
SHistoFuncInfo
*
pOutput
)
{
static
void
histogramTransferInfo
(
SHistoFuncInfo
*
pInput
,
SHistoFuncInfo
*
pOutput
)
{
pOutput
->
normalized
=
pInput
->
normalized
;
pOutput
->
normalized
=
pInput
->
normalized
;
...
@@ -4228,7 +4223,7 @@ int32_t histogramFunctionMerge(SqlFunctionCtx* pCtx) {
...
@@ -4228,7 +4223,7 @@ int32_t histogramFunctionMerge(SqlFunctionCtx* pCtx) {
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
start
=
pInput
->
startRowIndex
;
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
char
*
data
=
colDataGetData
(
pCol
,
i
);
char
*
data
=
colDataGetData
(
pCol
,
i
);
SHistoFuncInfo
*
pInputInfo
=
(
SHistoFuncInfo
*
)
varDataVal
(
data
);
SHistoFuncInfo
*
pInputInfo
=
(
SHistoFuncInfo
*
)
varDataVal
(
data
);
histogramTransferInfo
(
pInputInfo
,
pInfo
);
histogramTransferInfo
(
pInputInfo
,
pInfo
);
...
@@ -4449,7 +4444,7 @@ int32_t hllFunctionMerge(SqlFunctionCtx* pCtx) {
...
@@ -4449,7 +4444,7 @@ int32_t hllFunctionMerge(SqlFunctionCtx* pCtx) {
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
start
=
pInput
->
startRowIndex
;
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
start
;
i
<
start
+
pInput
->
numOfRows
;
++
i
)
{
char
*
data
=
colDataGetData
(
pCol
,
i
);
char
*
data
=
colDataGetData
(
pCol
,
i
);
SHLLInfo
*
pInputInfo
=
(
SHLLInfo
*
)
varDataVal
(
data
);
SHLLInfo
*
pInputInfo
=
(
SHLLInfo
*
)
varDataVal
(
data
);
hllTransferInfo
(
pInputInfo
,
pInfo
);
hllTransferInfo
(
pInputInfo
,
pInfo
);
...
@@ -6019,7 +6014,6 @@ int32_t lastrowFunction(SqlFunctionCtx* pCtx) {
...
@@ -6019,7 +6014,6 @@ int32_t lastrowFunction(SqlFunctionCtx* pCtx) {
char
*
data
=
colDataGetData
(
pInputCol
,
i
);
char
*
data
=
colDataGetData
(
pInputCol
,
i
);
TSKEY
cts
=
getRowPTs
(
pInput
->
pPTS
,
i
);
TSKEY
cts
=
getRowPTs
(
pInput
->
pPTS
,
i
);
if
(
pResInfo
->
numOfRes
==
0
||
pInfo
->
ts
<
cts
)
{
if
(
pResInfo
->
numOfRes
==
0
||
pInfo
->
ts
<
cts
)
{
if
(
colDataIsNull_s
(
pInputCol
,
i
))
{
if
(
colDataIsNull_s
(
pInputCol
,
i
))
{
pInfo
->
isNull
=
true
;
pInfo
->
isNull
=
true
;
}
else
{
}
else
{
...
...
source/libs/nodes/src/nodesCodeFuncs.c
浏览文件 @
918df89b
...
@@ -1470,9 +1470,36 @@ static int32_t jsonToPhysiScanNode(const SJson* pJson, void* pObj) {
...
@@ -1470,9 +1470,36 @@ static int32_t jsonToPhysiScanNode(const SJson* pJson, void* pObj) {
return
code
;
return
code
;
}
}
static
int32_t
physiTagScanNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
return
physiScanNodeToJson
(
pObj
,
pJson
);
}
static
const
char
*
jkLastRowScanPhysiPlanGroupTags
=
"GroupTags"
;
static
const
char
*
jkLastRowScanPhysiPlanGroupSort
=
"GroupSort"
;
static
int32_t
jsonToPhysiTagScanNode
(
const
SJson
*
pJson
,
void
*
pObj
)
{
return
jsonToPhysiScanNode
(
pJson
,
pObj
);
}
static
int32_t
physiLastRowScanNodeToJson
(
const
void
*
pObj
,
SJson
*
pJson
)
{
const
SLastRowScanPhysiNode
*
pNode
=
(
const
SLastRowScanPhysiNode
*
)
pObj
;
int32_t
code
=
physiScanNodeToJson
(
pObj
,
pJson
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
nodeListToJson
(
pJson
,
jkLastRowScanPhysiPlanGroupTags
,
pNode
->
pGroupTags
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonAddBoolToObject
(
pJson
,
jkLastRowScanPhysiPlanGroupSort
,
pNode
->
groupSort
);
}
return
code
;
}
static
int32_t
jsonToPhysiLastRowScanNode
(
const
SJson
*
pJson
,
void
*
pObj
)
{
SLastRowScanPhysiNode
*
pNode
=
(
SLastRowScanPhysiNode
*
)
pObj
;
int32_t
code
=
jsonToPhysiScanNode
(
pJson
,
pObj
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
jsonToNodeList
(
pJson
,
jkLastRowScanPhysiPlanGroupTags
,
&
pNode
->
pGroupTags
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
tjsonGetBoolValue
(
pJson
,
jkLastRowScanPhysiPlanGroupSort
,
&
pNode
->
groupSort
);
}
return
code
;
}
static
const
char
*
jkTableScanPhysiPlanScanCount
=
"ScanCount"
;
static
const
char
*
jkTableScanPhysiPlanScanCount
=
"ScanCount"
;
static
const
char
*
jkTableScanPhysiPlanReverseScanCount
=
"ReverseScanCount"
;
static
const
char
*
jkTableScanPhysiPlanReverseScanCount
=
"ReverseScanCount"
;
...
@@ -4317,8 +4344,9 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
...
@@ -4317,8 +4344,9 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
return
logicPlanToJson
(
pObj
,
pJson
);
return
logicPlanToJson
(
pObj
,
pJson
);
case
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
:
return
physiScanNodeToJson
(
pObj
,
pJson
);
case
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
:
return
physi
Tag
ScanNodeToJson
(
pObj
,
pJson
);
return
physi
LastRow
ScanNodeToJson
(
pObj
,
pJson
);
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
:
...
@@ -4463,8 +4491,10 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) {
...
@@ -4463,8 +4491,10 @@ static int32_t jsonToSpecificNode(const SJson* pJson, void* pObj) {
return
jsonToLogicPlan
(
pJson
,
pObj
);
return
jsonToLogicPlan
(
pJson
,
pObj
);
case
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
:
return
jsonToPhysiScanNode
(
pJson
,
pObj
);
case
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
:
return
jsonToPhysiTagScanNode
(
pJson
,
pObj
);
return
jsonToPhysiLastRowScanNode
(
pJson
,
pObj
);
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
:
case
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
:
...
...
source/libs/parser/src/parInsert.c
浏览文件 @
918df89b
...
@@ -1178,6 +1178,13 @@ static int parseOneRow(SInsertParseContext* pCxt, STableDataBlocks* pDataBlocks,
...
@@ -1178,6 +1178,13 @@ static int parseOneRow(SInsertParseContext* pCxt, STableDataBlocks* pDataBlocks,
TSKEY
tsKey
=
TD_ROW_KEY
(
row
);
TSKEY
tsKey
=
TD_ROW_KEY
(
row
);
checkTimestamp
(
pDataBlocks
,
(
const
char
*
)
&
tsKey
);
checkTimestamp
(
pDataBlocks
,
(
const
char
*
)
&
tsKey
);
}
}
if
(
i
<
spd
->
numOfBound
-
1
)
{
NEXT_VALID_TOKEN
(
pCxt
->
pSql
,
sToken
);
if
(
TK_NK_COMMA
!=
sToken
.
type
)
{
return
buildSyntaxErrMsg
(
&
pCxt
->
msg
,
", expected"
,
sToken
.
z
);
}
}
}
}
if
(
!
isParseBindParam
)
{
if
(
!
isParseBindParam
)
{
...
...
source/libs/planner/src/planPhysiCreater.c
浏览文件 @
918df89b
...
@@ -481,8 +481,6 @@ static ENodeType getScanOperatorType(EScanType scanType) {
...
@@ -481,8 +481,6 @@ static ENodeType getScanOperatorType(EScanType scanType) {
return
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
;
return
QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN
;
case
SCAN_TYPE_BLOCK_INFO
:
case
SCAN_TYPE_BLOCK_INFO
:
return
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
;
return
QUERY_NODE_PHYSICAL_PLAN_BLOCK_DIST_SCAN
;
case
SCAN_TYPE_LAST_ROW
:
return
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
;
default:
default:
break
;
break
;
}
}
...
@@ -502,6 +500,24 @@ static int32_t createSimpleScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSub
...
@@ -502,6 +500,24 @@ static int32_t createSimpleScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSub
return
createScanPhysiNodeFinalize
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pScan
,
pPhyNode
);
return
createScanPhysiNodeFinalize
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pScan
,
pPhyNode
);
}
}
static
int32_t
createLastRowScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SLastRowScanPhysiNode
*
pScan
=
(
SLastRowScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pScanLogicNode
,
QUERY_NODE_PHYSICAL_PLAN_LAST_ROW_SCAN
);
if
(
NULL
==
pScan
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
pScan
->
pGroupTags
=
nodesCloneList
(
pScanLogicNode
->
pGroupTags
);
if
(
NULL
!=
pScanLogicNode
->
pGroupTags
&&
NULL
==
pScan
->
pGroupTags
)
{
nodesDestroyNode
((
SNode
*
)
pScan
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
pScan
->
groupSort
=
pScanLogicNode
->
groupSort
;
return
createScanPhysiNodeFinalize
(
pCxt
,
pSubplan
,
pScanLogicNode
,
(
SScanPhysiNode
*
)
pScan
,
pPhyNode
);
}
static
int32_t
createTableScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
static
int32_t
createTableScanPhysiNode
(
SPhysiPlanContext
*
pCxt
,
SSubplan
*
pSubplan
,
SScanLogicNode
*
pScanLogicNode
,
SPhysiNode
**
pPhyNode
)
{
SPhysiNode
**
pPhyNode
)
{
STableScanPhysiNode
*
pTableScan
=
(
STableScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pScanLogicNode
,
STableScanPhysiNode
*
pTableScan
=
(
STableScanPhysiNode
*
)
makePhysiNode
(
pCxt
,
(
SLogicNode
*
)
pScanLogicNode
,
...
@@ -583,8 +599,9 @@ static int32_t createScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan,
...
@@ -583,8 +599,9 @@ static int32_t createScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan,
switch
(
pScanLogicNode
->
scanType
)
{
switch
(
pScanLogicNode
->
scanType
)
{
case
SCAN_TYPE_TAG
:
case
SCAN_TYPE_TAG
:
case
SCAN_TYPE_BLOCK_INFO
:
case
SCAN_TYPE_BLOCK_INFO
:
case
SCAN_TYPE_LAST_ROW
:
return
createSimpleScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
return
createSimpleScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
case
SCAN_TYPE_LAST_ROW
:
return
createLastRowScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
case
SCAN_TYPE_TABLE
:
case
SCAN_TYPE_TABLE
:
return
createTableScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
return
createTableScanPhysiNode
(
pCxt
,
pSubplan
,
pScanLogicNode
,
pPhyNode
);
case
SCAN_TYPE_SYSTEM_TABLE
:
case
SCAN_TYPE_SYSTEM_TABLE
:
...
...
source/libs/planner/src/planSpliter.c
浏览文件 @
918df89b
...
@@ -364,6 +364,8 @@ static int32_t stbSplCreatePartWindowNode(SWindowLogicNode* pMergeWindow, SLogic
...
@@ -364,6 +364,8 @@ static int32_t stbSplCreatePartWindowNode(SWindowLogicNode* pMergeWindow, SLogic
pMergeWindow
->
node
.
pTargets
=
NULL
;
pMergeWindow
->
node
.
pTargets
=
NULL
;
SNodeList
*
pChildren
=
pMergeWindow
->
node
.
pChildren
;
SNodeList
*
pChildren
=
pMergeWindow
->
node
.
pChildren
;
pMergeWindow
->
node
.
pChildren
=
NULL
;
pMergeWindow
->
node
.
pChildren
=
NULL
;
SNode
*
pConditions
=
pMergeWindow
->
node
.
pConditions
;
pMergeWindow
->
node
.
pConditions
=
NULL
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
SWindowLogicNode
*
pPartWin
=
(
SWindowLogicNode
*
)
nodesCloneNode
((
SNode
*
)
pMergeWindow
);
SWindowLogicNode
*
pPartWin
=
(
SWindowLogicNode
*
)
nodesCloneNode
((
SNode
*
)
pMergeWindow
);
...
@@ -373,6 +375,7 @@ static int32_t stbSplCreatePartWindowNode(SWindowLogicNode* pMergeWindow, SLogic
...
@@ -373,6 +375,7 @@ static int32_t stbSplCreatePartWindowNode(SWindowLogicNode* pMergeWindow, SLogic
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
pMergeWindow
->
node
.
pTargets
=
pTargets
;
pMergeWindow
->
node
.
pTargets
=
pTargets
;
pMergeWindow
->
node
.
pConditions
=
pConditions
;
pPartWin
->
node
.
pChildren
=
pChildren
;
pPartWin
->
node
.
pChildren
=
pChildren
;
splSetParent
((
SLogicNode
*
)
pPartWin
);
splSetParent
((
SLogicNode
*
)
pPartWin
);
code
=
stbSplRewriteFuns
(
pFunc
,
&
pPartWin
->
pFuncs
,
&
pMergeWindow
->
pFuncs
);
code
=
stbSplRewriteFuns
(
pFunc
,
&
pPartWin
->
pFuncs
,
&
pMergeWindow
->
pFuncs
);
...
...
source/libs/planner/test/planBasicTest.cpp
浏览文件 @
918df89b
...
@@ -108,6 +108,8 @@ TEST_F(PlanBasicTest, lastRowFunc) {
...
@@ -108,6 +108,8 @@ TEST_F(PlanBasicTest, lastRowFunc) {
run
(
"SELECT LAST_ROW(c1) FROM st1"
);
run
(
"SELECT LAST_ROW(c1) FROM st1"
);
run
(
"SELECT LAST_ROW(c1) FROM st1 PARTITION BY TBNAME"
);
run
(
"SELECT LAST_ROW(c1), SUM(c3) FROM t1"
);
run
(
"SELECT LAST_ROW(c1), SUM(c3) FROM t1"
);
}
}
...
...
source/libs/planner/test/planSubqueryTest.cpp
浏览文件 @
918df89b
...
@@ -36,6 +36,8 @@ TEST_F(PlanSubqeuryTest, basic) {
...
@@ -36,6 +36,8 @@ TEST_F(PlanSubqeuryTest, basic) {
run
(
"SELECT * FROM (SELECT NOW() FROM t1)"
);
run
(
"SELECT * FROM (SELECT NOW() FROM t1)"
);
run
(
"SELECT NOW() FROM (SELECT * FROM t1) ORDER BY ts"
);
run
(
"SELECT NOW() FROM (SELECT * FROM t1) ORDER BY ts"
);
run
(
"SELECT * FROM (SELECT AVG(c1) a FROM st1 INTERVAL(10s)) WHERE a > 1"
);
}
}
TEST_F
(
PlanSubqeuryTest
,
doubleGroupBy
)
{
TEST_F
(
PlanSubqeuryTest
,
doubleGroupBy
)
{
...
...
source/libs/scalar/src/sclvector.c
浏览文件 @
918df89b
...
@@ -1477,7 +1477,8 @@ void vectorAssign(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut,
...
@@ -1477,7 +1477,8 @@ void vectorAssign(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut,
pOut
->
numOfRows
=
pLeft
->
numOfRows
;
pOut
->
numOfRows
=
pLeft
->
numOfRows
;
if
(
IS_HELPER_NULL
(
pRight
->
columnData
,
0
))
{
// if (IS_HELPER_NULL(pRight->columnData, 0)) {
if
(
colDataIsNull_s
(
pRight
->
columnData
,
0
)){
for
(
int32_t
i
=
0
;
i
<
pOut
->
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pOut
->
numOfRows
;
++
i
)
{
colDataAppend
(
pOutputCol
,
i
,
NULL
,
true
);
colDataAppend
(
pOutputCol
,
i
,
NULL
,
true
);
}
}
...
...
tests/script/general/insert/testSuite.sim
已删除
100644 → 0
浏览文件 @
dc4052bd
run general/insert/basic.sim
run general/insert/insert_drop.sim
run general/insert/query_block1_memory.sim
run general/insert/query_block2_memory.sim
run general/insert/query_block1_file.sim
run general/insert/query_block2_file.sim
run general/insert/query_file_memory.sim
run general/insert/query_multi_file.sim
run general/insert/tcp.sim
tests/script/general/table/testSuite.sim
已删除
100644 → 0
浏览文件 @
dc4052bd
run general/table/autocreate.sim
run general/table/basic1.sim
run general/table/basic2.sim
run general/table/basic3.sim
run general/table/bigint.sim
run general/table/binary.sim
run general/table/bool.sim
run general/table/column_name.sim
run general/table/column_num.sim
run general/table/column_value.sim
run general/table/column2.sim
run general/table/date.sim
run general/table/db.table.sim
run general/table/delete_reuse1.sim
run general/table/delete_reuse2.sim
run general/table/delete_writing.sim
run general/table/describe.sim
run general/table/double.sim
run general/table/fill.sim
run general/table/float.sim
run general/table/int.sim
run general/table/limit.sim
run general/table/smallint.sim
run general/table/table_len.sim
run general/table/table.sim
run general/table/tinyint.sim
run general/table/vgroup.sim
tests/script/jenkins/basic.txt
浏览文件 @
918df89b
...
@@ -52,13 +52,22 @@
...
@@ -52,13 +52,22 @@
./test.sh -f tsim/import/replica1.sim
./test.sh -f tsim/import/replica1.sim
# ---- insert
# ---- insert
./test.sh -f tsim/insert/backquote.sim
./test.sh -f tsim/insert/basic.sim
./test.sh -f tsim/insert/basic0.sim
./test.sh -f tsim/insert/basic0.sim
./test.sh -f tsim/insert/basic1.sim
./test.sh -f tsim/insert/basic1.sim
./test.sh -f tsim/insert/backquote.sim
./test.sh -f tsim/insert/null.sim
./test.sh -f tsim/insert/update0.sim
./test.sh -f tsim/insert/commit-merge0.sim
./test.sh -f tsim/insert/commit-merge0.sim
./test.sh -f tsim/insert/insert_drop.sim
./test.sh -f tsim/insert/insert_select.sim
./test.sh -f tsim/insert/insert_select.sim
./test.sh -f tsim/insert/null.sim
./test.sh -f tsim/insert/query_block1_file.sim
./test.sh -f tsim/insert/query_block1_memory.sim
./test.sh -f tsim/insert/query_block2_file.sim
./test.sh -f tsim/insert/query_block2_memory.sim
./test.sh -f tsim/insert/query_file_memory.sim
./test.sh -f tsim/insert/query_multi_file.sim
#./test.sh -f tsim/insert/tcp.sim
./test.sh -f tsim/insert/update0.sim
# ---- parser
# ---- parser
./test.sh -f tsim/parser/groupby-basic.sim
./test.sh -f tsim/parser/groupby-basic.sim
...
@@ -94,7 +103,33 @@
...
@@ -94,7 +103,33 @@
./test.sh -f tsim/show/basic.sim
./test.sh -f tsim/show/basic.sim
# ---- table
# ---- table
./test.sh -f tsim/table/autocreate.sim
./test.sh -f tsim/table/basic1.sim
./test.sh -f tsim/table/basic1.sim
./test.sh -f tsim/table/basic2.sim
./test.sh -f tsim/table/basic3.sim
./test.sh -f tsim/table/bigint.sim
./test.sh -f tsim/table/binary.sim
./test.sh -f tsim/table/bool.sim
./test.sh -f tsim/table/column_name.sim
./test.sh -f tsim/table/column_num.sim
./test.sh -f tsim/table/column_value.sim
./test.sh -f tsim/table/column2.sim
./test.sh -f tsim/table/createmulti.sim
./test.sh -f tsim/table/date.sim
./test.sh -f tsim/table/db.table.sim
# ./test.sh -f tsim/table/delete_reuse1.sim
# ./test.sh -f tsim/table/delete_reuse2.sim
# ./test.sh -f tsim/table/delete_writing.sim
./test.sh -f tsim/table/describe.sim
./test.sh -f tsim/table/double.sim
./test.sh -f tsim/table/float.sim
./test.sh -f tsim/table/int.sim
./test.sh -f tsim/table/limit.sim
./test.sh -f tsim/table/smallint.sim
./test.sh -f tsim/table/table_len.sim
./test.sh -f tsim/table/table.sim
./test.sh -f tsim/table/tinyint.sim
./test.sh -f tsim/table/vgroup.sim
# ---- stream
# ---- stream
./test.sh -f tsim/stream/basic0.sim
./test.sh -f tsim/stream/basic0.sim
...
@@ -228,23 +263,23 @@
...
@@ -228,23 +263,23 @@
./test.sh -f tsim/compress/uncompress.sim
./test.sh -f tsim/compress/uncompress.sim
# ---- compute
# ---- compute
#
./test.sh -f tsim/compute/avg.sim
./test.sh -f tsim/compute/avg.sim
#./test.sh -f tsim/compute/block_dist.sim
#./test.sh -f tsim/compute/block_dist.sim
#
./test.sh -f tsim/compute/bottom.sim
./test.sh -f tsim/compute/bottom.sim
#
./test.sh -f tsim/compute/count.sim
./test.sh -f tsim/compute/count.sim
#
./test.sh -f tsim/compute/diff.sim
./test.sh -f tsim/compute/diff.sim
#
./test.sh -f tsim/compute/diff2.sim
./test.sh -f tsim/compute/diff2.sim
#
./test.sh -f tsim/compute/first.sim
./test.sh -f tsim/compute/first.sim
#
./test.sh -f tsim/compute/interval.sim
./test.sh -f tsim/compute/interval.sim
#./test.sh -f tsim/compute/last_row.sim
#./test.sh -f tsim/compute/last_row.sim
#
./test.sh -f tsim/compute/last.sim
./test.sh -f tsim/compute/last.sim
#
./test.sh -f tsim/compute/leastsquare.sim
./test.sh -f tsim/compute/leastsquare.sim
#
./test.sh -f tsim/compute/max.sim
./test.sh -f tsim/compute/max.sim
#
./test.sh -f tsim/compute/min.sim
./test.sh -f tsim/compute/min.sim
#./test.sh -f tsim/compute/null.sim
#./test.sh -f tsim/compute/null.sim
./test.sh -f tsim/compute/percentile.sim
./test.sh -f tsim/compute/percentile.sim
./test.sh -f tsim/compute/stddev.sim
./test.sh -f tsim/compute/stddev.sim
#
./test.sh -f tsim/compute/sum.sim
./test.sh -f tsim/compute/sum.sim
./test.sh -f tsim/compute/top.sim
./test.sh -f tsim/compute/top.sim
# ---- field
# ---- field
...
...
tests/script/tsim/cache/new_metrics.sim
浏览文件 @
918df89b
...
@@ -83,10 +83,6 @@ while $i < 10
...
@@ -83,10 +83,6 @@ while $i < 10
$i = $i + 1
$i = $i + 1
endw
endw
print ==> sleep 1 seconds to renew cache
sql reset query cache
sleep 1000
print =============== step5
print =============== step5
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
print ===>rows $rows, data $data01
print ===>rows $rows, data $data01
...
...
tests/script/tsim/cache/restart_metrics.sim
浏览文件 @
918df89b
...
@@ -48,9 +48,7 @@ system sh/deploy.sh -n dnode1 -i 1
...
@@ -48,9 +48,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
print =============== step3
print =============== step3
print ==> sleep 1 seconds to renew cache
sql reset query cache
sql reset query cache
sleep 1000
print =============== step4
print =============== step4
sql create database $db
sql create database $db
...
...
tests/script/tsim/cache/restart_table.sim
浏览文件 @
918df89b
...
@@ -32,9 +32,7 @@ system sh/deploy.sh -n dnode1 -i 1
...
@@ -32,9 +32,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
print =============== step3
print =============== step3
print ==> sleep 1 seconds to renew cache
sql reset query cache
sql reset query cache
sleep 1000
print =============== step4
print =============== step4
sql create database $db
sql create database $db
...
...
tests/script/tsim/compress/commitlog.sim
浏览文件 @
918df89b
...
@@ -57,15 +57,7 @@ $tb = $tbPrefix . $i
...
@@ -57,15 +57,7 @@ $tb = $tbPrefix . $i
sql create database $db
sql create database $db
sql use $db
sql use $db
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256))
$x = 0
step3:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $tb (ts timestamp, b bool, t tinyint, s smallint, i int, big bigint, f float, d double, str binary(256)) -x step3
$count = 0
$count = 0
while $count < $N
while $count < $N
...
...
tests/script/tsim/compute/avg.sim
浏览文件 @
918df89b
...
@@ -38,8 +38,6 @@ while $i < $tbNum
...
@@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
@@ -69,13 +67,13 @@ endi
...
@@ -69,13 +67,13 @@ endi
print =============== step5
print =============== step5
sql select avg(tbcol) as b from $tb interval(1m)
sql select avg(tbcol) as b from $tb interval(1m)
print ===> $data01
print ===> $data01
if $data1
1
!= 1.000000000 then
if $data1
0
!= 1.000000000 then
return -1
return -1
endi
endi
sql select avg(tbcol) as b from $tb interval(1d)
sql select avg(tbcol) as b from $tb interval(1d)
print ===> $data01
print ===> $data01
if $data0
1
!= 9.500000000 then
if $data0
0
!= 9.500000000 then
return -1
return -1
endi
endi
...
@@ -84,7 +82,7 @@ $cc = 4 * 60000
...
@@ -84,7 +82,7 @@ $cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select avg(tbcol) as b from $tb where ts <= $ms interval(1m)
sql select avg(tbcol) as b from $tb where ts <= $ms interval(1m)
print ===> $data01
print ===> $data01
if $data4
1
!= 4.000000000 then
if $data4
0
!= 4.000000000 then
return -1
return -1
endi
endi
if $rows != 5 then
if $rows != 5 then
...
@@ -123,14 +121,14 @@ endi
...
@@ -123,14 +121,14 @@ endi
print =============== step9
print =============== step9
sql select avg(tbcol) as b from $mt interval(1m)
sql select avg(tbcol) as b from $mt interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1.000000000 then
if $data1
0
!= 1.000000000 then
return -1
return -1
endi
endi
sql select avg(tbcol) as b from $mt interval(1d)
sql select avg(tbcol) as b from $mt interval(1d)
print ===> $data01
print ===> $data01
if $data0
1
!= 9.500000000 then
if $data0
0
!= 9.500000000 then
return -1
return -1
endi
endi
...
@@ -148,9 +146,9 @@ endi
...
@@ -148,9 +146,9 @@ endi
print =============== step11
print =============== step11
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select avg(tbcol) as b from $mt where ts <= $ms
interval(1m) group by tgcol
sql select avg(tbcol) as b from $mt where ts <= $ms
partition by tgcol interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1.000000000 then
if $data1
0
!= 1.000000000 then
return -1
return -1
endi
endi
if $rows != 50 then
if $rows != 50 then
...
...
tests/script/tsim/compute/block_dist.sim
浏览文件 @
918df89b
...
@@ -47,8 +47,6 @@ while $x < $rowNum
...
@@ -47,8 +47,6 @@ while $x < $rowNum
$x = $x + 1
$x = $x + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 0
$i = 0
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/compute/bottom.sim
浏览文件 @
918df89b
...
@@ -38,15 +38,13 @@ while $i < $tbNum
...
@@ -38,15 +38,13 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql select bottom(tbcol, 1) from $tb
sql select bottom(tbcol, 1) from $tb
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 0 then
if $data0
0
!= 0 then
return -1
return -1
endi
endi
...
@@ -54,25 +52,25 @@ print =============== step3
...
@@ -54,25 +52,25 @@ print =============== step3
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select bottom(tbcol, 1) from $tb where ts > $ms
sql select bottom(tbcol, 1) from $tb where ts > $ms
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 5 then
if $data0
0
!= 5 then
return -1
return -1
endi
endi
print =============== step4
print =============== step4
sql select bottom(tbcol, 1) as b from $tb
sql select bottom(tbcol, 1) as b from $tb
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 0 then
if $data0
0
!= 0 then
return -1
return -1
endi
endi
print =============== step5
print =============== step5
sql select bottom(tbcol, 2) as b from $tb
sql select bottom(tbcol, 2) as b from $tb
print ===> $data0
1 $data11
print ===> $data0
0 $data10
if $data0
1 != 0
then
if $data0
0 != 1
then
return -1
return -1
endi
endi
if $data1
1 != 1
then
if $data1
0 != 0
then
return -1
return -1
endi
endi
...
@@ -80,11 +78,11 @@ print =============== step6
...
@@ -80,11 +78,11 @@ print =============== step6
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select bottom(tbcol, 2) as b from $tb where ts > $ms
sql select bottom(tbcol, 2) as b from $tb where ts > $ms
print ===> $data0
1 $data11
print ===> $data0
0 $data10
if $data0
1 != 5
then
if $data0
0 != 6
then
return -1
return -1
endi
endi
if $data1
1 != 6
then
if $data1
0 != 5
then
return -1
return -1
endi
endi
...
...
tests/script/tsim/compute/count.sim
浏览文件 @
918df89b
...
@@ -38,13 +38,10 @@ while $i < $tbNum
...
@@ -38,13 +38,10 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql select count(*) from $tb
sql select count(*) from $tb
print ===> select count(*) from $tb => $data00
print ===> select count(*) from $tb => $data00
if $data00 != $rowNum then
if $data00 != $rowNum then
...
@@ -81,14 +78,14 @@ endi
...
@@ -81,14 +78,14 @@ endi
print =============== step5
print =============== step5
sql select count(tbcol) as b from $tb interval(1m)
sql select count(tbcol) as b from $tb interval(1m)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 1 then
if $data0
0
!= 1 then
return -1
return -1
endi
endi
sql select count(tbcol) as b from $tb interval(1d)
sql select count(tbcol) as b from $tb interval(1d)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= $rowNum then
if $data0
0
!= $rowNum then
return -1
return -1
endi
endi
...
@@ -96,8 +93,8 @@ print =============== step6
...
@@ -96,8 +93,8 @@ print =============== step6
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select count(tbcol) as b from $tb where ts <= $ms interval(1m)
sql select count(tbcol) as b from $tb where ts <= $ms interval(1m)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 1 then
if $data0
0
!= 1 then
return -1
return -1
endi
endi
if $rows != 5 then
if $rows != 5 then
...
@@ -149,17 +146,17 @@ endi
...
@@ -149,17 +146,17 @@ endi
print =============== step9
print =============== step9
sql select count(tbcol) as b from $mt interval(1m)
sql select count(tbcol) as b from $mt interval(1m)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 10 then
if $data0
0
!= 10 then
return -1
return -1
endi
endi
if $data1
1
!= 10 then
if $data1
0
!= 10 then
return -1
return -1
endi
endi
sql select count(tbcol) as b from $mt interval(1d)
sql select count(tbcol) as b from $mt interval(1d)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 200 then
if $data0
0
!= 200 then
return -1
return -1
endi
endi
...
@@ -177,9 +174,9 @@ endi
...
@@ -177,9 +174,9 @@ endi
print =============== step11
print =============== step11
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select count(tbcol) as b from $mt where ts <= $ms
interval(1m) group by tgcol
sql select count(tbcol) as b from $mt where ts <= $ms
partition by tgcol interval(1m)
print ===> $data01
print ===> $data01
if $data0
1
!= 1 then
if $data0
0
!= 1 then
return -1
return -1
endi
endi
if $rows != 50 then
if $rows != 50 then
...
...
tests/script/tsim/compute/diff.sim
浏览文件 @
918df89b
...
@@ -37,15 +37,13 @@ while $i < $tbNum
...
@@ -37,15 +37,13 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql select diff(tbcol) from $tb
sql select diff(tbcol) from $tb
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
...
@@ -53,23 +51,23 @@ print =============== step3
...
@@ -53,23 +51,23 @@ print =============== step3
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select diff(tbcol) from $tb where ts > $ms
sql select diff(tbcol) from $tb where ts > $ms
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select diff(tbcol) from $tb where ts <= $ms
sql select diff(tbcol) from $tb where ts <= $ms
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
print =============== step4
print =============== step4
sql select diff(tbcol) as b from $tb
sql select diff(tbcol) as b from $tb
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
...
...
tests/script/tsim/compute/diff2.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c debugflag -v 131
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
...
@@ -39,91 +40,90 @@ while $i < $tbNum
...
@@ -39,91 +40,90 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql select diff(c1) from $tb
sql select diff(c1) from $tb
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select diff(c2) from $tb
sql select diff(c2) from $tb
print ===> $data1
1
print ===> $data1
0
if $data1
1 != 1.
00000 then
if $data1
0 != 1.0000
00000 then
return -1
return -1
endi
endi
sql select diff(c3) from $tb
sql select diff(c3) from $tb
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select diff(c4) from $tb
sql select diff(c4) from $tb
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select diff(c5) from $tb
sql select diff(c5) from $tb
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 0 then
if $data1
0
!= 0 then
return -1
return -1
endi
endi
sql select diff(c6) from $tb
sql select diff(c6) from $tb
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1.000000000 then
if $data1
0
!= 1.000000000 then
return -1
return -1
endi
endi
sql_error select diff(c7) from $tb
sql select diff(c7) from $tb
sql_error select diff(c8) from $tb
sql_error select diff(c8) from $tb
sql_error select diff(c9) from $tb
sql_error select diff(c9) from $tb
sql_error select diff(ts) from $tb
sql_error select diff(ts) from $tb
sql_error select diff(c1), diff(c2) from $tb
sql_error select diff(c1), diff(c2) from $tb
#sql_error select 2+diff(c1) from $tb
sql_error select diff(c1+2) from $tb
sql select 2+diff(c1) from $tb
sql select diff(c1+2) from $tb
sql_error select diff(c1) from $tb where ts > 0 and ts < now + 100m interval(10m)
sql_error select diff(c1) from $tb where ts > 0 and ts < now + 100m interval(10m)
sql
_error
select diff(c1) from $mt
sql select diff(c1) from $mt
sql_error select diff(diff(c1)) from $tb
sql_error select diff(diff(c1)) from $tb
sql_error select diff(c1) from m_di_tb1 where c2 like '2%'
sql_error select diff(c1) from m_di_tb1 where c2 like '2%'
print =============== step3
print =============== step3
sql select diff(c1) from $tb where c1 > 5
sql select diff(c1) from $tb where c1 > 5
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select diff(c2) from $tb where c2 > 5
sql select diff(c2) from $tb where c2 > 5
print ===> $data1
1
print ===> $data1
0
if $data1
1 != 1.
00000 then
if $data1
0 != 1.0000
00000 then
return -1
return -1
endi
endi
sql select diff(c3) from $tb where c3 > 5
sql select diff(c3) from $tb where c3 > 5
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select diff(c4) from $tb where c4 > 5
sql select diff(c4) from $tb where c4 > 5
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select diff(c5) from $tb where c5 > 5
sql select diff(c5) from $tb where c5 > 5
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 0 then
if $data1
0
!= 0 then
return -1
return -1
endi
endi
sql select diff(c6) from $tb where c6 > 5
sql select diff(c6) from $tb where c6 > 5
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1.000000000 then
if $data1
0
!= 1.000000000 then
return -1
return -1
endi
endi
print =============== step4
print =============== step4
sql select diff(c1) from $tb where c1 > 5 and c2 < $rowNum
sql select diff(c1) from $tb where c1 > 5 and c2 < $rowNum
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
...
@@ -131,8 +131,8 @@ sql select diff(c1) from $tb where c9 like '%9' and c1 <= 20
...
@@ -131,8 +131,8 @@ sql select diff(c1) from $tb where c9 like '%9' and c1 <= 20
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
print ===> $data1
1
print ===> $data1
0
if $data0
1
!= 10 then
if $data0
0
!= 10 then
return -1
return -1
endi
endi
...
...
tests/script/tsim/compute/first.sim
浏览文件 @
918df89b
...
@@ -38,8 +38,6 @@ while $i < $tbNum
...
@@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
@@ -68,14 +66,14 @@ endi
...
@@ -68,14 +66,14 @@ endi
print =============== step5
print =============== step5
sql select first(tbcol) as b from $tb interval(1m)
sql select first(tbcol) as b from $tb interval(1m)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 0 then
if $data0
0
!= 0 then
return -1
return -1
endi
endi
sql select first(tbcol) as b from $tb interval(1d)
sql select first(tbcol) as b from $tb interval(1d)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 0 then
if $data0
0
!= 0 then
return -1
return -1
endi
endi
...
@@ -83,8 +81,8 @@ print =============== step6
...
@@ -83,8 +81,8 @@ print =============== step6
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select first(tbcol) as b from $tb where ts <= $ms interval(1m)
sql select first(tbcol) as b from $tb where ts <= $ms interval(1m)
print ===> $data0
1
print ===> $data0
0
if $data4
1
!= 4 then
if $data4
0
!= 4 then
return -1
return -1
endi
endi
if $rows != 5 then
if $rows != 5 then
...
@@ -124,14 +122,14 @@ endi
...
@@ -124,14 +122,14 @@ endi
print =============== step9
print =============== step9
sql select first(tbcol) as b from $mt interval(1m)
sql select first(tbcol) as b from $mt interval(1m)
print select first(tbcol) as b from $mt interval(1m)
print select first(tbcol) as b from $mt interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select first(tbcol) as b from $mt interval(1d)
sql select first(tbcol) as b from $mt interval(1d)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 0 then
if $data0
0
!= 0 then
return -1
return -1
endi
endi
...
@@ -149,9 +147,9 @@ endi
...
@@ -149,9 +147,9 @@ endi
print =============== step11
print =============== step11
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select first(tbcol) as b from $mt where ts <= $ms
interval(1m) group by tgcol
sql select first(tbcol) as b from $mt where ts <= $ms
partition by tgcol interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
print ===> $rows
print ===> $rows
...
...
tests/script/tsim/compute/interval.sim
浏览文件 @
918df89b
...
@@ -47,10 +47,10 @@ print ===> $rows
...
@@ -47,10 +47,10 @@ print ===> $rows
if $rows < $rowNum then
if $rows < $rowNum then
return -1
return -1
endi
endi
if $data0
1
!= 1 then
if $data0
0
!= 1 then
return -1
return -1
endi
endi
if $data0
5
!= 1 then
if $data0
4
!= 1 then
return -1
return -1
endi
endi
...
@@ -65,10 +65,10 @@ endi
...
@@ -65,10 +65,10 @@ endi
if $rows < 3 then
if $rows < 3 then
return -1
return -1
endi
endi
if $data0
1
!= 1 then
if $data0
0
!= 1 then
return -1
return -1
endi
endi
if $data0
5
!= 1 then
if $data0
4
!= 1 then
return -1
return -1
endi
endi
...
@@ -87,10 +87,10 @@ endi
...
@@ -87,10 +87,10 @@ endi
if $rows > 22 then
if $rows > 22 then
return -1
return -1
endi
endi
if $data0
1
!= 1 then
if $data0
0
!= 1 then
return -1
return -1
endi
endi
if $data0
5
!= 1 then
if $data0
4
!= 1 then
return -1
return -1
endi
endi
...
@@ -109,10 +109,10 @@ endi
...
@@ -109,10 +109,10 @@ endi
if $rows > 50 then
if $rows > 50 then
return -1
return -1
endi
endi
if $data2
1
!= 1 then
if $data2
0
!= 1 then
return -1
return -1
endi
endi
if $data2
5
!= 1 then
if $data2
4
!= 1 then
return -1
return -1
endi
endi
...
@@ -125,10 +125,10 @@ endi
...
@@ -125,10 +125,10 @@ endi
if $rows > 22 then
if $rows > 22 then
return -1
return -1
endi
endi
if $data1
1
> 15 then
if $data1
0
> 15 then
return -1
return -1
endi
endi
if $data1
1
< 5 then
if $data1
0
< 5 then
return -1
return -1
endi
endi
...
@@ -143,10 +143,10 @@ endi
...
@@ -143,10 +143,10 @@ endi
if $rows > 7 then
if $rows > 7 then
return -1
return -1
endi
endi
if $data1
1
> 15 then
if $data1
0
> 15 then
return -1
return -1
endi
endi
if $data1
1
< 5 then
if $data1
0
< 5 then
return -1
return -1
endi
endi
...
@@ -165,10 +165,10 @@ endi
...
@@ -165,10 +165,10 @@ endi
if $rows > 22 then
if $rows > 22 then
return -1
return -1
endi
endi
if $data1
1
> 15 then
if $data1
0
> 15 then
return -1
return -1
endi
endi
if $data1
1
< 5 then
if $data1
0
< 5 then
return -1
return -1
endi
endi
...
@@ -186,10 +186,10 @@ endi
...
@@ -186,10 +186,10 @@ endi
if $rows > 50 then
if $rows > 50 then
return -1
return -1
endi
endi
if $data1
1
> 15 then
if $data1
0
> 15 then
return -1
return -1
endi
endi
if $data1
1
< 5 then
if $data1
0
< 5 then
return -1
return -1
endi
endi
...
...
tests/script/tsim/compute/last.sim
浏览文件 @
918df89b
...
@@ -38,8 +38,6 @@ while $i < $tbNum
...
@@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
@@ -69,14 +67,14 @@ endi
...
@@ -69,14 +67,14 @@ endi
print =============== step5
print =============== step5
sql select last(tbcol) as b from $tb interval(1m)
sql select last(tbcol) as b from $tb interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select last(tbcol) as b from $tb interval(1d)
sql select last(tbcol) as b from $tb interval(1d)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 19 then
if $data0
0
!= 19 then
return -1
return -1
endi
endi
...
@@ -85,8 +83,8 @@ $cc = 4 * 60000
...
@@ -85,8 +83,8 @@ $cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select last(tbcol) as b from $tb where ts <= $ms interval(1m)
sql select last(tbcol) as b from $tb where ts <= $ms interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
if $rows != 5 then
if $rows != 5 then
...
@@ -127,14 +125,14 @@ endi
...
@@ -127,14 +125,14 @@ endi
print =============== step9
print =============== step9
sql select last(tbcol) as b from $mt interval(1m)
sql select last(tbcol) as b from $mt interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select last(tbcol) as b from $mt interval(1d)
sql select last(tbcol) as b from $mt interval(1d)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 19 then
if $data0
0
!= 19 then
return -1
return -1
endi
endi
...
@@ -153,9 +151,9 @@ print =============== step11
...
@@ -153,9 +151,9 @@ print =============== step11
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select last(tbcol) as b from $mt where ts <= $ms
interval(1m) group by tgcol
sql select last(tbcol) as b from $mt where ts <= $ms
partition by tgcol interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
print ===> $rows
print ===> $rows
...
...
tests/script/tsim/compute/last_row.sim
浏览文件 @
918df89b
...
@@ -38,8 +38,6 @@ while $i < $tbNum
...
@@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
@@ -53,6 +51,7 @@ endi
...
@@ -53,6 +51,7 @@ endi
print =============== step3
print =============== step3
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
print select last_row(tbcol) from $tb where ts <= $ms
sql select last_row(tbcol) from $tb where ts <= $ms
sql select last_row(tbcol) from $tb where ts <= $ms
print ===> $data00
print ===> $data00
if $data00 != 4 then
if $data00 != 4 then
...
@@ -98,8 +97,6 @@ if $data00 != 4 then
...
@@ -98,8 +97,6 @@ if $data00 != 4 then
return -1
return -1
endi
endi
print =============== step10
print =============== step10
sql select last_row(tbcol) as b from $mt group by tgcol
sql select last_row(tbcol) as b from $mt group by tgcol
print ===> $data00
print ===> $data00
...
...
tests/script/tsim/compute/leastsquare.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
@@ -65,21 +63,21 @@ endi
...
@@ -65,21 +63,21 @@ endi
print =============== step5
print =============== step5
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m)
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= @{slop:1.000000, intercept:1.000000}@ then
if $data0
0
!= @{slop:1.000000, intercept:1.000000}@ then
return -1
return -1
endi
endi
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d)
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= @{slop:1.000000, intercept:1.000000}@ then
if $data0
0
!= @{slop:1.000000, intercept:1.000000}@ then
return -1
return -1
endi
endi
print =============== step6
print =============== step6
sql select leastsquares(tbcol, 1, 1) as b from $tb where ts < now + 4m interval(1m)
sql select leastsquares(tbcol, 1, 1) as b from $tb where ts < now + 4m interval(1m)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= @{slop:1.000000, intercept:1.000000}@ then
if $data0
0
!= @{slop:1.000000, intercept:1.000000}@ then
return -1
return -1
endi
endi
print ===> $rows
print ===> $rows
...
...
tests/script/tsim/compute/max.sim
浏览文件 @
918df89b
...
@@ -38,8 +38,6 @@ while $i < $tbNum
...
@@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
@@ -69,14 +67,14 @@ endi
...
@@ -69,14 +67,14 @@ endi
print =============== step5
print =============== step5
sql select max(tbcol) as b from $tb interval(1m)
sql select max(tbcol) as b from $tb interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select max(tbcol) as b from $tb interval(1d)
sql select max(tbcol) as b from $tb interval(1d)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 19 then
if $data0
0
!= 19 then
return -1
return -1
endi
endi
...
@@ -85,8 +83,8 @@ $cc = 4 * 60000
...
@@ -85,8 +83,8 @@ $cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select max(tbcol) as b from $tb where ts <= $ms interval(1m)
sql select max(tbcol) as b from $tb where ts <= $ms interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
if $rows != 5 then
if $rows != 5 then
...
@@ -127,14 +125,14 @@ endi
...
@@ -127,14 +125,14 @@ endi
print =============== step9
print =============== step9
sql select max(tbcol) as b from $mt interval(1m)
sql select max(tbcol) as b from $mt interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
sql select max(tbcol) as b from $mt interval(1d)
sql select max(tbcol) as b from $mt interval(1d)
print ===> $data0
1
print ===> $data0
0
if $data0
1
!= 19 then
if $data0
0
!= 19 then
return -1
return -1
endi
endi
...
@@ -153,9 +151,9 @@ print =============== step11
...
@@ -153,9 +151,9 @@ print =============== step11
$cc = 4 * 60000
$cc = 4 * 60000
$ms = 1601481600000 + $cc
$ms = 1601481600000 + $cc
sql select max(tbcol) as b from $mt where ts <= $ms
interval(1m) group by tgcol
sql select max(tbcol) as b from $mt where ts <= $ms
partition by tgcol interval(1m)
print ===> $data1
1
print ===> $data1
0
if $data1
1
!= 1 then
if $data1
0
!= 1 then
return -1
return -1
endi
endi
print ===> $rows
print ===> $rows
...
...
tests/script/tsim/compute/min.sim
浏览文件 @
918df89b
...
@@ -38,8 +38,6 @@ while $i < $tbNum
...
@@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/compute/null.sim
浏览文件 @
918df89b
...
@@ -100,9 +100,10 @@ if $rows != 1 then
...
@@ -100,9 +100,10 @@ if $rows != 1 then
return -1
return -1
endi
endi
sql_error select * from $tb where tbcol = NULL
sql select * from $tb where tbcol = NULL
if $rows != 0 then
return
return -1
endi
print =============== step5
print =============== step5
sql create table tt using $mt tags( NULL )
sql create table tt using $mt tags( NULL )
...
...
tests/script/tsim/compute/percentile.sim
浏览文件 @
918df89b
...
@@ -38,8 +38,6 @@ while $i < $tbNum
...
@@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/compute/stddev.sim
浏览文件 @
918df89b
...
@@ -38,8 +38,6 @@ while $i < $tbNum
...
@@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/compute/sum.sim
浏览文件 @
918df89b
...
@@ -38,8 +38,6 @@ while $i < $tbNum
...
@@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/compute/top.sim
浏览文件 @
918df89b
...
@@ -38,8 +38,6 @@ while $i < $tbNum
...
@@ -38,8 +38,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/insert/backquote.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 50
sql connect
sql connect
print =============== create database
print =============== create database
sql create database `database`
sql create database `database`
sql create database `DataBase`
sql create database `DataBase`
...
@@ -184,23 +184,6 @@ print =============== stop and restart taosd
...
@@ -184,23 +184,6 @@ print =============== stop and restart taosd
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
sql show databases
sql show databases
print rows: $rows
print rows: $rows
print $data00 $data01
print $data00 $data01
...
...
tests/script/
general
/insert/basic.sim
→
tests/script/
tsim
/insert/basic.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
...
tests/script/tsim/insert/basic0.sim
浏览文件 @
918df89b
...
@@ -271,23 +271,6 @@ print =============== stop and restart taosd, then again do query above
...
@@ -271,23 +271,6 @@ print =============== stop and restart taosd, then again do query above
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
print =============== query data from child table
print =============== query data from child table
sql select * from ct1
sql select * from ct1
print rows: $rows
print rows: $rows
...
...
tests/script/tsim/insert/basic1.sim
浏览文件 @
918df89b
...
@@ -2,6 +2,7 @@ system sh/stop_dnodes.sh
...
@@ -2,6 +2,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
print =============== create database
print =============== create database
sql create database d1
sql create database d1
sql show databases
sql show databases
...
...
tests/script/tsim/insert/commit-merge0.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 50
sql connect
sql connect
print =============== create database
print =============== create database
...
@@ -64,23 +63,6 @@ reboot_and_check:
...
@@ -64,23 +63,6 @@ reboot_and_check:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
print =============== insert duplicated records to memory - loop $reboot_max - $reboot_cnt
print =============== insert duplicated records to memory - loop $reboot_max - $reboot_cnt
sql use db
sql use db
sql insert into ct1 values ('2022-05-01 18:30:27.001', 0.0);
sql insert into ct1 values ('2022-05-01 18:30:27.001', 0.0);
...
...
tests/script/
general
/insert/insert_drop.sim
→
tests/script/
tsim
/insert/insert_drop.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$tbNum = 10
$tbNum = 10
...
@@ -19,7 +15,7 @@ $stb = stb
...
@@ -19,7 +15,7 @@ $stb = stb
sql drop database $db -x step1
sql drop database $db -x step1
step1:
step1:
sql create database $db
ctime 30
sql create database $db
print ====== create tables
print ====== create tables
sql use $db
sql use $db
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
...
@@ -43,13 +39,9 @@ print ====== tables created
...
@@ -43,13 +39,9 @@ print ====== tables created
print ================== restart server to commit data into disk
print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
print ================== server restart completed
sql reset query cache
sleep 1000
sql use $db
sql use $db
sql drop table tb5
sql drop table tb5
$i = 0
$i = 0
...
@@ -69,13 +61,9 @@ endw
...
@@ -69,13 +61,9 @@ endw
print ================== restart server to commit data into disk
print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
print ================== server restart completed
print ================== server restart completed
sql reset query cache
sleep 1000
sql use $db
sql use $db
sql create table tb5 using $stb tags(5)
sql create table tb5 using $stb tags(5)
...
...
tests/script/tsim/insert/null.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 50
sql connect
sql connect
print =============== create database
print =============== create database
...
@@ -211,66 +210,48 @@ endi
...
@@ -211,66 +210,48 @@ endi
#===================================================================
#===================================================================
#print =============== query data from stb
#print =============== query data from stb
#sql select * from stb
sql select * from stb
#print ===>
print ===>
#print ===> rows: $rows
print ===> rows: $rows
#print ===> rows0: $data00 $data01 $data02 $data03 $data04
print ===> rows0: $data00 $data01 $data02 $data03 $data04
#if $rows != 4 then
if $rows != 12 then
# return -1
return -1
#endi
endi
#print =============== select count(*) from supter table
#print =============== select count(*) from supter table
#
sql select count(*) from stb
sql select count(*) from stb
#
print $data00 $data01 $data02
print $data00 $data01 $data02
#
if $rows != 1 then
if $rows != 1 then
#
return -1
return -1
#
endi
endi
#
if $data00 != 12 then
if $data00 != 12 then
#
return -1
return -1
#
endi
endi
#print =============== select count(column) from supter table
#print =============== select count(column) from supter table
#
sql select count(ts), count(c1), count(c2), count(c3) from stb
sql select count(ts), count(c1), count(c2), count(c3) from stb
#
print $data00 $data01 $data02 $data03
print $data00 $data01 $data02 $data03
#
if $data00 != 12 then
if $data00 != 12 then
#
return -1
return -1
#
endi
endi
#
if $data01 != 8 then
if $data01 != 8 then
#
return -1
return -1
#
endi
endi
#
if $data02 != 8 then
if $data02 != 8 then
#
return -1
return -1
#
endi
endi
#
if $data03 != 8 then
if $data03 != 8 then
#
return -1
return -1
#
endi
endi
#===================================================================
#===================================================================
#===================================================================
print =============== stop and restart taosd, then again do query above
print =============== stop and restart taosd, then again do query above
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
print ===> waiting dnode ready
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
#===================================================================
#===================================================================
#===================================================================
print =============== query data from child table
print =============== query data from child table
sql select * from ct1
sql select * from ct1
print ===> select * from ct1
print ===> select * from ct1
...
@@ -292,15 +273,15 @@ endi
...
@@ -292,15 +273,15 @@ endi
if $data03 != 3.000000000 then
if $data03 != 3.000000000 then
return -1
return -1
endi
endi
#if $data41 != -14
then
if $data41 != 12
then
#
return -1
return -1
#
endi
endi
#if $data42 != -2.4
0000 then
if $data42 != 2.2
0000 then
#
return -1
return -1
#
endi
endi
#if $data43 != -3.400000000
then
if $data43 != NULL
then
#
return -1
return -1
#
endi
endi
print =============== select count(*) from child table
print =============== select count(*) from child table
sql select count(*) from ct1
sql select count(*) from ct1
...
@@ -435,40 +416,39 @@ if $data92 != 3.600000000 then
...
@@ -435,40 +416,39 @@ if $data92 != 3.600000000 then
return -1
return -1
endi
endi
#===================================================================
#===================================================================
#===================================================================
#
print =============== query data from stb
print =============== query data from stb
#
sql select * from stb
sql select * from stb
#
print ===>
print ===>
#
print ===> rows: $rows
print ===> rows: $rows
#
print ===> rows0: $data00 $data01 $data02 $data03 $data04
print ===> rows0: $data00 $data01 $data02 $data03 $data04
#if $rows != 4
then
if $rows != 12
then
#
return -1
return -1
#
endi
endi
#
print =============== select count(*) from supter table
print =============== select count(*) from supter table
#
sql select count(*) from stb
sql select count(*) from stb
#
print $data00 $data01 $data02
print $data00 $data01 $data02
#
if $rows != 1 then
if $rows != 1 then
#
return -1
return -1
#
endi
endi
#
if $data00 != 12 then
if $data00 != 12 then
#
return -1
return -1
#
endi
endi
#
print =============== select count(column) from supter table
print =============== select count(column) from supter table
#
sql select count(ts), count(c1), count(c2), count(c3) from stb
sql select count(ts), count(c1), count(c2), count(c3) from stb
#
print $data00 $data01 $data02 $data03
print $data00 $data01 $data02 $data03
#
if $data00 != 12 then
if $data00 != 12 then
#
return -1
return -1
#
endi
endi
#
if $data01 != 8 then
if $data01 != 8 then
#
return -1
return -1
#
endi
endi
#
if $data02 != 8 then
if $data02 != 8 then
#
return -1
return -1
#
endi
endi
#
if $data03 != 8 then
if $data03 != 8 then
#
return -1
return -1
#
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
tests/script/
general
/insert/query_block1_file.sim
→
tests/script/
tsim
/insert/query_block1_file.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -190,7 +185,7 @@ clear:
...
@@ -190,7 +185,7 @@ clear:
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/insert/query_block1_memory.sim
→
tests/script/
tsim
/insert/query_block1_memory.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -175,7 +170,7 @@ clear:
...
@@ -175,7 +170,7 @@ clear:
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/insert/query_block2_file.sim
→
tests/script/
tsim
/insert/query_block2_file.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -19,15 +14,7 @@ sql drop database -x step1
...
@@ -19,15 +14,7 @@ sql drop database -x step1
step1:
step1:
sql create database $db
sql create database $db
sql use $db
sql use $db
sql create table $tb (ts timestamp, speed int)
$x = 0
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $tb (ts timestamp, speed int) -x create1
#commit to file will trigger if insert 82 rows
#commit to file will trigger if insert 82 rows
$N = 82
$N = 82
...
@@ -204,7 +191,7 @@ clear:
...
@@ -204,7 +191,7 @@ clear:
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/insert/query_block2_memory.sim
→
tests/script/
tsim
/insert/query_block2_memory.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -167,7 +162,7 @@ endi
...
@@ -167,7 +162,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/insert/query_file_memory.sim
→
tests/script/
tsim
/insert/query_file_memory.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -20,14 +15,7 @@ step1:
...
@@ -20,14 +15,7 @@ step1:
sql create database $db
sql create database $db
sql use $db
sql use $db
$x = 0
sql create table $tb (ts timestamp, speed int)
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $tb (ts timestamp, speed int) -x create1
#commit to file will trigger if insert 82 rows
#commit to file will trigger if insert 82 rows
...
@@ -202,7 +190,7 @@ clear:
...
@@ -202,7 +190,7 @@ clear:
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/insert/query_multi_file.sim
→
tests/script/
tsim
/insert/query_multi_file.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -20,14 +15,7 @@ step1:
...
@@ -20,14 +15,7 @@ step1:
sql create database $db
sql create database $db
sql use $db
sql use $db
$x = 0
sql create table $tb (ts timestamp, speed int)
create1:
$x = $x + 1
sleep 1000
if $x == 20 then
return -1
endi
sql create table $tb (ts timestamp, speed int) -x create1
$N = 20000
$N = 20000
...
@@ -49,7 +37,7 @@ endi
...
@@ -49,7 +37,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/insert/tcp.sim
→
tests/script/
tsim
/insert/tcp.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c
walLevel -v
1
system sh/cfg.sh -n dnode1 -c
debugflag -v 13
1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
sql create database d1;
sql create database d1;
...
...
tests/script/tsim/stream/sliding.sim
浏览文件 @
918df89b
...
@@ -239,5 +239,131 @@ if $data32 != 6 then
...
@@ -239,5 +239,131 @@ if $data32 != 6 then
goto loop0
goto loop0
endi
endi
print step 4
sql create database test1 vgroups 1
sql use test1
sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create stream streams11 trigger at_once into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s, 5s);
sql create stream streams12 trigger at_once into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s, 5s);
sql insert into t1 values(1648791213000,1,2,3,1.0);
sql insert into t1 values(1648791223001,2,2,3,1.1);
sql insert into t1 values(1648791233002,3,2,3,2.1);
sql insert into t1 values(1648791243003,4,2,3,3.1);
sql insert into t1 values(1648791213004,4,2,3,4.1);
sql insert into t2 values(1648791213000,1,2,3,1.0);
sql insert into t2 values(1648791223001,2,2,3,1.1);
sql insert into t2 values(1648791233002,3,2,3,2.1);
sql insert into t2 values(1648791243003,4,2,3,3.1);
sql insert into t2 values(1648791213004,4,2,3,4.1);
$loop_count = 0
loop1:
sleep 300
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sql select * from streamt
# row 0
if $data01 != 2 then
print =====data01=$data01
goto loop1
endi
if $data02 != 5 then
print =====data02=$data02
goto loop1
endi
# row 1
if $data11 != 1 then
print =====data11=$data11
goto loop1
endi
if $data12 != 2 then
print =====data12=$data12
goto loop1
endi
# row 2
if $data21 != 1 then
print =====data21=$data21
goto loop1
endi
if $data22 != 3 then
print =====data22=$data22
goto loop1
endi
# row 3
if $data31 != 1 then
print =====data31=$data31
goto loop1
endi
if $data32 != 4 then
print =====data32=$data32
goto loop1
endi
print step 5
sql select * from streamt2
# row 0
if $data01 != 4 then
print =====data01=$data01
goto loop1
endi
if $data02 != 10 then
print =====data02=$data02
goto loop1
endi
# row 1
if $data11 != 2 then
print =====data11=$data11
goto loop1
endi
if $data12 != 4 then
print =====data12=$data12
goto loop1
endi
# row 2
if $data21 != 2 then
print =====data21=$data21
goto loop1
endi
if $data22 != 6 then
print =====data22=$data22
goto loop1
endi
# row 3
if $data31 != 2 then
print =====data31=$data31
goto loop1
endi
if $data32 != 8 then
print =====data32=$data32
goto loop1
endi
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
\ No newline at end of file
tests/script/
general
/table/autocreate.sim
→
tests/script/
tsim
/table/autocreate.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
print =============== create database
print =============== create database
sql create database db
sql create database db
sql show databases
sql show databases
if $rows !=
1
then
if $rows !=
3
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/back_insert.sim
→
tests/script/
tsim
/table/back_insert.sim
浏览文件 @
918df89b
文件已移动
tests/script/tsim/table/basic1.sim
浏览文件 @
918df89b
...
@@ -213,23 +213,6 @@ endi
...
@@ -213,23 +213,6 @@ endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
print =============== query data
print =============== query data
sql select * from c1
sql select * from c1
print rows: $rows
print rows: $rows
...
...
tests/script/
general
/table/basic2.sim
→
tests/script/
tsim
/table/basic2.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
print =============== one table
print =============== one table
...
@@ -21,11 +20,11 @@ endi
...
@@ -21,11 +20,11 @@ endi
print =============== show
print =============== show
sql show databases
sql show databases
if $data
0
2 != 2 then
if $data
2
2 != 2 then
return -1
return -1
endi
endi
if $data
03
!= 1 then
if $data
24
!= 1 then
return -1
return -1
endi
endi
...
@@ -34,7 +33,7 @@ if $data00 != 2 then
...
@@ -34,7 +33,7 @@ if $data00 != 2 then
return -1
return -1
endi
endi
if $data01 !=
2
then
if $data01 !=
d1
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/basic3.sim
→
tests/script/
tsim
/table/basic3.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
print =============== create database
print =============== create database
sql create database db
sql create database db
sql show databases
sql show databases
if $rows !=
1
then
if $rows !=
3
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/bigint.sim
→
tests/script/
tsim
/table/bigint.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -66,7 +63,7 @@ endi
...
@@ -66,7 +63,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/binary.sim
→
tests/script/
tsim
/table/binary.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -56,7 +53,7 @@ endi
...
@@ -56,7 +53,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/bool.sim
→
tests/script/
tsim
/table/bool.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -85,7 +82,7 @@ endi
...
@@ -85,7 +82,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/column2.sim
→
tests/script/
tsim
/table/column2.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
print =============== step1
print =============== step1
...
@@ -19,7 +16,7 @@ endi
...
@@ -19,7 +16,7 @@ endi
sql drop database db
sql drop database db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/column_name.sim
→
tests/script/
tsim
/table/column_name.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -79,7 +76,7 @@ endi
...
@@ -79,7 +76,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/column_num.sim
→
tests/script/
tsim
/table/column_num.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -78,7 +75,7 @@ endi
...
@@ -78,7 +75,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/column_value.sim
→
tests/script/
tsim
/table/column_value.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -68,7 +65,7 @@ endi
...
@@ -68,7 +65,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/createmulti.sim
→
tests/script/
tsim
/table/createmulti.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect
sql connect
print =============== create database
print =============== create database
sql create database db
sql create database db
sql show databases
sql show databases
if $rows !=
1
then
if $rows !=
3
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/date.sim
→
tests/script/
tsim
/table/date.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -27,18 +24,18 @@ if $data00 != @17-01-01 08:00:00.001@ then
...
@@ -27,18 +24,18 @@ if $data00 != @17-01-01 08:00:00.001@ then
endi
endi
print =============== step2
print =============== step2
sql insert into $tb values ('2017-08-28 00:23:46.429+ 1a', 2)
sql
_error
insert into $tb values ('2017-08-28 00:23:46.429+ 1a', 2)
#sql
insert into $tb values ('2017-08-28 00:23:46cd .429', 2)
sql_error
insert into $tb values ('2017-08-28 00:23:46cd .429', 2)
sql select ts from $tb
sql select ts from $tb
if $rows !=
2
then
if $rows !=
1
then
return -1
return -1
endi
endi
print =============== step3
print =============== step3
#sql
insert into $tb values ('1970-01-01 08:00:00.000', 3)
sql_error
insert into $tb values ('1970-01-01 08:00:00.000', 3)
#sql
insert into $tb values ('1970-01-01 08:00:00.000', 3)
sql_error
insert into $tb values ('1970-01-01 08:00:00.000', 3)
sql select ts from $tb
sql select ts from $tb
if $rows !=
2
then
if $rows !=
1
then
return -1
return -1
endi
endi
...
@@ -57,7 +54,7 @@ print =============== step5
...
@@ -57,7 +54,7 @@ print =============== step5
sql_error insert into $tb values ('9999-12-31 213:59:59.999', 13)
sql_error insert into $tb values ('9999-12-31 213:59:59.999', 13)
sql select ts from $tb
sql select ts from $tb
print $rows
print $rows
if $rows !=
8
then
if $rows !=
7
then
return -1
return -1
endi
endi
...
@@ -65,7 +62,7 @@ print =============== step6
...
@@ -65,7 +62,7 @@ print =============== step6
sql_error insert into $tb values ('9999-12-99 23:59:59.999', 13)
sql_error insert into $tb values ('9999-12-99 23:59:59.999', 13)
sql select ts from $tb
sql select ts from $tb
if $rows !=
8
then
if $rows !=
7
then
return -1
return -1
endi
endi
...
@@ -83,7 +80,7 @@ endi
...
@@ -83,7 +80,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/db.table.sim
→
tests/script/
tsim
/table/db.table.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -40,7 +37,7 @@ sql drop table $table
...
@@ -40,7 +37,7 @@ sql drop table $table
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/delete_reuse1.sim
→
tests/script/
tsim
/table/delete_reuse1.sim
浏览文件 @
918df89b
文件已移动
tests/script/
general
/table/delete_reuse2.sim
→
tests/script/
tsim
/table/delete_reuse2.sim
浏览文件 @
918df89b
文件已移动
tests/script/
general
/table/delete_writing.sim
→
tests/script/
tsim
/table/delete_writing.sim
浏览文件 @
918df89b
文件已移动
tests/script/
general
/table/describe.sim
→
tests/script/
tsim
/table/describe.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -42,7 +39,7 @@ endi
...
@@ -42,7 +39,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/double.sim
→
tests/script/
tsim
/table/double.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -91,7 +88,7 @@ endi
...
@@ -91,7 +88,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/float.sim
→
tests/script/
tsim
/table/float.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -91,7 +88,7 @@ endi
...
@@ -91,7 +88,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/int.sim
→
tests/script/
tsim
/table/int.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -27,12 +24,10 @@ if $data01 != NULL then
...
@@ -27,12 +24,10 @@ if $data01 != NULL then
endi
endi
print =============== step2
print =============== step2
sql insert into $tb values (now+1m, -2147483648) -x step2
sql insert into $tb values (now+1m, -2147483648)
return -1
sql insert into $tb values (now+2m, NULL)
step2:
sql insert into $tb values (now+1m, NULL)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
2
then
if $rows !=
3
then
return -1
return -1
endi
endi
if $data01 != NULL then
if $data01 != NULL then
...
@@ -40,9 +35,9 @@ if $data01 != NULL then
...
@@ -40,9 +35,9 @@ if $data01 != NULL then
endi
endi
print =============== step3
print =============== step3
sql insert into $tb values (now+
2
m, 2147483647)
sql insert into $tb values (now+
3
m, 2147483647)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
3
then
if $rows !=
4
then
return -1
return -1
endi
endi
if $data01 != 2147483647 then
if $data01 != 2147483647 then
...
@@ -50,12 +45,10 @@ if $data01 != 2147483647 then
...
@@ -50,12 +45,10 @@ if $data01 != 2147483647 then
endi
endi
print =============== step4
print =============== step4
sql insert into $tb values (now+3m, 2147483648) -x step4
sql_error insert into $tb values (now+4m, 2147483648)
return -1
sql insert into $tb values (now+5m, NULL)
step4:
sql insert into $tb values (now+3m, NULL)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
4
then
if $rows !=
5
then
return -1
return -1
endi
endi
if $data01 != NULL then
if $data01 != NULL then
...
@@ -63,10 +56,10 @@ if $data01 != NULL then
...
@@ -63,10 +56,10 @@ if $data01 != NULL then
endi
endi
print =============== step5
print =============== step5
sql_error insert into $tb values (now+
4
m, a2)
sql_error insert into $tb values (now+
6
m, a2)
sql insert into $tb values (now+
4
m, 0)
sql insert into $tb values (now+
7
m, 0)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
5
then
if $rows !=
6
then
return -1
return -1
endi
endi
if $data01 != 0 then
if $data01 != 0 then
...
@@ -74,10 +67,10 @@ if $data01 != 0 then
...
@@ -74,10 +67,10 @@ if $data01 != 0 then
endi
endi
print =============== step6
print =============== step6
sql_error insert into $tb values (now+
5
m, 2a)
sql_error insert into $tb values (now+
8
m, 2a)
sql insert into $tb values (now+
5
m, 2)
sql insert into $tb values (now+
9
m, 2)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
6
then
if $rows !=
7
then
return -1
return -1
endi
endi
if $data01 != 2 then
if $data01 != 2 then
...
@@ -85,10 +78,10 @@ if $data01 != 2 then
...
@@ -85,10 +78,10 @@ if $data01 != 2 then
endi
endi
print =============== step7
print =============== step7
sql_error insert into $tb values (now+
6
m, 2a'1)
sql_error insert into $tb values (now+
10
m, 2a'1)
sql insert into $tb values (now+
6
m, 2)
sql insert into $tb values (now+
11
m, 2)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
7
then
if $rows !=
8
then
return -1
return -1
endi
endi
if $data01 != 2 then
if $data01 != 2 then
...
@@ -96,9 +89,9 @@ if $data01 != 2 then
...
@@ -96,9 +89,9 @@ if $data01 != 2 then
endi
endi
print =============== step8
print =============== step8
sql insert into $tb values (now+
8
m, "NULL")
sql insert into $tb values (now+
12
m, "NULL")
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
8
then
if $rows !=
9
then
return -1
return -1
endi
endi
if $data01 != NULL then
if $data01 != NULL then
...
@@ -106,9 +99,9 @@ if $data01 != NULL then
...
@@ -106,9 +99,9 @@ if $data01 != NULL then
endi
endi
print =============== step9
print =============== step9
sql insert into $tb values (now+
9
m, 'NULL')
sql insert into $tb values (now+
13
m, 'NULL')
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
9
then
if $rows !=
10
then
return -1
return -1
endi
endi
if $data01 != NULL then
if $data01 != NULL then
...
@@ -116,9 +109,9 @@ if $data01 != NULL then
...
@@ -116,9 +109,9 @@ if $data01 != NULL then
endi
endi
print =============== step10
print =============== step10
sql insert into $tb values (now+1
0
m, -123)
sql insert into $tb values (now+1
4
m, -123)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows != 1
0
then
if $rows != 1
1
then
return -1
return -1
endi
endi
if $data01 != -123 then
if $data01 != -123 then
...
@@ -127,7 +120,7 @@ endi
...
@@ -127,7 +120,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/limit.sim
→
tests/script/
tsim
/table/limit.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 129
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 8
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
print ============================ dnode1 start
print ============================ dnode1 start
...
@@ -17,10 +12,10 @@ $db = $dbPrefix . $i
...
@@ -17,10 +12,10 @@ $db = $dbPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
print =================== step 0
print =================== step 0
sql create database $db
sql create database $db
vgroups 8
sql use $db
sql use $db
sql show vgroups
sql show vgroups
if $rows !=
0
then
if $rows !=
8
then
return -1
return -1
endi
endi
...
@@ -87,7 +82,7 @@ endi
...
@@ -87,7 +82,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/smallint.sim
→
tests/script/
tsim
/table/smallint.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -28,12 +25,10 @@ if $data01 != NULL then
...
@@ -28,12 +25,10 @@ if $data01 != NULL then
endi
endi
print =============== step2
print =============== step2
sql insert into $tb values (now+1m, -32768) -x step2
sql insert into $tb values (now+1m, -32768)
return -1
sql insert into $tb values (now+2m, NULL)
step2:
sql insert into $tb values (now+1m, NULL)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
2
then
if $rows !=
3
then
return -1
return -1
endi
endi
if $data01 != NULL then
if $data01 != NULL then
...
@@ -41,9 +36,9 @@ if $data01 != NULL then
...
@@ -41,9 +36,9 @@ if $data01 != NULL then
endi
endi
print =============== step3
print =============== step3
sql insert into $tb values (now+
2
m, 32767)
sql insert into $tb values (now+
3
m, 32767)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
3
then
if $rows !=
4
then
return -1
return -1
endi
endi
if $data01 != 32767 then
if $data01 != 32767 then
...
@@ -51,12 +46,12 @@ if $data01 != 32767 then
...
@@ -51,12 +46,12 @@ if $data01 != 32767 then
endi
endi
print =============== step4
print =============== step4
sql insert into $tb values (now+
3
m, 32768) -x step4
sql insert into $tb values (now+
4
m, 32768) -x step4
return -1
return -1
step4:
step4:
sql insert into $tb values (now+
3
m, NULL)
sql insert into $tb values (now+
5
m, NULL)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
4
then
if $rows !=
5
then
return -1
return -1
endi
endi
if $data01 != NULL then
if $data01 != NULL then
...
@@ -64,10 +59,10 @@ if $data01 != NULL then
...
@@ -64,10 +59,10 @@ if $data01 != NULL then
endi
endi
print =============== step5
print =============== step5
sql_error insert into $tb values (now+
4
m, a2)
sql_error insert into $tb values (now+
6
m, a2)
sql insert into $tb values (now+
4
m, 0)
sql insert into $tb values (now+
7
m, 0)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
5
then
if $rows !=
6
then
return -1
return -1
endi
endi
if $data01 != 0 then
if $data01 != 0 then
...
@@ -75,10 +70,10 @@ if $data01 != 0 then
...
@@ -75,10 +70,10 @@ if $data01 != 0 then
endi
endi
print =============== step6
print =============== step6
sql_error insert into $tb values (now+
5
m, 2a)
sql_error insert into $tb values (now+
8
m, 2a)
sql insert into $tb values (now+
5
m, 2)
sql insert into $tb values (now+
9
m, 2)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
6
then
if $rows !=
7
then
return -1
return -1
endi
endi
if $data01 != 2 then
if $data01 != 2 then
...
@@ -86,19 +81,19 @@ if $data01 != 2 then
...
@@ -86,19 +81,19 @@ if $data01 != 2 then
endi
endi
print =============== step7
print =============== step7
sql_error insert into $tb values (now+
6
m, 2a'1)
sql_error insert into $tb values (now+
10
m, 2a'1)
sql insert into $tb values (now+
6
m, 2)
sql insert into $tb values (now+
11
m, 2)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
7
then
if $rows !=
8
then
return -1
return -1
endi
endi
if $data01 != 2 then
if $data01 != 2 then
return -1
return -1
endi
endi
return
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/table.sim
→
tests/script/
tsim
/table/table.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
print ============================ dnode1 start
print ============================ dnode1 start
...
@@ -200,16 +197,15 @@ if $data01 != 7 then
...
@@ -200,16 +197,15 @@ if $data01 != 7 then
endi
endi
print =============== step10
print =============== step10
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql create table $tb (ts timestamp, val tinyint, val2 tinyint)
sql
_error
create table $tb (ts timestamp, val tinyint, val2 tinyint)
sql show tables
sql show tables
if $rows != 7 then
if $rows != 7 then
return -1
return -1
endi
endi
print =============== step11
print =============== step11
sql create table $tb (ts timestamp, val float, val2 double)
sql
_error
create table $tb (ts timestamp, val float, val2 double)
sql show tables
sql show tables
if $rows != 7 then
if $rows != 7 then
return -1
return -1
...
@@ -217,7 +213,7 @@ endi
...
@@ -217,7 +213,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/table_len.sim
→
tests/script/
tsim
/table/table_len.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -98,7 +95,7 @@ step8:
...
@@ -98,7 +95,7 @@ step8:
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/tinyint.sim
→
tests/script/
tsim
/table/tinyint.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
$i = 0
$i = 0
...
@@ -27,12 +24,10 @@ if $data01 != NULL then
...
@@ -27,12 +24,10 @@ if $data01 != NULL then
endi
endi
print =============== step2
print =============== step2
sql insert into $tb values (now+1m, -128) -x step2
sql insert into $tb values (now+1m, -128)
return -1
sql insert into $tb values (now+2m, NULL)
step2:
sql insert into $tb values (now+1m, NULL)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
2
then
if $rows !=
3
then
return -1
return -1
endi
endi
if $data01 != NULL then
if $data01 != NULL then
...
@@ -40,9 +35,9 @@ if $data01 != NULL then
...
@@ -40,9 +35,9 @@ if $data01 != NULL then
endi
endi
print =============== step3
print =============== step3
sql insert into $tb values (now+
2
m, 127)
sql insert into $tb values (now+
3
m, 127)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
3
then
if $rows !=
4
then
return -1
return -1
endi
endi
if $data01 != 127 then
if $data01 != 127 then
...
@@ -50,12 +45,12 @@ if $data01 != 127 then
...
@@ -50,12 +45,12 @@ if $data01 != 127 then
endi
endi
print =============== step4
print =============== step4
sql insert into $tb values (now+
3
m, 128) -x step4
sql insert into $tb values (now+
4
m, 128) -x step4
return -1
return -1
step4:
step4:
sql insert into $tb values (now+
3
m, NULL)
sql insert into $tb values (now+
5
m, NULL)
sql select * from $tb
sql select * from $tb
if $rows !=
4
then
if $rows !=
5
then
return -1
return -1
endi
endi
if $data01 != NULL then
if $data01 != NULL then
...
@@ -63,10 +58,10 @@ if $data01 != NULL then
...
@@ -63,10 +58,10 @@ if $data01 != NULL then
endi
endi
print =============== step5
print =============== step5
sql_error insert into $tb values (now+
4
m, a2)
sql_error insert into $tb values (now+
6
m, a2)
sql insert into $tb values (now+
4
m, 0)
sql insert into $tb values (now+
7
m, 0)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
5
then
if $rows !=
6
then
return -1
return -1
endi
endi
if $data01 != 0 then
if $data01 != 0 then
...
@@ -74,10 +69,10 @@ if $data01 != 0 then
...
@@ -74,10 +69,10 @@ if $data01 != 0 then
endi
endi
print =============== step6
print =============== step6
sql_error insert into $tb values (now+
5
m, 2a)
sql_error insert into $tb values (now+
8
m, 2a)
sql insert into $tb values (now+
5
m, 2)
sql insert into $tb values (now+
9
m, 2)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
6
then
if $rows !=
7
then
return -1
return -1
endi
endi
if $data01 != 2 then
if $data01 != 2 then
...
@@ -85,10 +80,10 @@ if $data01 != 2 then
...
@@ -85,10 +80,10 @@ if $data01 != 2 then
endi
endi
print =============== step7
print =============== step7
sql_error insert into $tb values (now+
6
m, 2a'1)
sql_error insert into $tb values (now+
10
m, 2a'1)
sql insert into $tb values (now+
6
m, 2)
sql insert into $tb values (now+
11
m, 2)
sql select * from $tb order by ts desc
sql select * from $tb order by ts desc
if $rows !=
7
then
if $rows !=
8
then
return -1
return -1
endi
endi
if $data01 != 2 then
if $data01 != 2 then
...
@@ -97,7 +92,7 @@ endi
...
@@ -97,7 +92,7 @@ endi
sql drop database $db
sql drop database $db
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/
general
/table/vgroup.sim
→
tests/script/
tsim
/table/vgroup.sim
浏览文件 @
918df89b
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sleep 2000
sql connect
sql connect
print ============================ dnode1 start
print ============================ dnode1 start
$i = 0
$i = 0
...
@@ -16,10 +12,10 @@ $db = $dbPrefix . $i
...
@@ -16,10 +12,10 @@ $db = $dbPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
print =================== step 1
print =================== step 1
sql create database $db
sql create database $db
vgroups 4
sql use $db
sql use $db
sql show vgroups
sql show vgroups
if $rows !=
0
then
if $rows !=
4
then
return -1
return -1
endi
endi
...
@@ -28,7 +24,7 @@ sql create table table2 (ts timestamp, speed int)
...
@@ -28,7 +24,7 @@ sql create table table2 (ts timestamp, speed int)
sql create table table3 (ts timestamp, speed int)
sql create table table3 (ts timestamp, speed int)
sql create table table4 (ts timestamp, speed int)
sql create table table4 (ts timestamp, speed int)
sql show vgroups
sql show vgroups
if $rows !=
1
then
if $rows !=
4
then
return -1
return -1
endi
endi
...
@@ -37,7 +33,7 @@ sql create table table6 (ts timestamp, speed int)
...
@@ -37,7 +33,7 @@ sql create table table6 (ts timestamp, speed int)
sql create table table7 (ts timestamp, speed int)
sql create table table7 (ts timestamp, speed int)
sql create table table8 (ts timestamp, speed int)
sql create table table8 (ts timestamp, speed int)
sql show vgroups
sql show vgroups
if $rows !=
2
then
if $rows !=
4
then
return -1
return -1
endi
endi
...
@@ -46,7 +42,7 @@ sql create table table10 (ts timestamp, speed int)
...
@@ -46,7 +42,7 @@ sql create table table10 (ts timestamp, speed int)
sql create table table11 (ts timestamp, speed int)
sql create table table11 (ts timestamp, speed int)
sql create table table12 (ts timestamp, speed int)
sql create table table12 (ts timestamp, speed int)
sql show vgroups
sql show vgroups
if $rows !=
3
then
if $rows !=
4
then
return -1
return -1
endi
endi
...
@@ -58,7 +54,7 @@ endi
...
@@ -58,7 +54,7 @@ endi
sql drop table table13
sql drop table table13
sql show vgroups
sql show vgroups
if $rows !=
3
then
if $rows !=
4
then
return -1
return -1
endi
endi
...
@@ -72,10 +68,10 @@ print =================== step 2
...
@@ -72,10 +68,10 @@ print =================== step 2
$i = 1
$i = 1
$db = $dbPrefix . $i
$db = $dbPrefix . $i
sql create database $db
sql create database $db
vgroups 2
sql use $db
sql use $db
sql show vgroups
sql show vgroups
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
@@ -88,13 +84,13 @@ $db = $dbPrefix . $i
...
@@ -88,13 +84,13 @@ $db = $dbPrefix . $i
sql use $db
sql use $db
sql create table table2 (ts timestamp, speed int)
sql create table table2 (ts timestamp, speed int)
sql show vgroups
sql show vgroups
if $rows !=
1
then
if $rows !=
2
then
return -1
return -1
endi
endi
sql drop table table2
sql drop table table2
sql show vgroups
sql show vgroups
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
@@ -104,7 +100,7 @@ sql create table table3 (ts timestamp, speed int)
...
@@ -104,7 +100,7 @@ sql create table table3 (ts timestamp, speed int)
sql create table table4 (ts timestamp, speed int)
sql create table table4 (ts timestamp, speed int)
sql drop table table1
sql drop table table1
sql show vgroups
sql show vgroups
if $rows !=
1
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
@@ -133,7 +129,7 @@ sql create database $db
...
@@ -133,7 +129,7 @@ sql create database $db
sql use $db
sql use $db
sql show databases
sql show databases
if $rows !=
5
then
if $rows !=
7
then
return -1
return -1
endi
endi
...
@@ -144,7 +140,7 @@ while $i < 5
...
@@ -144,7 +140,7 @@ while $i < 5
$i = $i + 1
$i = $i + 1
endw
endw
sql show databases
sql show databases
if $rows !=
0
then
if $rows !=
2
then
return -1
return -1
endi
endi
...
...
tests/script/tsim/tag/bigint.sim
浏览文件 @
918df89b
...
@@ -46,7 +46,6 @@ while $i < 10
...
@@ -46,7 +46,6 @@ while $i < 10
endw
endw
print =============== step2
print =============== step2
sleep 100
sql select * from $tb
sql select * from $tb
if $rows != $rowNum then
if $rows != $rowNum then
return -1
return -1
...
...
tests/script/tsim/tag/binary.sim
浏览文件 @
918df89b
...
@@ -46,7 +46,6 @@ while $i < 10
...
@@ -46,7 +46,6 @@ while $i < 10
endw
endw
print =============== step2
print =============== step2
sleep 100
sql select * from $tb
sql select * from $tb
if $rows != $rowNum then
if $rows != $rowNum then
return -1
return -1
...
...
tests/script/tsim/tag/bool.sim
浏览文件 @
918df89b
...
@@ -46,7 +46,6 @@ while $i < 10
...
@@ -46,7 +46,6 @@ while $i < 10
endw
endw
print =============== step2
print =============== step2
sleep 100
sql select * from $tb
sql select * from $tb
if $rows != $rowNum then
if $rows != $rowNum then
return -1
return -1
...
...
tests/script/tsim/tag/double.sim
浏览文件 @
918df89b
...
@@ -46,7 +46,6 @@ while $i < 10
...
@@ -46,7 +46,6 @@ while $i < 10
endw
endw
print =============== step2
print =============== step2
sleep 100
sql select * from $tb
sql select * from $tb
if $rows != $rowNum then
if $rows != $rowNum then
return -1
return -1
...
...
tests/script/tsim/tag/float.sim
浏览文件 @
918df89b
...
@@ -46,7 +46,6 @@ while $i < 10
...
@@ -46,7 +46,6 @@ while $i < 10
endw
endw
print =============== step2
print =============== step2
sleep 100
sql select * from $tb
sql select * from $tb
if $rows != $rowNum then
if $rows != $rowNum then
return -1
return -1
...
...
tests/script/tsim/tag/int.sim
浏览文件 @
918df89b
...
@@ -46,7 +46,6 @@ while $i < 10
...
@@ -46,7 +46,6 @@ while $i < 10
endw
endw
print =============== step2
print =============== step2
sleep 100
sql select * from $tb
sql select * from $tb
if $rows != $rowNum then
if $rows != $rowNum then
return -1
return -1
...
...
tests/script/tsim/tag/smallint.sim
浏览文件 @
918df89b
...
@@ -46,7 +46,6 @@ while $i < 10
...
@@ -46,7 +46,6 @@ while $i < 10
endw
endw
print =============== step2
print =============== step2
sleep 100
sql select * from $tb
sql select * from $tb
if $rows != $rowNum then
if $rows != $rowNum then
return -1
return -1
...
...
tests/script/tsim/tag/tinyint.sim
浏览文件 @
918df89b
...
@@ -46,7 +46,6 @@ while $i < 10
...
@@ -46,7 +46,6 @@ while $i < 10
endw
endw
print =============== step2
print =============== step2
sleep 100
sql select * from $tb
sql select * from $tb
if $rows != $rowNum then
if $rows != $rowNum then
return -1
return -1
...
...
tests/script/tsim/vector/metrics_field.sim
浏览文件 @
918df89b
...
@@ -41,8 +41,6 @@ while $i < $tbNum
...
@@ -41,8 +41,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/vector/metrics_mix.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/vector/metrics_query.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/vector/metrics_tag.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/vector/metrics_time.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/vector/multi.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/vector/single.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/vector/table_field.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/vector/table_mix.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/vector/table_query.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/script/tsim/vector/table_time.sim
浏览文件 @
918df89b
...
@@ -37,8 +37,6 @@ while $i < $tbNum
...
@@ -37,8 +37,6 @@ while $i < $tbNum
$i = $i + 1
$i = $i + 1
endw
endw
sleep 100
print =============== step2
print =============== step2
$i = 1
$i = 1
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
...
...
tests/system-test/2-query/json_tag.py
浏览文件 @
918df89b
...
@@ -197,7 +197,7 @@ class TDTestCase:
...
@@ -197,7 +197,7 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
"true"
)
tdSql
.
checkData
(
0
,
0
,
"true"
)
# test select json tag->'key', value is null
# test select json tag->'key', value is null
tdSql
.
query
(
"select jtag->'tag1' from jsons1_4"
)
tdSql
.
query
(
"select jtag->'tag1' from jsons1_4"
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
0
,
"null"
)
# test select json tag->'key', value is double
# test select json tag->'key', value is double
tdSql
.
query
(
"select jtag->'tag1' from jsons1_5"
)
tdSql
.
query
(
"select jtag->'tag1' from jsons1_5"
)
tdSql
.
checkData
(
0
,
0
,
"1.232000000"
)
tdSql
.
checkData
(
0
,
0
,
"1.232000000"
)
...
@@ -394,16 +394,15 @@ class TDTestCase:
...
@@ -394,16 +394,15 @@ class TDTestCase:
# test distinct
# test distinct
tdSql
.
execute
(
"insert into jsons1_14 using jsons1 tags('{
\"
tag1
\"
:
\"
收到货
\"
,
\"
tag2
\"
:
\"\"
,
\"
tag3
\"
:null}') values(1591062628000, 2, NULL, '你就会', 'dws')"
)
tdSql
.
execute
(
"insert into jsons1_14 using jsons1 tags('{
\"
tag1
\"
:
\"
收到货
\"
,
\"
tag2
\"
:
\"\"
,
\"
tag3
\"
:null}') values(1591062628000, 2, NULL, '你就会', 'dws')"
)
tdSql
.
query
(
"select distinct jtag->'tag1' from jsons1"
)
tdSql
.
query
(
"select distinct jtag->'tag1' from jsons1"
)
tdSql
.
checkRows
(
7
)
tdSql
.
checkRows
(
8
)
# tdSql.query("select distinct jtag from jsons1")
tdSql
.
error
(
"select distinct jtag from jsons1"
)
# tdSql.checkRows(9)
#test dumplicate key with normal colomn
#test dumplicate key with normal colomn
tdSql
.
execute
(
"INSERT INTO jsons1_15 using jsons1 tags('{
\"
tbname
\"
:
\"
tt
\"
,
\"
databool
\"
:true,
\"
datastr
\"
:
\"
是是是
\"
}') values(1591060828000, 4, false, 'jjsf',
\"
你就会
\"
)"
)
tdSql
.
execute
(
"INSERT INTO jsons1_15 using jsons1 tags('{
\"
tbname
\"
:
\"
tt
\"
,
\"
databool
\"
:true,
\"
datastr
\"
:
\"
是是是
\"
}') values(1591060828000, 4, false, 'jjsf',
\"
你就会
\"
)"
)
tdSql
.
query
(
"select * from jsons1 where jtag->'datastr' match '是' and datastr match 'js'"
)
tdSql
.
query
(
"select * from jsons1 where jtag->'datastr' match '是' and datastr match 'js'"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkRows
(
1
)
# tdSql.query("select tbname,jtag->'tbname' from jsons1 where jtag->'tbname'='tt' and tbname='jsons1_14
'")
tdSql
.
query
(
"select tbname,jtag->'tbname' from jsons1 where jtag->'tbname'='tt' and tbname='jsons1_15
'"
)
#
tdSql.checkRows(1)
tdSql
.
checkRows
(
1
)
# test join
# test join
tdSql
.
execute
(
"create table if not exists jsons2(ts timestamp, dataInt int, dataBool bool, dataStr nchar(50), dataStrBin binary(150)) tags(jtag json)"
)
tdSql
.
execute
(
"create table if not exists jsons2(ts timestamp, dataInt int, dataBool bool, dataStr nchar(50), dataStrBin binary(150)) tags(jtag json)"
)
...
@@ -477,15 +476,10 @@ class TDTestCase:
...
@@ -477,15 +476,10 @@ class TDTestCase:
tdSql
.
query
(
"select top(dataint,2),jtag->'tag1' from jsons1 group by jtag->'tag1' order by jtag->'tag1'"
)
tdSql
.
query
(
"select top(dataint,2),jtag->'tag1' from jsons1 group by jtag->'tag1' order by jtag->'tag1'"
)
tdSql
.
checkRows
(
11
)
tdSql
.
checkRows
(
11
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdSql
.
checkData
(
0
,
1
,
None
)
#tdSql.checkData(2, 0, 24)
#tdSql.checkData(3, 0, 3)
#tdSql.checkData(3, 1, "false")
#tdSql.checkData(8, 0, 2)
#tdSql.checkData(10, 1, '"femail"')
# test having
# test having
#
tdSql.query("select count(*),jtag->'tag1' from jsons1 group by jtag->'tag1' having count(*) > 1")
tdSql
.
query
(
"select count(*),jtag->'tag1' from jsons1 group by jtag->'tag1' having count(*) > 1"
)
#
tdSql.checkRows(3)
tdSql
.
checkRows
(
3
)
# subquery with json tag
# subquery with json tag
tdSql
.
query
(
"select * from (select jtag, dataint from jsons1) order by dataint"
)
tdSql
.
query
(
"select * from (select jtag, dataint from jsons1) order by dataint"
)
...
@@ -495,10 +489,7 @@ class TDTestCase:
...
@@ -495,10 +489,7 @@ class TDTestCase:
tdSql
.
error
(
"select jtag->'tag1' from (select jtag->'tag1', dataint from jsons1)"
)
tdSql
.
error
(
"select jtag->'tag1' from (select jtag->'tag1', dataint from jsons1)"
)
tdSql
.
error
(
"select t->'tag1' from (select jtag->'tag1' as t, dataint from jsons1)"
)
tdSql
.
error
(
"select t->'tag1' from (select jtag->'tag1' as t, dataint from jsons1)"
)
# tdSql.query("select ts,jtag->'tag1' from (select jtag->'tag1',tbname,ts from jsons1 order by ts)")
tdSql
.
error
(
"select ts,jtag->'tag1' from (select jtag->'tag1',tbname,ts from jsons1 order by ts)"
)
# tdSql.checkRows(11)
# tdSql.checkData(1, 1, "jsons1_1")
# tdSql.checkData(1, 2, '"femail"')
# union all
# union all
tdSql
.
query
(
"select jtag->'tag1' from jsons1 union all select jtag->'tag2' from jsons2"
)
tdSql
.
query
(
"select jtag->'tag1' from jsons1 union all select jtag->'tag2' from jsons2"
)
...
...
tests/system-test/7-tmq/dataFromTsdbNWal.py
浏览文件 @
918df89b
...
@@ -38,9 +38,9 @@ class TDTestCase:
...
@@ -38,9 +38,9 @@ class TDTestCase:
'tagSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},{
'type'
:
'BIGINT'
,
'count'
:
1
},{
'type'
:
'DOUBLE'
,
'count'
:
1
},{
'type'
:
'BINARY'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'NCHAR'
,
'len'
:
32
,
'count'
:
1
}],
'tagSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},{
'type'
:
'BIGINT'
,
'count'
:
1
},{
'type'
:
'DOUBLE'
,
'count'
:
1
},{
'type'
:
'BINARY'
,
'len'
:
32
,
'count'
:
1
},{
'type'
:
'NCHAR'
,
'len'
:
32
,
'count'
:
1
}],
'ctbPrefix'
:
'ctb'
,
'ctbPrefix'
:
'ctb'
,
'ctbStartIdx'
:
0
,
'ctbStartIdx'
:
0
,
'ctbNum'
:
10
,
'ctbNum'
:
10
0
,
'rowsPerTbl'
:
10000
,
'rowsPerTbl'
:
10000
,
'batchNum'
:
1
000
,
'batchNum'
:
3
000
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
10
,
'pollDelay'
:
10
,
'showMsg'
:
1
,
'showMsg'
:
1
,
...
@@ -64,9 +64,7 @@ class TDTestCase:
...
@@ -64,9 +64,7 @@ class TDTestCase:
ctbNum
=
paraDict
[
"ctbNum"
],
rowsPerTbl
=
paraDict
[
"rowsPerTbl"
],
batchNum
=
paraDict
[
"batchNum"
],
ctbNum
=
paraDict
[
"ctbNum"
],
rowsPerTbl
=
paraDict
[
"rowsPerTbl"
],
batchNum
=
paraDict
[
"batchNum"
],
startTs
=
paraDict
[
"startTs"
],
ctbStartIdx
=
paraDict
[
'ctbStartIdx'
])
startTs
=
paraDict
[
"startTs"
],
ctbStartIdx
=
paraDict
[
'ctbStartIdx'
])
tdLog
.
info
(
"restart taosd to ensure that the data falls into the disk"
)
tdLog
.
info
(
"flush db to let data falls into the disk"
)
# tdDnodes.stop(1)
# tdDnodes.start(1)
tdSql
.
query
(
"flush database %s"
%
(
paraDict
[
'dbName'
]))
tdSql
.
query
(
"flush database %s"
%
(
paraDict
[
'dbName'
]))
return
return
...
@@ -85,7 +83,7 @@ class TDTestCase:
...
@@ -85,7 +83,7 @@ class TDTestCase:
'ctbStartIdx'
:
0
,
'ctbStartIdx'
:
0
,
'ctbNum'
:
10
,
'ctbNum'
:
10
,
'rowsPerTbl'
:
10000
,
'rowsPerTbl'
:
10000
,
'batchNum'
:
10
,
'batchNum'
:
10
0
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
3
,
'pollDelay'
:
3
,
'showMsg'
:
1
,
'showMsg'
:
1
,
...
@@ -95,8 +93,6 @@ class TDTestCase:
...
@@ -95,8 +93,6 @@ class TDTestCase:
paraDict
[
'vgroups'
]
=
self
.
vgroups
paraDict
[
'vgroups'
]
=
self
.
vgroups
paraDict
[
'ctbNum'
]
=
self
.
ctbNum
paraDict
[
'ctbNum'
]
=
self
.
ctbNum
paraDict
[
'rowsPerTbl'
]
=
self
.
rowsPerTbl
paraDict
[
'rowsPerTbl'
]
=
self
.
rowsPerTbl
paraDict
[
'batchNum'
]
=
100
paraDict
[
'startTs'
]
=
paraDict
[
'startTs'
]
+
self
.
rowsPerTbl
topicNameList
=
[
'topic1'
]
topicNameList
=
[
'topic1'
]
expectRowsList
=
[]
expectRowsList
=
[]
...
@@ -125,6 +121,8 @@ class TDTestCase:
...
@@ -125,6 +121,8 @@ class TDTestCase:
tmqCom
.
startTmqSimProcess
(
pollDelay
=
paraDict
[
'pollDelay'
],
dbName
=
paraDict
[
"dbName"
],
showMsg
=
paraDict
[
'showMsg'
],
showRow
=
paraDict
[
'showRow'
],
snapshot
=
paraDict
[
'snapshot'
])
tmqCom
.
startTmqSimProcess
(
pollDelay
=
paraDict
[
'pollDelay'
],
dbName
=
paraDict
[
"dbName"
],
showMsg
=
paraDict
[
'showMsg'
],
showRow
=
paraDict
[
'showRow'
],
snapshot
=
paraDict
[
'snapshot'
])
# after start consume, continue insert some data
# after start consume, continue insert some data
paraDict
[
'batchNum'
]
=
100
paraDict
[
'startTs'
]
=
paraDict
[
'startTs'
]
+
self
.
rowsPerTbl
tmqCom
.
insert_data_interlaceByMultiTbl
(
tsql
=
tdSql
,
dbName
=
paraDict
[
"dbName"
],
ctbPrefix
=
paraDict
[
"ctbPrefix"
],
tmqCom
.
insert_data_interlaceByMultiTbl
(
tsql
=
tdSql
,
dbName
=
paraDict
[
"dbName"
],
ctbPrefix
=
paraDict
[
"ctbPrefix"
],
ctbNum
=
paraDict
[
"ctbNum"
],
rowsPerTbl
=
paraDict
[
"rowsPerTbl"
],
batchNum
=
paraDict
[
"batchNum"
],
ctbNum
=
paraDict
[
"ctbNum"
],
rowsPerTbl
=
paraDict
[
"rowsPerTbl"
],
batchNum
=
paraDict
[
"batchNum"
],
startTs
=
paraDict
[
"startTs"
],
ctbStartIdx
=
paraDict
[
'ctbStartIdx'
])
startTs
=
paraDict
[
"startTs"
],
ctbStartIdx
=
paraDict
[
'ctbStartIdx'
])
...
@@ -137,8 +135,9 @@ class TDTestCase:
...
@@ -137,8 +135,9 @@ class TDTestCase:
expectRows
=
1
expectRows
=
1
resultList
=
tmqCom
.
selectConsumeResult
(
expectRows
)
resultList
=
tmqCom
.
selectConsumeResult
(
expectRows
)
if
expectRowsList
[
0
]
!=
resultList
[
0
]:
tdLog
.
info
(
"expect consume rows: %d, act consume rows: %d"
%
(
expectRowsList
[
0
],
resultList
[
0
]))
tdLog
.
info
(
"expect consume rows: %d, act consume rows: %d"
%
(
expectRowsList
[
0
],
resultList
[
0
]))
if
expectRowsList
[
0
]
!=
resultList
[
0
]:
tdLog
.
exit
(
"%d tmq consume rows error!"
%
consumerId
)
tdLog
.
exit
(
"%d tmq consume rows error!"
%
consumerId
)
tmqCom
.
checkFileContent
(
consumerId
,
queryString
)
tmqCom
.
checkFileContent
(
consumerId
,
queryString
)
...
...
tests/system-test/7-tmq/tmqCommon.py
浏览文件 @
918df89b
...
@@ -444,6 +444,7 @@ class TMQCom:
...
@@ -444,6 +444,7 @@ class TMQCom:
# skip first line for it is schema
# skip first line for it is schema
queryFile
.
readline
()
queryFile
.
readline
()
lines
=
0
lines
=
0
while
True
:
while
True
:
dst
=
queryFile
.
readline
()
dst
=
queryFile
.
readline
()
...
...
tests/system-test/fulltest.sh
浏览文件 @
918df89b
...
@@ -180,6 +180,7 @@ python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py
...
@@ -180,6 +180,7 @@ python3 ./test.py -f 7-tmq/tmqAutoCreateTbl.py
#python3 ./test.py -f 7-tmq/tmqDnodeRestart.py
#python3 ./test.py -f 7-tmq/tmqDnodeRestart.py
#python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py
#python3 ./test.py -f 7-tmq/tmqUpdate-1ctb.py
python3 ./test.py
-f
7-tmq/tmqUpdate-multiCtb.py
python3 ./test.py
-f
7-tmq/tmqUpdate-multiCtb.py
#python3 ./test.py -f 7-tmq/tmqDelete-1ctb.py
#------------querPolicy 2-----------
#------------querPolicy 2-----------
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录