Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
057df325
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
057df325
编写于
6月 02, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] fix invalid write
上级
acbe0ff7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
58 deletion
+39
-58
src/client/src/tscProfile.c
src/client/src/tscProfile.c
+1
-1
tests/examples/c/demo.c
tests/examples/c/demo.c
+4
-22
tests/script/general/parser/testSuite.sim
tests/script/general/parser/testSuite.sim
+34
-35
未找到文件。
src/client/src/tscProfile.c
浏览文件 @
057df325
...
...
@@ -94,7 +94,7 @@ void tscSaveSlowQuery(SSqlObj *pSql) {
tscTrace
(
"%p query time:%"
PRId64
" sql:%s"
,
pSql
,
pSql
->
res
.
useconds
,
pSql
->
sqlstr
);
char
*
sql
=
malloc
(
200
);
int
len
=
snprintf
(
sql
,
20
0
,
"insert into %s.slowquery values(now, '%s', %"
PRId64
", %"
PRId64
", '"
,
tsMonitorDbName
,
int
len
=
snprintf
(
sql
,
19
0
,
"insert into %s.slowquery values(now, '%s', %"
PRId64
", %"
PRId64
", '"
,
tsMonitorDbName
,
pSql
->
pTscObj
->
user
,
pSql
->
stime
,
pSql
->
res
.
useconds
);
int
sqlLen
=
snprintf
(
sql
+
len
,
TSDB_SHOW_SQL_LEN
,
"%s"
,
pSql
->
sqlstr
);
if
(
sqlLen
>
TSDB_SHOW_SQL_LEN
-
1
)
{
...
...
tests/examples/c/demo.c
浏览文件 @
057df325
...
...
@@ -26,13 +26,12 @@
void
taosMsleep
(
int
mseconds
);
static
int32_t
doQuery
(
TAOS
*
taos
,
const
char
*
sql
)
{
int32_t
code
=
taos_query
(
taos
,
sql
);
if
(
code
!=
0
)
{
TAOS_RES
*
res
=
taos_query
(
taos
,
sql
);
if
(
taos_errno
(
res
)
!=
0
)
{
printf
(
"failed to execute query, reason:%s
\n
"
,
taos_errstr
(
taos
));
return
-
1
;
}
TAOS_RES
*
res
=
taos_use_result
(
taos
);
TAOS_ROW
row
=
NULL
;
char
buf
[
512
]
=
{
0
};
...
...
@@ -46,7 +45,6 @@ static int32_t doQuery(TAOS* taos, const char* sql) {
}
taos_free_result
(
res
);
return
0
;
}
...
...
@@ -81,6 +79,7 @@ static __attribute__((unused)) void multiThreadTest(int32_t numOfThreads, void*
pthread_join
(
threadId
[
i
],
NULL
);
}
free
(
threadId
);
pthread_attr_destroy
(
&
thattr
);
}
...
...
@@ -108,24 +107,11 @@ int main(int argc, char *argv[]) {
printf
(
"success to connect to server
\n
"
);
// multiThreadTest(1, taos);
doQuery
(
taos
,
"select max(c1), min(c2), sum(c3), avg(c4), first(c7), last(c8), first(c9) from lm2_db0.lm2_stb0 where ts >= 1537146000000 and ts <= 1543145400000 interval(5m) fill(value, -1, -2) group by t1 limit 2 offset 10
;"
);
doQuery
(
taos
,
"insert into tb9 (ts, c1, c2) using stb (t1, t2) tags ('tag4', 4) values ( now + 4s, 'binary4', 4)
;"
);
// for(int32_t i = 0; i < 100000; ++i) {
// doQuery(taos, "insert into t1 values(now, 2)");
// }
// doQuery(taos, "create table t1(ts timestamp, k binary(12), f nchar(2))");
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:1', 'abc')");
// doQuery(taos, "create table if not exists tm0 (ts timestamp, k int);");
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:1', 1);");
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:2', 2);");
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:3', 3);");
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:4', 4);");
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:5', 5);");
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:6', 6);");
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:7', 7);");
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:8', 8);");
// doQuery(taos, "insert into tm0 values('2020-1-1 1:1:9', 9);");
// doQuery(taos, "select sum(k),count(*) from m1 group by a");
taos_close
(
taos
);
return
0
;
...
...
@@ -172,10 +158,6 @@ int main(int argc, char *argv[]) {
exit
(
1
);
}
result
=
taos_use_result
(
taos
);
if
(
result
==
NULL
)
{
printf
(
"failed to get result, reason:%s
\n
"
,
taos_errstr
(
taos
));
exit
(
1
);
...
...
tests/script/general/parser/testSuite.sim
浏览文件 @
057df325
...
...
@@ -40,45 +40,47 @@
#run general/parser/nchar.sim
#sleep 2000
##run general/parser/null_char.sim
sleep 2000
run general/parser/single_row_in_tb.sim
sleep 2000
run general/parser/select_from_cache_disk.sim
sleep 2000
run general/parser/selectResNum.sim
sleep 2000
run general/parser/mixed_blocks.sim
sleep 2000
run general/parser/limit1.sim
sleep 2000
run general/parser/limit.sim
sleep 2000
run general/parser/limit1_tblocks100.sim
sleep 2000
run general/parser/select_across_vnodes.sim
sleep 2000
run general/parser/slimit1.sim
sleep 2000
run general/parser/tbnameIn.sim
sleep 2000
#
sleep 2000
#
run general/parser/single_row_in_tb.sim
#
sleep 2000
#
run general/parser/select_from_cache_disk.sim
#
sleep 2000
#
run general/parser/selectResNum.sim
#
sleep 2000
#
run general/parser/mixed_blocks.sim
#
sleep 2000
#
run general/parser/limit1.sim
#
sleep 2000
#
run general/parser/limit.sim
#
sleep 2000
#
run general/parser/limit1_tblocks100.sim
#
sleep 2000
#
run general/parser/select_across_vnodes.sim
#
sleep 2000
#
run general/parser/slimit1.sim
#
sleep 2000
#
run general/parser/tbnameIn.sim
#
sleep 2000
run general/parser/projection_limit_offset.sim
sleep 2000
run general/parser/limit2.sim
sleep 2000
run general/parser/fill.sim
sleep 2000
run general/parser/fill_stb.sim
sleep 2000
run general/parser/where.sim
sleep 2000
run general/parser/slimit.sim
#run general/parser/fill.sim
#sleep 2000
#run general/parser/fill_stb.sim
#sleep 2000
#run general/parser/where.sim
#sleep 2000
#run general/parser/slimit.sim
#sleep 2000
#run general/parser/select_with_tags.sim
#sleep 2000
#run general/parser/interp.sim
sleep 2000
run general/parser/
select_with_tags
.sim
run general/parser/
tags_dynamically_specifiy
.sim
sleep 2000
run general/parser/
interp
.sim
run general/parser/
groupby
.sim
sleep 2000
run general/parser/tags_dynamically_specifiy.sim
sleep 2000
run general/parser/set_tag_vals.sim
...
...
@@ -97,9 +99,6 @@ sleep 2000
run general/parser/join.sim
sleep 2000
run general/parser/join_multivnode.sim
sleep 2000
run general/parser/groupby.sim
sleep 2000
run general/parser/binary_escapeCharacter.sim
sleep 2000
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录