Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
61a7751b
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
61a7751b
编写于
2月 14, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix bug in tIntToHex and add test case.
上级
fab32ae9
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
36 addition
and
5 deletion
+36
-5
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-3
source/util/src/tutil.c
source/util/src/tutil.c
+7
-2
source/util/test/utilTests.cpp
source/util/test/utilTests.cpp
+28
-0
未找到文件。
source/libs/executor/src/executorimpl.c
浏览文件 @
61a7751b
...
@@ -1988,14 +1988,12 @@ static SExecTaskInfo* createExecTaskInfo(uint64_t queryId, uint64_t taskId, EOPT
...
@@ -1988,14 +1988,12 @@ static SExecTaskInfo* createExecTaskInfo(uint64_t queryId, uint64_t taskId, EOPT
setTaskStatus
(
pTaskInfo
,
TASK_NOT_COMPLETED
);
setTaskStatus
(
pTaskInfo
,
TASK_NOT_COMPLETED
);
pTaskInfo
->
schemaInfo
.
dbname
=
strdup
(
dbFName
);
pTaskInfo
->
schemaInfo
.
dbname
=
strdup
(
dbFName
);
pTaskInfo
->
id
.
queryId
=
queryId
;
pTaskInfo
->
execModel
=
model
;
pTaskInfo
->
execModel
=
model
;
pTaskInfo
->
pTableInfoList
=
tableListCreate
();
pTaskInfo
->
pTableInfoList
=
tableListCreate
();
pTaskInfo
->
stopInfo
.
pStopInfo
=
taosArrayInit
(
4
,
sizeof
(
SExchangeOpStopInfo
));
pTaskInfo
->
stopInfo
.
pStopInfo
=
taosArrayInit
(
4
,
sizeof
(
SExchangeOpStopInfo
));
pTaskInfo
->
pResultBlockList
=
taosArrayInit
(
128
,
POINTER_BYTES
);
pTaskInfo
->
pResultBlockList
=
taosArrayInit
(
128
,
POINTER_BYTES
);
// char* p = taosMemoryMalloc(64);
pTaskInfo
->
id
.
queryId
=
queryId
;
// snprintf(p, 64, "TID:0x%" PRIx64 " QID:0x%" PRIx64, taskId, queryId);
pTaskInfo
->
id
.
str
=
buildTaskId
(
taskId
,
queryId
);
pTaskInfo
->
id
.
str
=
buildTaskId
(
taskId
,
queryId
);
return
pTaskInfo
;
return
pTaskInfo
;
}
}
...
...
source/util/src/tutil.c
浏览文件 @
61a7751b
...
@@ -323,8 +323,13 @@ char *strbetween(char *string, char *begin, char *end) {
...
@@ -323,8 +323,13 @@ char *strbetween(char *string, char *begin, char *end) {
int32_t
tintToHex
(
uint64_t
val
,
char
hex
[])
{
int32_t
tintToHex
(
uint64_t
val
,
char
hex
[])
{
const
char
hexstr
[
16
]
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
};
const
char
hexstr
[
16
]
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
};
int32_t
j
=
0
;
int32_t
j
=
0
,
k
=
0
;
int32_t
k
=
0
;
if
(
val
==
0
)
{
hex
[
j
++
]
=
hexstr
[
0
];
return
j
;
}
// ignore the initial 0
while
((
val
&
(((
uint64_t
)
0xfL
)
<<
((
15
-
k
)
*
4
)))
==
0
)
{
while
((
val
&
(((
uint64_t
)
0xfL
)
<<
((
15
-
k
)
*
4
)))
==
0
)
{
k
+=
1
;
k
+=
1
;
}
}
...
...
source/util/test/utilTests.cpp
浏览文件 @
61a7751b
...
@@ -295,3 +295,31 @@ TEST(utilTest, tstrncspn) {
...
@@ -295,3 +295,31 @@ TEST(utilTest, tstrncspn) {
v
=
tstrncspn
(
p2
,
strlen
(
p2
),
reject5
,
0
);
v
=
tstrncspn
(
p2
,
strlen
(
p2
),
reject5
,
0
);
ASSERT_EQ
(
v
,
14
);
ASSERT_EQ
(
v
,
14
);
}
}
TEST
(
utilTest
,
intToHextStr
)
{
char
buf
[
64
]
=
{
0
};
int64_t
v
=
0
;
tintToHex
(
0
,
buf
);
ASSERT_STREQ
(
buf
,
"0"
);
v
=
100000000
;
tintToHex
(
v
,
buf
);
char
destBuf
[
128
];
sprintf
(
destBuf
,
"%"
PRIx64
,
v
);
ASSERT_STREQ
(
buf
,
destBuf
);
taosSeedRand
(
taosGetTimestampSec
());
for
(
int32_t
i
=
0
;
i
<
100000
;
++
i
)
{
memset
(
buf
,
0
,
tListLen
(
buf
));
memset
(
destBuf
,
0
,
tListLen
(
destBuf
));
v
=
taosRand
();
tintToHex
(
v
,
buf
);
sprintf
(
destBuf
,
"%"
PRIx64
,
v
);
ASSERT_STREQ
(
buf
,
destBuf
);
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录