Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
2124c236
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2124c236
编写于
11月 29, 2019
作者:
L
lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TBASE-816]
上级
a5a1b0ee
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
23 deletion
+44
-23
src/system/detail/src/mgmtMeter.c
src/system/detail/src/mgmtMeter.c
+1
-1
src/util/src/textbuffer.c
src/util/src/textbuffer.c
+43
-22
未找到文件。
src/system/detail/src/mgmtMeter.c
浏览文件 @
2124c236
...
...
@@ -660,7 +660,7 @@ int mgmtCreateMeter(SDbObj *pDb, SCreateTableMsg *pCreate) {
pMeter
->
uid
=
(((
uint64_t
)
pMeter
->
gid
.
vgId
)
<<
40
)
+
((((
uint64_t
)
pMeter
->
gid
.
sid
)
&
((
1ul
<<
24
)
-
1ul
))
<<
16
)
+
((
uint64_t
)
sdbVersion
&
((
1ul
<<
16
)
-
1ul
));
mTrace
(
"table:%s, create table in vgroup, vgId:%d sid:%d vnode:%d uid:%l
d
db:%s"
,
mTrace
(
"table:%s, create table in vgroup, vgId:%d sid:%d vnode:%d uid:%l
lu
db:%s"
,
pMeter
->
meterId
,
pVgroup
->
vgId
,
sid
,
pVgroup
->
vnodeGid
[
0
].
vnode
,
pMeter
->
uid
,
pDb
->
name
);
}
else
{
pMeter
->
uid
=
(((
uint64_t
)
pMeter
->
createdTime
)
<<
16
)
+
((
uint64_t
)
sdbVersion
&
((
1ul
<<
16
)
-
1ul
));
...
...
src/util/src/textbuffer.c
浏览文件 @
2124c236
...
...
@@ -21,6 +21,7 @@
#include "tsqlfunction.h"
#include "ttime.h"
#include "ttypes.h"
#include "tutil.h"
#pragma GCC diagnostic ignored "-Wformat"
...
...
@@ -46,8 +47,7 @@ void getTmpfilePath(const char *fileNamePrefix, char *dstPath) {
strcpy
(
tmpPath
,
tmpDir
);
strcat
(
tmpPath
,
tdengineTmpFileNamePrefix
);
strcat
(
tmpPath
,
fileNamePrefix
);
strcat
(
tmpPath
,
"-%u-%u"
);
strcat
(
tmpPath
,
"-%llu-%u"
);
snprintf
(
dstPath
,
MAX_TMPFILE_PATH_LENGTH
,
tmpPath
,
taosGetPthreadId
(),
atomic_add_fetch_32
(
&
tmpFileSerialNum
,
1
));
}
...
...
@@ -431,7 +431,8 @@ void tBucketIntHash(tMemBucket *pBucket, void *value, int16_t *segIdx, int16_t *
}
void
tBucketDoubleHash
(
tMemBucket
*
pBucket
,
void
*
value
,
int16_t
*
segIdx
,
int16_t
*
slotIdx
)
{
double
v
=
*
(
double
*
)
value
;
//double v = *(double *)value;
double
v
=
GET_DOUBLE_VAL
(
value
);
if
(
pBucket
->
nRange
.
dMinVal
==
DBL_MAX
)
{
/*
...
...
@@ -675,7 +676,8 @@ void tMemBucketUpdateBoundingBox(MinMaxEntry *r, char *data, int32_t dataType) {
break
;
};
case
TSDB_DATA_TYPE_DOUBLE
:
{
double
val
=
*
(
double
*
)
data
;
//double val = *(double *)data;
double
val
=
GET_DOUBLE_VAL
(
data
);
if
(
r
->
dMinVal
>
val
)
{
r
->
dMinVal
=
val
;
}
...
...
@@ -686,7 +688,8 @@ void tMemBucketUpdateBoundingBox(MinMaxEntry *r, char *data, int32_t dataType) {
break
;
};
case
TSDB_DATA_TYPE_FLOAT
:
{
double
val
=
*
(
float
*
)
data
;
//double val = *(float *)data;
double
val
=
GET_FLOAT_VAL
(
data
);
if
(
r
->
dMinVal
>
val
)
{
r
->
dMinVal
=
val
;
...
...
@@ -734,12 +737,14 @@ void tMemBucketPut(tMemBucket *pBucket, void *data, int32_t numOfRows) {
break
;
}
case
TSDB_DATA_TYPE_DOUBLE
:
{
double
val
=
*
(
double
*
)
d
;
//double val = *(double *)d;
double
val
=
GET_DOUBLE_VAL
(
d
);
(
pBucket
->
HashFunc
)(
pBucket
,
&
val
,
&
segIdx
,
&
slotIdx
);
break
;
}
case
TSDB_DATA_TYPE_FLOAT
:
{
double
val
=
*
(
float
*
)
d
;
//double val = *(float *)d;
double
val
=
GET_FLOAT_VAL
(
d
);
(
pBucket
->
HashFunc
)(
pBucket
,
&
val
,
&
segIdx
,
&
slotIdx
);
break
;
}
...
...
@@ -840,16 +845,20 @@ static FORCE_INLINE int32_t columnValueAscendingComparator(char *f1, char *f2, i
return
(
first
<
second
)
?
-
1
:
1
;
};
case
TSDB_DATA_TYPE_DOUBLE
:
{
double
first
=
*
(
double
*
)
f1
;
double
second
=
*
(
double
*
)
f2
;
//double first = *(double *)f1;
double
first
=
GET_DOUBLE_VAL
(
f1
);
//double second = *(double *)f2;
double
second
=
GET_DOUBLE_VAL
(
f2
);
if
(
first
==
second
)
{
return
0
;
}
return
(
first
<
second
)
?
-
1
:
1
;
};
case
TSDB_DATA_TYPE_FLOAT
:
{
float
first
=
*
(
float
*
)
f1
;
float
second
=
*
(
float
*
)
f2
;
//float first = *(float *)f1;
//float second = *(float *)f2;
float
first
=
GET_FLOAT_VAL
(
f1
);
float
second
=
GET_FLOAT_VAL
(
f2
);
if
(
first
==
second
)
{
return
0
;
}
...
...
@@ -1298,10 +1307,16 @@ double findOnlyResult(tMemBucket *pMemBucket) {
return
*
(
int8_t
*
)
pPage
->
data
;
case
TSDB_DATA_TYPE_BIGINT
:
return
(
double
)(
*
(
int64_t
*
)
pPage
->
data
);
case
TSDB_DATA_TYPE_DOUBLE
:
return
*
(
double
*
)
pPage
->
data
;
case
TSDB_DATA_TYPE_FLOAT
:
return
*
(
float
*
)
pPage
->
data
;
case
TSDB_DATA_TYPE_DOUBLE
:
{
double
dv
=
GET_DOUBLE_VAL
(
pPage
->
data
);
//return *(double *)pPage->data;
return
dv
;
}
case
TSDB_DATA_TYPE_FLOAT
:
{
float
fv
=
GET_FLOAT_VAL
(
pPage
->
data
);
//return *(float *)pPage->data;
return
fv
;
}
default:
return
0
;
}
...
...
@@ -1788,13 +1803,17 @@ double getPercentileImpl(tMemBucket *pMemBucket, int32_t count, double fraction)
break
;
};
case
TSDB_DATA_TYPE_FLOAT
:
{
td
=
*
(
float
*
)
thisVal
;
nd
=
*
(
float
*
)
nextVal
;
//td = *(float *)thisVal;
//nd = *(float *)nextVal;
td
=
GET_FLOAT_VAL
(
thisVal
);
nd
=
GET_FLOAT_VAL
(
nextVal
);
break
;
}
case
TSDB_DATA_TYPE_DOUBLE
:
{
td
=
*
(
double
*
)
thisVal
;
nd
=
*
(
double
*
)
nextVal
;
//td = *(double *)thisVal;
td
=
GET_DOUBLE_VAL
(
thisVal
);
//nd = *(double *)nextVal;
nd
=
GET_DOUBLE_VAL
(
nextVal
);
break
;
}
case
TSDB_DATA_TYPE_BIGINT
:
{
...
...
@@ -1831,15 +1850,17 @@ double getPercentileImpl(tMemBucket *pMemBucket, int32_t count, double fraction)
break
;
};
case
TSDB_DATA_TYPE_FLOAT
:
{
finalResult
=
*
(
float
*
)
thisVal
;
//finalResult = *(float *)thisVal;
finalResult
=
GET_FLOAT_VAL
(
thisVal
);
break
;
}
case
TSDB_DATA_TYPE_DOUBLE
:
{
finalResult
=
*
(
double
*
)
thisVal
;
//finalResult = *(double *)thisVal;
finalResult
=
GET_DOUBLE_VAL
(
thisVal
);
break
;
}
case
TSDB_DATA_TYPE_BIGINT
:
{
finalResult
=
(
double
)
*
(
int64_t
*
)
thisVal
;
finalResult
=
(
double
)
(
*
(
int64_t
*
)
thisVal
)
;
break
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录