Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e9916902
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e9916902
编写于
7月 14, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into feat/tsdb_snapshot
上级
8e37a490
5ecf59d8
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
193 addition
and
192 deletion
+193
-192
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+4
-1
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+6
-1
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+3
-0
source/libs/executor/src/tfill.c
source/libs/executor/src/tfill.c
+12
-8
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+13
-4
source/libs/stream/src/streamUpdate.c
source/libs/stream/src/streamUpdate.c
+1
-1
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+1
-0
tests/script/sh/deploy.sh
tests/script/sh/deploy.sh
+2
-2
tests/script/tsim/insert/basic0.sim
tests/script/tsim/insert/basic0.sim
+66
-97
tests/script/tsim/insert/basic1.sim
tests/script/tsim/insert/basic1.sim
+8
-33
tests/script/tsim/stream/sliding.sim
tests/script/tsim/stream/sliding.sim
+4
-4
tests/script/tsim/valgrind/basic1.sim
tests/script/tsim/valgrind/basic1.sim
+42
-28
tests/script/tsim/valgrind/checkError2.sim
tests/script/tsim/valgrind/checkError2.sim
+21
-3
tests/script/tsim/valgrind/checkError3.sim
tests/script/tsim/valgrind/checkError3.sim
+8
-8
tools/taos-tools
tools/taos-tools
+1
-1
tools/taosadapter
tools/taosadapter
+1
-1
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
e9916902
...
...
@@ -542,8 +542,10 @@ int32_t blockDataToBuf(char* buf, const SSDataBlock* pBlock) {
}
int32_t
blockDataFromBuf
(
SSDataBlock
*
pBlock
,
const
char
*
buf
)
{
pBlock
->
info
.
rows
=
*
(
int32_t
*
)
buf
;
int32_t
numOfRows
=
*
(
int32_t
*
)
buf
;
blockDataEnsureCapacity
(
pBlock
,
numOfRows
);
pBlock
->
info
.
rows
=
numOfRows
;
size_t
numOfCols
=
taosArrayGetSize
(
pBlock
->
pDataBlock
);
const
char
*
pStart
=
buf
+
sizeof
(
uint32_t
);
...
...
@@ -589,6 +591,7 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
return
TSDB_CODE_SUCCESS
;
}
// todo remove this
int32_t
blockDataFromBuf1
(
SSDataBlock
*
pBlock
,
const
char
*
buf
,
size_t
capacity
)
{
pBlock
->
info
.
rows
=
*
(
int32_t
*
)
buf
;
pBlock
->
info
.
groupId
=
*
(
uint64_t
*
)(
buf
+
sizeof
(
int32_t
));
...
...
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
浏览文件 @
e9916902
...
...
@@ -168,7 +168,12 @@ int32_t mmPutMsgToQueue(SMnodeMgmt *pMgmt, EQueueType qtype, SRpcMsg *pRpc) {
memcpy
(
pMsg
,
pRpc
,
sizeof
(
SRpcMsg
));
dTrace
(
"msg:%p, is created and will put into %s queue, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pRpc
->
msgType
));
return
mmPutMsgToWorker
(
pMgmt
,
pWorker
,
pMsg
);
int32_t
code
=
mmPutMsgToWorker
(
pMgmt
,
pWorker
,
pMsg
);
if
(
code
!=
0
)
{
dTrace
(
"msg:%p, is freed"
,
pMsg
);
taosFreeQitem
(
pMsg
);
}
return
code
;
}
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
)
{
...
...
source/libs/executor/src/executil.c
浏览文件 @
e9916902
...
...
@@ -853,6 +853,9 @@ static STimeWindow doCalculateTimeWindow(int64_t ts, SInterval* pInterval) {
w
.
ekey
=
taosTimeAdd
(
w
.
skey
,
pInterval
->
interval
,
pInterval
->
intervalUnit
,
pInterval
->
precision
)
-
1
;
}
else
{
int64_t
st
=
w
.
skey
;
if
(
pInterval
->
offset
>
0
)
{
st
=
taosTimeAdd
(
st
,
pInterval
->
offset
,
pInterval
->
offsetUnit
,
pInterval
->
precision
);
}
if
(
st
>
ts
)
{
st
-=
((
st
-
ts
+
pInterval
->
sliding
-
1
)
/
pInterval
->
sliding
)
*
pInterval
->
sliding
;
...
...
source/libs/executor/src/tfill.c
浏览文件 @
e9916902
...
...
@@ -53,8 +53,8 @@ static void setNullRow(SSDataBlock* pBlock, int64_t ts, int32_t rowIndex) {
// the first are always the timestamp column, so start from the second column.
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pBlock
->
pDataBlock
);
++
i
)
{
SColumnInfoData
*
p
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
if
(
p
->
info
.
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
colDataAppend
(
p
,
rowIndex
,
(
const
char
*
)
&
ts
,
false
);
if
(
p
->
info
.
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
// handle timestamp
colDataAppend
(
p
,
rowIndex
,
(
const
char
*
)
&
ts
,
false
);
}
else
{
colDataAppendNULL
(
p
,
rowIndex
);
}
...
...
@@ -83,15 +83,20 @@ static void doFillOneRow(SFillInfo* pFillInfo, SSDataBlock* pBlock, SSDataBlock*
if
(
pFillInfo
->
type
==
TSDB_FILL_PREV
)
{
SArray
*
p
=
FILL_IS_ASC_FILL
(
pFillInfo
)
?
pFillInfo
->
prev
:
pFillInfo
->
next
;
for
(
int32_t
i
=
1
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pFillInfo
->
numOfCols
;
++
i
)
{
SFillColInfo
*
pCol
=
&
pFillInfo
->
pFillCol
[
i
];
if
(
TSDB_COL_IS_TAG
(
pCol
->
flag
))
{
continue
;
}
SGroupKeys
*
pKey
=
taosArrayGet
(
p
,
i
);
SColumnInfoData
*
pDstColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
GET_DEST_SLOT_ID
(
pCol
));
doSetVal
(
pDstColInfoData
,
index
,
pKey
);
if
(
pDstColInfoData
->
info
.
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
colDataAppend
(
pDstColInfoData
,
index
,
(
const
char
*
)
&
ts
,
false
);
}
else
{
SGroupKeys
*
pKey
=
taosArrayGet
(
p
,
i
);
doSetVal
(
pDstColInfoData
,
index
,
pKey
);
}
}
}
else
if
(
pFillInfo
->
type
==
TSDB_FILL_NEXT
)
{
SArray
*
p
=
FILL_IS_ASC_FILL
(
pFillInfo
)
?
pFillInfo
->
next
:
pFillInfo
->
prev
;
...
...
@@ -264,9 +269,8 @@ static int32_t fillResultImpl(SFillInfo* pFillInfo, SSDataBlock* pBlock, int32_t
assert
(
pFillInfo
->
currentKey
==
ts
);
if
(
pFillInfo
->
type
==
TSDB_FILL_NEXT
&&
(
pFillInfo
->
index
+
1
)
<
pFillInfo
->
numOfRows
)
{
++
pFillInfo
->
index
;
copyCurrentRowIntoBuf
(
pFillInfo
,
pFillInfo
->
index
,
pFillInfo
->
next
);
--
pFillInfo
->
index
;
int32_t
nextRowIndex
=
pFillInfo
->
index
+
1
;
copyCurrentRowIntoBuf
(
pFillInfo
,
nextRowIndex
,
pFillInfo
->
next
);
}
// assign rows to dst buffer
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
e9916902
...
...
@@ -3461,9 +3461,16 @@ void doAddIntoResult(SqlFunctionCtx* pCtx, void* pData, int32_t rowIndex, SSData
}
}
/*
* +------------------------------------+--------------+--------------+
* | null bitmap | | |
* |(n columns, one bit for each column)| src column #1| src column #2|
* +------------------------------------+--------------+--------------+
*/
void
saveTupleData
(
SqlFunctionCtx
*
pCtx
,
int32_t
rowIndex
,
const
SSDataBlock
*
pSrcBlock
,
STuplePos
*
pPos
)
{
SFilePage
*
pPage
=
NULL
;
// todo refactor: move away
int32_t
completeRowSize
=
pCtx
->
subsidiaries
.
num
*
sizeof
(
bool
);
for
(
int32_t
j
=
0
;
j
<
pCtx
->
subsidiaries
.
num
;
++
j
)
{
SqlFunctionCtx
*
pc
=
pCtx
->
subsidiaries
.
pCtx
[
j
];
...
...
@@ -3476,12 +3483,15 @@ void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pS
}
else
{
pPage
=
getBufPage
(
pCtx
->
pBuf
,
pCtx
->
curBufPage
);
if
(
pPage
->
num
+
completeRowSize
>
getBufPageSize
(
pCtx
->
pBuf
))
{
// current page is all used, let's prepare a new buffer page
releaseBufPage
(
pCtx
->
pBuf
,
pPage
);
pPage
=
getNewBufPage
(
pCtx
->
pBuf
,
0
,
&
pCtx
->
curBufPage
);
pPage
->
num
=
sizeof
(
SFilePage
);
}
}
pPos
->
pageId
=
pCtx
->
curBufPage
;
pPos
->
offset
=
pPage
->
num
;
// keep the current row data, extract method
int32_t
offset
=
0
;
...
...
@@ -3509,7 +3519,6 @@ void saveTupleData(SqlFunctionCtx* pCtx, int32_t rowIndex, const SSDataBlock* pS
offset
+=
pCol
->
info
.
bytes
;
}
pPos
->
offset
=
pPage
->
num
;
pPage
->
num
+=
completeRowSize
;
setBufPageDirty
(
pPage
,
true
);
...
...
@@ -4839,7 +4848,7 @@ static void doReservoirSample(SqlFunctionCtx* pCtx, SSampleInfo* pInfo, char* da
if
(
pInfo
->
numSampled
<
pInfo
->
samples
)
{
sampleAssignResult
(
pInfo
,
data
,
pInfo
->
numSampled
);
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
pInfo
->
tuplePos
+
pInfo
->
numSampled
*
sizeof
(
STuplePos
)
);
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pInfo
->
tuplePos
[
pInfo
->
numSampled
]
);
}
pInfo
->
numSampled
++
;
}
else
{
...
...
@@ -4847,7 +4856,7 @@ static void doReservoirSample(SqlFunctionCtx* pCtx, SSampleInfo* pInfo, char* da
if
(
j
<
pInfo
->
samples
)
{
sampleAssignResult
(
pInfo
,
data
,
j
);
if
(
pCtx
->
subsidiaries
.
num
>
0
)
{
copyTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
pInfo
->
tuplePos
+
j
*
sizeof
(
STuplePos
)
);
copyTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
,
&
pInfo
->
tuplePos
[
j
]
);
}
}
}
...
...
@@ -4885,7 +4894,7 @@ int32_t sampleFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
int32_t
currentRow
=
pBlock
->
info
.
rows
;
for
(
int32_t
i
=
0
;
i
<
pInfo
->
numSampled
;
++
i
)
{
colDataAppend
(
pCol
,
currentRow
+
i
,
pInfo
->
data
+
i
*
pInfo
->
colBytes
,
false
);
setSelectivityValue
(
pCtx
,
pBlock
,
pInfo
->
tuplePos
+
i
*
sizeof
(
STuplePos
)
,
currentRow
+
i
);
setSelectivityValue
(
pCtx
,
pBlock
,
&
pInfo
->
tuplePos
[
i
]
,
currentRow
+
i
);
}
return
pInfo
->
numSampled
;
...
...
source/libs/stream/src/streamUpdate.c
浏览文件 @
e9916902
...
...
@@ -17,7 +17,7 @@
#include "ttime.h"
#define DEFAULT_FALSE_POSITIVE 0.01
#define DEFAULT_BUCKET_SIZE 1
024
#define DEFAULT_BUCKET_SIZE 1
31072
#define ROWS_PER_MILLISECOND 1
#define MAX_NUM_SCALABLE_BF 100000
#define MIN_NUM_SCALABLE_BF 10
...
...
tests/script/jenkins/basic.txt
浏览文件 @
e9916902
...
...
@@ -114,6 +114,7 @@
# ./test.sh -f tsim/stream/schedSnode.sim
./test.sh -f tsim/stream/windowClose.sim
./test.sh -f tsim/stream/ignoreExpiredData.sim
./test.sh -f tsim/stream/sliding.sim
# ---- transaction
./test.sh -f tsim/trans/lossdata1.sim
...
...
tests/script/sh/deploy.sh
浏览文件 @
e9916902
...
...
@@ -127,8 +127,8 @@ echo "dataDir $DATA_DIR" >> $TAOS_CFG
echo
"logDir
$LOG_DIR
"
>>
$TAOS_CFG
echo
"debugFlag 0"
>>
$TAOS_CFG
echo
"tmrDebugFlag 131"
>>
$TAOS_CFG
echo
"uDebugFlag 1
31
"
>>
$TAOS_CFG
echo
"rpcDebugFlag 1
31
"
>>
$TAOS_CFG
echo
"uDebugFlag 1
43
"
>>
$TAOS_CFG
echo
"rpcDebugFlag 1
43
"
>>
$TAOS_CFG
echo
"jniDebugFlag 143"
>>
$TAOS_CFG
echo
"qDebugFlag 143"
>>
$TAOS_CFG
echo
"cDebugFlag 143"
>>
$TAOS_CFG
...
...
tests/script/tsim/insert/basic0.sim
浏览文件 @
e9916902
...
...
@@ -32,7 +32,6 @@ if $rows != 3 then
return -1
endi
print =============== insert data, mode1: one row one table in sql
print =============== insert data, mode1: mulit rows one table in sql
#print =============== insert data, mode1: one rows mulit table in sql
...
...
@@ -41,9 +40,6 @@ sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
sql insert into ct2 values(now+0s, 10, 2.0, 3.0)
sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
#sql insert into ct1 values(now+4s, -14, -2.4, -3.4) ct2 values(now+4s, -14, -2.4, -3.4)
#sql insert into ct1 values(now+5s, -15, -2.5, -3.5)(now+6s, -16, -2.6, -3.6) ct2 values(now+5s, -15, -2.5, -3.5)(now+6s, -16, -2.6, -3.6)
sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0)
#===================================================================
...
...
@@ -67,16 +63,6 @@ endi
if $data03 != 3.000000000 then
return -1
endi
#if $data41 != -14 then
# return -1
#endi
#if $data42 != -2.40000 then
# return -1
#endi
#if $data43 != -3.400000000 then
# return -1
#endi
print =============== select count(*) from child table
sql select count(*) from ct1
...
...
@@ -107,10 +93,10 @@ if $data03 != 4 then
endi
#print =============== select first(*)/first(column) from child table
#
sql select first(*) from ct1
#
print ====> select first(*) from ct1
#
print rows: $rows
#
print $data00 $data01 $data02 $data03
sql select first(*) from ct1
print ====> select first(*) from ct1
print rows: $rows
print $data00 $data01 $data02 $data03
sql select first(ts), first(c1), first(c2), first(c3) from ct1
print ====> select first(ts), first(c1), first(c2), first(c3) from ct1
...
...
@@ -217,23 +203,23 @@ if $data32 != -3.300000000 then
return -1
endi
#===================================================================
#===================================================================
#print =============== query data from stb
#sql select * from stb
#if $rows != 4 then
# return -1
#endi
sql select * from stb
print $rows
if $rows != 9 then
return -1
endi
#print =============== select count(*) from supter table
#
sql select count(*) from stb
#
print $data00 $data01 $data02
#
if $rows != 1 then
#
return -1
#
endi
#
if $data00 != 9 then
#
return -1
#
endi
sql select count(*) from stb
print $data00 $data01 $data02
if $rows != 1 then
return -1
endi
if $data00 != 9 then
return -1
endi
print =============== select count(column) from supter table
sql select ts, c1, c2, c3 from stb
...
...
@@ -264,28 +250,23 @@ if $data03 != 3.000000000 then
endi
#print =============== select count(column) from supter table
#sql select count(ts), count(c1), count(c2), count(c3) from stb
#print rows: $rows
#print $data00 $data01 $data02 $data03
#print $data10 $data11 $data12 $data13
#print $data20 $data21 $data22 $data23
#print $data30 $data31 $data32 $data33
#if $data00 != 9 then
# return -1
#endi
#if $data01 != 8 then
# return -1
#endi
#if $data02 != 8 then
# return -1
#endi
#if $data03 != 8 then
# return -1
#endi
sql select count(ts), count(c1), count(c2), count(c3) from stb
print rows: $rows
print $data00 $data01 $data02 $data03
if $data00 != 9 then
return -1
endi
if $data01 != 9 then
return -1
endi
if $data02 != 9 then
return -1
endi
if $data03 != 9 then
return -1
endi
#===================================================================
#===================================================================
print =============== stop and restart taosd, then again do query above
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
...
...
@@ -326,16 +307,6 @@ endi
if $data03 != 3.000000000 then
return -1
endi
#if $data41 != -14 then
# return -1
#endi
#if $data42 != -2.40000 then
# return -1
#endi
#if $data43 != -3.400000000 then
# return -1
#endi
print =============== select count(*) from child table
sql select count(*) from ct1
...
...
@@ -366,10 +337,10 @@ if $data03 != 4 then
endi
#print =============== select first(*)/first(column) from child table
#
sql select first(*) from ct1
#
print ====> select first(*) from ct1
#
print rows: $rows
#
print $data00 $data01 $data02 $data03
sql select first(*) from ct1
print ====> select first(*) from ct1
print rows: $rows
print $data00 $data01 $data02 $data03
sql select first(ts), first(c1), first(c2), first(c3) from ct1
print ====> select first(ts), first(c1), first(c2), first(c3) from ct1
...
...
@@ -474,24 +445,23 @@ endi
if $data32 != -3.300000000 then
return -1
endi
#===================================================================
#===================================================================
#print =============== query data from stb
#sql select * from stb
#if $rows != 4 then
# return -1
#endi
#===================================================================
print =============== query data from stb
sql select * from stb
if $rows != 9 then
return -1
endi
#
print =============== select count(*) from supter table
#
sql select count(*) from stb
#
print $data00 $data01 $data02
#
if $rows != 1 then
#
return -1
#
endi
#
if $data00 != 9 then
#
return -1
#
endi
print =============== select count(*) from supter table
sql select count(*) from stb
print $data00 $data01 $data02
if $rows != 1 then
return -1
endi
if $data00 != 9 then
return -1
endi
print =============== select count(column) from supter table
sql select ts, c1, c2, c3 from stb
...
...
@@ -521,20 +491,19 @@ if $data03 != 3.000000000 then
endi
#print =============== select count(column) from supter table
#sql select count(ts), count(c1), count(c2), count(c3) from stb
#print $data00 $data01 $data02 $data03
#if $data00 != 8 then
# return -1
#endi
#if $data01 != 8 then
# return -1
#endi
#if $data02 != 8 then
# return -1
#endi
#if $data03 != 8 then
# return -1
#endi
sql select count(ts), count(c1), count(c2), count(c3) from stb
print $data00 $data01 $data02 $data03
if $data00 != 9 then
return -1
endi
if $data01 != 9 then
return -1
endi
if $data02 != 9 then
return -1
endi
if $data03 != 9 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/insert/basic1.sim
浏览文件 @
e9916902
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 50
sql connect
print =============== create database
sql create database d1
sql show databases
...
...
@@ -17,7 +15,6 @@ sql use d1
print =============== create super table, include all type
sql create table if not exists stb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(16), c9 nchar(16), c10 timestamp, c11 tinyint unsigned, c12 smallint unsigned, c13 int unsigned, c14 bigint unsigned) tags (t1 bool, t2 tinyint, t3 smallint, t4 int, t5 bigint, t6 float, t7 double, t8 binary(16), t9 nchar(16), t10 timestamp, t11 tinyint unsigned, t12 smallint unsigned, t13 int unsigned, t14 bigint unsigned)
sql create stable if not exists stb_1 (ts timestamp, i int) tags (j int)
sql create table stb_2 (ts timestamp, i int) tags (j int)
sql create stable stb_3 (ts timestamp, i int) tags (j int)
...
...
@@ -36,11 +33,6 @@ if $rows != 2 then
return -1
endi
print =============== insert data, mode1: one row one table in sql
print =============== insert data, mode1: mulit rows one table in sql
print =============== insert data, mode1: one rows mulit table in sql
print =============== insert data, mode1: mulit rows mulit table in sql
sql insert into c1 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql insert into c1 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
...
...
@@ -69,32 +61,15 @@ if $data03 != -2 then
endi
print =============== query data from st, but not support select * from super table, waiting fix
#sql select * from st
#
if $rows != 4 then
#
return -1
#
endi
sql select * from stb
if $rows != 4 then
return -1
endi
print =============== stop and restart taosd
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
print =============== query data
sql select * from c1
print rows: $rows
...
...
@@ -119,9 +94,9 @@ if $data03 != -2 then
endi
print =============== query data from st, but not support select * from super table, waiting fix
#sql select * from st
#
if $rows != 4 then
#
return -1
#
endi
sql select * from stb
if $rows != 4 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
tests/script/tsim/stream/sliding.sim
浏览文件 @
e9916902
...
...
@@ -17,10 +17,10 @@ sql use test
sql create stable st(ts timestamp, a int, b int, c int, d double) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create stream streams1 trigger at_once into streamt as select _wstart
ts
, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstart
ts
, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
sql create stream stream_t1 trigger at_once into streamtST as select _wstart
ts
, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
sql create stream stream_t2 trigger at_once watermark 1d into streamtST2 as select _wstart
ts
, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
sql create stream streams1 trigger at_once into streamt as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
sql create stream streams2 trigger at_once watermark 1d into streamt2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from t1 interval(10s) sliding (5s);
sql create stream stream_t1 trigger at_once into streamtST as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
sql create stream stream_t2 trigger at_once watermark 1d into streamtST2 as select _wstart, count(*) c1, sum(a) c3 , max(b) c4, min(c) c5 from st interval(10s) sliding (5s);
sql insert into t1 values(1648791210000,1,2,3,1.0);
sql insert into t1 values(1648791216000,2,2,3,1.1);
...
...
tests/script/tsim/valgrind/basic1.sim
浏览文件 @
e9916902
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c debugflag -v 131
system sh/exec.sh -n dnode1 -s start
-v
system sh/exec.sh -n dnode1 -s start
sql connect
print =============== step1: create drop show dnodes
...
...
@@ -23,51 +23,65 @@ if $data(1)[4] != ready then
endi
print =============== step2: create db
sql create database d1 vgroups
1
buffer 3
sql create database d1 vgroups
3
buffer 3
sql show databases
sql use d1
sql show vgroups
print =============== step3: create show stable
sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned)
print =============== step3: create show stable, include all type
sql create table if not exists stb (ts timestamp, c1 bool, c2 tinyint, c3 smallint, c4 int, c5 bigint, c6 float, c7 double, c8 binary(16), c9 nchar(16), c10 timestamp, c11 tinyint unsigned, c12 smallint unsigned, c13 int unsigned, c14 bigint unsigned) tags (t1 bool, t2 tinyint, t3 smallint, t4 int, t5 bigint, t6 float, t7 double, t8 binary(16), t9 nchar(16), t10 timestamp, t11 tinyint unsigned, t12 smallint unsigned, t13 int unsigned, t14 bigint unsigned)
sql create stable if not exists stb_1 (ts timestamp, c1 int) tags (j int)
sql create table stb_2 (ts timestamp, c1 int) tags (t1 int)
sql create stable stb_3 (ts timestamp, c1 int) tags (t1 int)
sql show stables
if $rows !=
1
then
if $rows !=
4
then
return -1
endi
print =============== step4: create show table
sql create table ct1 using stb tags(1000)
sql create table ct2 using stb tags(2000)
sql create table ct3 using stb tags(3000)
print =============== step4: ccreate child table
sql create table c1 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql create table c2 using stb tags(false, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 2', 'child tbl 2', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql show tables
if $rows !=
3
then
if $rows !=
2
then
return -1
endi
print =============== step5: insert data
sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
sql insert into ct2 values(now+0s, 10, 2.0, 3.0)
sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0)
sql insert into c1 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql insert into c1 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql insert into c2 values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql insert into c2 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) (now+2s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
print =============== step6: alter insert
sql insert into c3 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) values(now-1s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql insert into c3 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40) values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
print =============== restart
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start -v
print =============== step6: query data
sql select * from ct1
sql select * from stb
sql select c1, c2, c3 from ct1
sql select ts, c1, c2, c3 from stb
print =============== stepa: query data
sql select * from c1
#sql select * from stb
#sql select * from stb_1
#sql select ts, c1, c2, c3 from c1
#sql select ts, c1, c2, c3 from stb
#sql select ts, c1 from stb_2
#sql select ts, c1, t1 from c1
#sql select ts, c1, t1 from stb
#sql select ts, c1, t1 from stb_2
print =============== step
7
: count
sql select count(*) from ct
1;
print =============== step
b
: count
#sql select count(*) from c
1;
#sql select count(*) from stb;
#sql select count(ts), count(c1), count(c2), count(c3) from c
t
1
#sql select count(ts), count(c1), count(c2), count(c3) from c1
#sql select count(ts), count(c1), count(c2), count(c3) from stb
print =============== step
8
: func
#sql select first(ts), first(c1), first(c2), first(c3) from c
t
1
#sql select min(c
1), min(c2), min(c3) from ct
1
#sql select max(c
1), max(c2), max(c3) from ct
1
#sql select sum(c
1), sum(c2), sum(c3) from ct
1
print =============== step
c
: func
#sql select first(ts), first(c1), first(c2), first(c3) from c1
#sql select min(c
2), min(c3), min(c4) from c
1
#sql select max(c
2), max(c3), max(c4) from c
1
#sql select sum(c
2), sum(c3), sum(c4) from c
1
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
...
...
tests/script/tsim/valgrind/checkError2.sim
浏览文件 @
e9916902
...
...
@@ -37,22 +37,40 @@ endi
print =============== step4: create show table
sql create table ct1 using stb tags(1000)
sql create table ct2 using stb tags(2000)
sql create table ct3 using stb tags(3000)
sql show tables
if $rows !=
1
then
if $rows !=
3
then
return -1
endi
print =============== step5: insert data
sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
sql insert into ct2 values(now+0s, 10, 2.0, 3.0)
sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0)
print =============== step6:
select
data
print =============== step6:
query
data
sql select * from ct1
sql select * from stb
sql select c1, c2, c3 from ct1
sql select ts, c1, c2, c3 from stb
print =============== step7: count
sql select count(*) from ct1;
sql select count(*) from stb;
sql select count(ts), count(c1), count(c2), count(c3) from ct1
sql select count(ts), count(c1), count(c2), count(c3) from stb
print =============== step8: func
sql select first(ts), first(c1), first(c2), first(c3) from ct1
sql select min(c1), min(c2), min(c3) from ct1
sql select max(c1), max(c2), max(c3) from ct1
sql select sum(c1), sum(c2), sum(c3) from ct1
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
print =============== check
$null=
...
...
tests/script/tsim/valgrind/checkError3.sim
浏览文件 @
e9916902
...
...
@@ -68,16 +68,16 @@ sql select ts, c1, t1 from stb
sql select ts, c1, t1 from stb_2
print =============== stepb: count
#
sql select count(*) from c1;
#
sql select count(*) from stb;
#
sql select count(ts), count(c1), count(c2), count(c3) from c1
#
sql select count(ts), count(c1), count(c2), count(c3) from stb
sql select count(*) from c1;
sql select count(*) from stb;
sql select count(ts), count(c1), count(c2), count(c3) from c1
sql select count(ts), count(c1), count(c2), count(c3) from stb
print =============== stepc: func
#
sql select first(ts), first(c1), first(c2), first(c3) from c1
#sql select min(c1), min(c2), min(c3
) from c1
#sql select max(c1), max(c2), max(c3
) from c1
#sql select sum(c1), sum(c2), sum(c3
) from c1
sql select first(ts), first(c1), first(c2), first(c3) from c1
sql select min(c2), min(c3), min(c4
) from c1
sql select max(c2), max(c3), max(c4
) from c1
sql select sum(c2), sum(c3), sum(c4
) from c1
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
...
...
taos-tools
@
bd496f76
比较
3f42d428
...
bd496f76
Subproject commit
3f42d428eb6b90dea2651f4ccea66e44705c831b
Subproject commit
bd496f76b64931c66da2f8b0f24143a98a881cde
taosadapter
@
df8678f0
比较
c885e967
...
df8678f0
Subproject commit
c885e967e490105999b84d009a15168728dfafaf
Subproject commit
df8678f070e3f707faf59baebec90065f6e1268b
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录