Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6a78e639
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看板
未验证
提交
6a78e639
编写于
7月 20, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
7月 20, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15173 from taosdata/fix/mnode
fix: definite lost while get sma meta
上级
cfe00471
242ad4a1
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
118 addition
and
86 deletion
+118
-86
include/common/tmsg.h
include/common/tmsg.h
+1
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+7
-0
source/dnode/mnode/impl/src/mndSma.c
source/dnode/mnode/impl/src/mndSma.c
+1
-0
tests/script/tsim/valgrind/basic2.sim
tests/script/tsim/valgrind/basic2.sim
+73
-52
tests/script/tsim/valgrind/basic3.sim
tests/script/tsim/valgrind/basic3.sim
+35
-33
tests/script/tsim/valgrind/checkError6.sim
tests/script/tsim/valgrind/checkError6.sim
+1
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
6a78e639
...
@@ -2803,6 +2803,7 @@ typedef struct {
...
@@ -2803,6 +2803,7 @@ typedef struct {
int32_t
tSerializeSTableIndexRsp
(
void
*
buf
,
int32_t
bufLen
,
const
STableIndexRsp
*
pRsp
);
int32_t
tSerializeSTableIndexRsp
(
void
*
buf
,
int32_t
bufLen
,
const
STableIndexRsp
*
pRsp
);
int32_t
tDeserializeSTableIndexRsp
(
void
*
buf
,
int32_t
bufLen
,
STableIndexRsp
*
pRsp
);
int32_t
tDeserializeSTableIndexRsp
(
void
*
buf
,
int32_t
bufLen
,
STableIndexRsp
*
pRsp
);
void
tFreeSerializeSTableIndexRsp
(
STableIndexRsp
*
pRsp
);
void
tFreeSTableIndexInfo
(
void
*
pInfo
);
void
tFreeSTableIndexInfo
(
void
*
pInfo
);
...
...
source/common/src/tmsg.c
浏览文件 @
6a78e639
...
@@ -2933,6 +2933,13 @@ int32_t tSerializeSTableIndexRsp(void *buf, int32_t bufLen, const STableIndexRsp
...
@@ -2933,6 +2933,13 @@ int32_t tSerializeSTableIndexRsp(void *buf, int32_t bufLen, const STableIndexRsp
return
tlen
;
return
tlen
;
}
}
void
tFreeSerializeSTableIndexRsp
(
STableIndexRsp
*
pRsp
)
{
if
(
pRsp
->
pIndex
!=
NULL
)
{
taosArrayDestroy
(
pRsp
->
pIndex
);
pRsp
->
pIndex
=
NULL
;
}
}
int32_t
tDeserializeSTableIndexInfo
(
SDecoder
*
pDecoder
,
STableIndexInfo
*
pInfo
)
{
int32_t
tDeserializeSTableIndexInfo
(
SDecoder
*
pDecoder
,
STableIndexInfo
*
pInfo
)
{
if
(
tDecodeI8
(
pDecoder
,
&
pInfo
->
intervalUnit
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pInfo
->
intervalUnit
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pInfo
->
slidingUnit
)
<
0
)
return
-
1
;
if
(
tDecodeI8
(
pDecoder
,
&
pInfo
->
slidingUnit
)
<
0
)
return
-
1
;
...
...
source/dnode/mnode/impl/src/mndSma.c
浏览文件 @
6a78e639
...
@@ -1153,6 +1153,7 @@ _OVER:
...
@@ -1153,6 +1153,7 @@ _OVER:
mError
(
"failed to get table index %s since %s"
,
indexReq
.
tbFName
,
terrstr
());
mError
(
"failed to get table index %s since %s"
,
indexReq
.
tbFName
,
terrstr
());
}
}
tFreeSerializeSTableIndexRsp
(
&
rsp
);
return
code
;
return
code
;
}
}
...
...
tests/script/tsim/valgrind/basic2.sim
浏览文件 @
6a78e639
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 -v
system sh/exec.sh -n dnode1 -s start -v
sql connect
sql connect
...
@@ -23,65 +22,87 @@ if $data(1)[4] != ready then
...
@@ -23,65 +22,87 @@ if $data(1)[4] != ready then
endi
endi
print =============== step2: create db
print =============== step2: create db
sql create database d
1 vgroups 2 buffer 3
sql create database d
b
sql
show databases
sql
use db
sql
use d1
sql
create table db.stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 float, t3 binary(16)) comment "abd"
sql
show vgroups
sql
create table db.c1 using db.stb tags(101, 102, "103")
print =============== step3: create show stable
print =============== step3: alter stb
sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned)
sql_error alter table db.stb add column ts int
sql show stables
sql alter table db.stb add column c3 int
if $rows != 1 then
sql alter table db.stb add column c4 bigint
return -1
sql alter table db.stb add column c5 binary(12)
endi
sql alter table db.stb drop column c1
sql alter table db.stb drop column c4
sql alter table db.stb MODIFY column c2 binary(32)
sql alter table db.stb add tag t4 bigint
sql alter table db.stb add tag c1 int
sql alter table db.stb add tag t5 binary(12)
sql alter table db.stb drop tag c1
sql alter table db.stb drop tag t5
sql alter table db.stb MODIFY tag t3 binary(32)
sql alter table db.stb rename tag t1 tx
sql alter table db.stb comment 'abcde' ;
sql drop table db.stb
print =============== step4: create show table
print =============== step4: alter tb
sql create table ct1 using stb tags(1000)
sql create table tb (ts timestamp, a int)
sql create table ct2 using stb tags(2000)
sql insert into tb values(now-28d, -28)
sql create table ct3 using stb tags(3000)
sql select count(a) from tb
sql show tables
sql alter table tb add column b smallint
if $rows != 3 then
sql insert into tb values(now-25d, -25, 0)
return -1
sql select count(b) from tb
endi
sql alter table tb add column c tinyint
sql insert into tb values(now-22d, -22, 3, 0)
sql select count(c) from tb
sql alter table tb add column d int
sql insert into tb values(now-19d, -19, 6, 0, 0)
sql select count(d) from tb
sql alter table tb add column e bigint
sql alter table tb add column f float
sql alter table tb add column g double
sql alter table tb add column h binary(10)
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
sql select * from tb order by ts desc
print =============== step5: insert data
print =============== step5: alter stb and insert data
sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
sql create table stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 float, t3 binary(16)) comment "abd"
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 show db.stables
sql insert into ct2 values(now+0s, 10, 2.0, 3.0)
sql describe stb
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_error alter table stb add column ts int
sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0)
print =============== step6: query data
sql create table db.ctb using db.stb tags(101, 102, "103")
sql
select * from ct1
sql
insert into db.ctb values(now, 1, "2")
sql s
elect * from stb
sql s
how db.tables
sql select
c1, c2, c3 from ct1
sql select
* from db.stb
sql select
ts, c1, c2, c3 from s
tb
sql select
* from
tb
print =============== step7: count
sql alter table stb add column c3 int
sql select count(*) from ct1;
sql describe stb
sql select count(*) from stb;
sql select * from db.stb
sql select count(ts), count(c1), count(c2), count(c3) from ct1
sql select * from tb
sql select count(ts), count(c1), count(c2), count(c3) from stb
sql insert into db.ctb values(now+1s, 1, 2, 3)
sql select * from db.stb
print =============== step8: func
sql alter table db.stb add column c4 bigint
sql select first(ts), first(c1), first(c2), first(c3) from ct1
sql select * from db.stb
sql select min(c1), min(c2), min(c3) from ct1
sql insert into db.ctb values(now+2s, 1, 2, 3, 4)
sql select max(c1), max(c2), max(c3) from ct1
sql select sum(c1), sum(c2), sum(c3) from ct1
print =============== step9: insert select
sql alter table db.stb drop column c1
sql
create table ct4 using stb tags(4000);
sql
reset query cache
sql
insert into ct4 select * from ct1;
sql
select * from tb
sql
select * from ct4;
sql
insert into db.ctb values(now+3s, 2, 3, 4)
sql
insert into ct4 select ts,c1,c2,c3 from stb;
sql
select * from db.stb
sql create table tb1 (ts timestamp, c1 int, c2 float, c3 double);
sql alter table db.stb add tag t4 bigint
sql insert into tb1 (ts, c1, c2, c3) select * from ct1;
sql select * from db.stb
sql select * from tb1;
sql select * from db.stb
sql_error create table db.ctb2 using db.stb tags(101, "102")
sql create table db.ctb2 using db.stb tags(101, 102, "103", 104)
sql insert into db.ctb2 values(now, 1, 2, 3)
sql create table tb2 (ts timestamp, f1 binary(10), c1 int, c2 double);
print =============== step6: query data
sql insert into tb2 (c2, c1, ts) select c2+1, c1, ts+3 from ct2;
sql select * from db.stb where tbname = 'ctb2';
sql select * from tb2;
_OVER:
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
...
@@ -90,7 +111,7 @@ $null=
...
@@ -90,7 +111,7 @@ $null=
system_content sh/checkValgrind.sh -n dnode1
system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
print cmd return result ----> [ $system_content ]
if $system_content >
1
then
if $system_content >
0
then
return -1
return -1
endi
endi
...
...
tests/script/tsim/valgrind/basic3.sim
浏览文件 @
6a78e639
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 -v
system sh/exec.sh -n dnode1 -s start -v
sql connect
sql connect
...
@@ -22,40 +21,43 @@ if $data(1)[4] != ready then
...
@@ -22,40 +21,43 @@ if $data(1)[4] != ready then
goto step1
goto step1
endi
endi
print =============== step2: create db
$tbPrefix = tb
sql create database d1 vgroups 2 buffer 3
$tbNum = 5
sql show databases
$rowNum = 10
sql use d1
sql show vgroups
print =============== step3: create show stable
print =============== step2: prepare data
sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned)
sql create database db vgroups 2
sql show stables
sql use db
if $rows != 1 then
sql create table if not exists stb (ts timestamp, tbcol int, tbcol2 float, tbcol3 double) tags (tgcol int unsigned)
return -1
endi
print =============== step4: create show table
$i = 0
sql create table ct1 using stb tags(1000)
while $i < $tbNum
sql create table ct2 using stb tags(2000)
$tb = $tbPrefix . $i
sql create table ct3 using stb tags(3000)
sql create table $tb using stb tags( $i )
sql show tables
$x = 0
if $rows != 3 then
while $x < $rowNum
return -1
$cc = $x * 60000
endi
$ms = 1601481600000 + $cc
sql insert into $tb values ($ms , $x , $x , $x )
print =============== step5: insert data
$x = $x + 1
sql insert into ct1 values(now+0d, 10, 2.0, 3.0)
endw
sql insert into ct1 values(now+1d, 11, 2.1, 3.1)(now+2d, -12, -2.2, -3.2)(now+3d, -13, -2.3, -3.3)
$i = $i + 1
sql insert into ct2 values(now+0d, 10, 2.0, 3.0)
endw
sql insert into ct2 values(now+1d, 11, 2.1, 3.1)(now+2d, -12, -2.2, -3.2)(now+3d, -13, -2.3, -3.3)
sql insert into ct3 values('2022-01-01 00:00:00.000', 10, 2.0, 3.0)
print =============== step6: query data
print =============== step3: avg
sql select * from ct1 where ts < now -1d and ts > now +1d
sql select avg(tbcol) from tb1
sql select * from stb where ts < now -1d and ts > now +1d
sql select avg(tbcol) from tb1 where ts <= 1601481840000
sql select * from ct1 where ts < now -1d and ts > now +1d order by ts desc
sql select avg(tbcol) as b from tb1
sql select * from stb where ts < now -1d and ts > now +1d order by ts desc
sql select avg(tbcol) as b from tb1 interval(1d)
sql select avg(tbcol) as b from tb1 where ts <= 1601481840000s interval(1m)
sql select avg(tbcol) as c from stb
sql select avg(tbcol) as c from stb where ts <= 1601481840000
sql select avg(tbcol) as c from stb where tgcol < 5 and ts <= 1601481840000
sql select avg(tbcol) as c from stb interval(1m)
sql select avg(tbcol) as c from stb interval(1d)
sql select avg(tbcol) as b from stb where ts <= 1601481840000s interval(1m)
sql select avg(tbcol) as c from stb group by tgcol
sql select avg(tbcol) as b from stb where ts <= 1601481840000s partition by tgcol interval(1m)
_OVER:
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
...
@@ -64,7 +66,7 @@ $null=
...
@@ -64,7 +66,7 @@ $null=
system_content sh/checkValgrind.sh -n dnode1
system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
print cmd return result ----> [ $system_content ]
if $system_content >
1
then
if $system_content >
0
then
return -1
return -1
endi
endi
...
...
tests/script/tsim/valgrind/checkError6.sim
浏览文件 @
6a78e639
...
@@ -68,7 +68,7 @@ $null=
...
@@ -68,7 +68,7 @@ $null=
system_content sh/checkValgrind.sh -n dnode1
system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
print cmd return result ----> [ $system_content ]
if $system_content >
3
then
if $system_content >
0
then
return -1
return -1
endi
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录