Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
c28ac166
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看板
提交
c28ac166
编写于
7月 01, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix compile issue on Windows
上级
7f49ece3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
68 deletion
+7
-68
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+1
-28
src/common/inc/tdataformat.h
src/common/inc/tdataformat.h
+3
-35
src/common/src/tdataformat.c
src/common/src/tdataformat.c
+2
-4
src/inc/ttype.h
src/inc/ttype.h
+1
-1
未找到文件。
src/client/src/tscUtil.c
浏览文件 @
c28ac166
...
@@ -1640,33 +1640,6 @@ int32_t tscGetDataBlockFromList(SHashObj* pHashList, int64_t id, int32_t size, i
...
@@ -1640,33 +1640,6 @@ int32_t tscGetDataBlockFromList(SHashObj* pHashList, int64_t id, int32_t size, i
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
// int tdInitMemRowBuilder(SMemRowBuilder* pBuilder) {
// pBuilder->pSchema = NULL;
// pBuilder->sversion = 0;
// pBuilder->tCols = 128;
// pBuilder->nCols = 0;
// pBuilder->pColIdx = (SColIdx*)malloc(sizeof(SColIdx) * pBuilder->tCols);
// if (pBuilder->pColIdx == NULL) return -1;
// pBuilder->alloc = 1024;
// pBuilder->size = 0;
// pBuilder->buf = malloc(pBuilder->alloc);
// if (pBuilder->buf == NULL) {
// free(pBuilder->pColIdx);
// return -1;
// }
// return 0;
// }
// void tdDestroyMemRowBuilder(SMemRowBuilder* pBuilder) {
// tfree(pBuilder->pColIdx);
// tfree(pBuilder->buf);
// }
// void tdResetMemRowBuilder(SMemRowBuilder* pBuilder) {
// pBuilder->nCols = 0;
// pBuilder->size = 0;
// }
#define KvRowNColsThresh 1 // default value: 1200 TODO: for test, restore to default value after test finished
#define KvRowNColsThresh 1 // default value: 1200 TODO: for test, restore to default value after test finished
static
FORCE_INLINE
uint8_t
tdRowTypeJudger
(
SSchema
*
pSchema
,
void
*
pData
,
int32_t
nCols
,
int32_t
flen
,
static
FORCE_INLINE
uint8_t
tdRowTypeJudger
(
SSchema
*
pSchema
,
void
*
pData
,
int32_t
nCols
,
int32_t
flen
,
...
@@ -1700,7 +1673,7 @@ static FORCE_INLINE uint8_t tdRowTypeJudger(SSchema* pSchema, void* pData, int32
...
@@ -1700,7 +1673,7 @@ static FORCE_INLINE uint8_t tdRowTypeJudger(SSchema* pSchema, void* pData, int32
p
+=
pSchema
[
i
].
bytes
;
p
+=
pSchema
[
i
].
bytes
;
}
}
tscDebug
(
"
prop:
nColsNull %d, nCols: %d, kvRowLen: %d, dataRowLen: %d"
,
(
int32_t
)
nColsNull
,
nCols
,
kvRowLength
,
tscDebug
(
"nColsNull %d, nCols: %d, kvRowLen: %d, dataRowLen: %d"
,
(
int32_t
)
nColsNull
,
nCols
,
kvRowLength
,
dataRowLength
);
dataRowLength
);
if
(
kvRowLength
<
dataRowLength
)
{
if
(
kvRowLength
<
dataRowLength
)
{
...
...
src/common/inc/tdataformat.h
浏览文件 @
c28ac166
...
@@ -255,13 +255,12 @@ static FORCE_INLINE int tdAppendColVal(SDataRow row, const void *value, int8_t t
...
@@ -255,13 +255,12 @@ static FORCE_INLINE int tdAppendColVal(SDataRow row, const void *value, int8_t t
}
}
// NOTE: offset here including the header size
// NOTE: offset here including the header size
static
FORCE_INLINE
void
*
tdGetRowDataOfCol
(
SDataRow
*
row
,
int8_t
type
,
int32_t
offset
)
{
static
FORCE_INLINE
void
*
tdGetRowDataOfCol
(
SDataRow
row
,
int8_t
type
,
int32_t
offset
)
{
if
(
IS_VAR_DATA_TYPE
(
type
))
{
if
(
IS_VAR_DATA_TYPE
(
type
))
{
return
POINTER_SHIFT
(
row
,
*
(
VarDataOffsetT
*
)
POINTER_SHIFT
(
row
,
offset
));
return
POINTER_SHIFT
(
row
,
*
(
VarDataOffsetT
*
)
POINTER_SHIFT
(
row
,
offset
));
}
else
{
}
else
{
return
POINTER_SHIFT
(
row
,
offset
);
return
POINTER_SHIFT
(
row
,
offset
);
}
}
return
NULL
;
}
}
// ----------------- Data column structure
// ----------------- Data column structure
...
@@ -281,42 +280,12 @@ typedef struct SDataCol {
...
@@ -281,42 +280,12 @@ typedef struct SDataCol {
static
FORCE_INLINE
void
dataColReset
(
SDataCol
*
pDataCol
)
{
pDataCol
->
len
=
0
;
}
static
FORCE_INLINE
void
dataColReset
(
SDataCol
*
pDataCol
)
{
pDataCol
->
len
=
0
;
}
void
dataColInit
(
SDataCol
*
pDataCol
,
STColumn
*
pCol
,
void
**
pBuf
,
int
maxPoints
);
void
dataColInit
(
SDataCol
*
pDataCol
,
STColumn
*
pCol
,
void
**
pBuf
,
int
maxPoints
);
void
dataColAppendVal
(
SDataCol
*
pCol
,
const
void
*
value
,
int
numOfRows
,
int
maxPoints
);
void
dataColSetOffset
(
SDataCol
*
pCol
,
int
nEle
);
void
dataColSetOffset
(
SDataCol
*
pCol
,
int
nEle
);
bool
isNEleNull
(
SDataCol
*
pCol
,
int
nEle
);
bool
isNEleNull
(
SDataCol
*
pCol
,
int
nEle
);
void
dataColSetNEleNull
(
SDataCol
*
pCol
,
int
nEle
,
int
maxPoints
);
void
dataColSetNEleNull
(
SDataCol
*
pCol
,
int
nEle
,
int
maxPoints
);
FORCE_INLINE
void
dataColAppendVal
(
SDataCol
*
pCol
,
const
void
*
value
,
int
numOfRows
,
int
maxPoints
);
// value from timestamp should be TKEY here instead of TSKEY
FORCE_INLINE
void
dataColAppendVal
(
SDataCol
*
pCol
,
const
void
*
value
,
int
numOfRows
,
int
maxPoints
)
{
ASSERT
(
pCol
!=
NULL
&&
value
!=
NULL
);
if
(
pCol
->
len
==
0
)
{
if
(
isNull
(
value
,
pCol
->
type
))
{
// all null value yet, just return
return
;
}
if
(
numOfRows
>
0
)
{
// Find the first not null value, fill all previous values as NULL
dataColSetNEleNull
(
pCol
,
numOfRows
,
maxPoints
);
}
}
if
(
IS_VAR_DATA_TYPE
(
pCol
->
type
))
{
// set offset
pCol
->
dataOff
[
numOfRows
]
=
pCol
->
len
;
// Copy data
memcpy
(
POINTER_SHIFT
(
pCol
->
pData
,
pCol
->
len
),
value
,
varDataTLen
(
value
));
// Update the length
pCol
->
len
+=
varDataTLen
(
value
);
}
else
{
ASSERT
(
pCol
->
len
==
TYPE_BYTES
[
pCol
->
type
]
*
numOfRows
);
memcpy
(
POINTER_SHIFT
(
pCol
->
pData
,
pCol
->
len
),
value
,
pCol
->
bytes
);
pCol
->
len
+=
pCol
->
bytes
;
}
}
static
FORCE_INLINE
const
void
*
tdGetNullVal
(
int8_t
type
)
{
static
FORCE_INLINE
const
void
*
tdGetNullVal
(
int8_t
type
)
{
switch
(
type
)
{
switch
(
type
)
{
case
TSDB_DATA_TYPE_BOOL
:
case
TSDB_DATA_TYPE_BOOL
:
...
@@ -456,7 +425,7 @@ typedef struct {
...
@@ -456,7 +425,7 @@ typedef struct {
#define kvRowNCols(r) (*(int16_t *)POINTER_SHIFT(r, sizeof(uint16_t)))
#define kvRowNCols(r) (*(int16_t *)POINTER_SHIFT(r, sizeof(uint16_t)))
#define kvRowSetLen(r, len) kvRowLen(r) = (len)
#define kvRowSetLen(r, len) kvRowLen(r) = (len)
#define kvRowSetNCols(r, n) kvRowNCols(r) = (n)
#define kvRowSetNCols(r, n) kvRowNCols(r) = (n)
#define kvRowColIdx(r) (
(SColIdx *)POINTER_SHIFT(r, TD_KV_ROW_HEAD_SIZE)
)
#define kvRowColIdx(r) (
SColIdx *)POINTER_SHIFT(r, TD_KV_ROW_HEAD_SIZE
)
#define kvRowValues(r) POINTER_SHIFT(r, TD_KV_ROW_HEAD_SIZE + sizeof(SColIdx) * kvRowNCols(r))
#define kvRowValues(r) POINTER_SHIFT(r, TD_KV_ROW_HEAD_SIZE + sizeof(SColIdx) * kvRowNCols(r))
#define kvRowCpy(dst, r) memcpy((dst), (r), kvRowLen(r))
#define kvRowCpy(dst, r) memcpy((dst), (r), kvRowLen(r))
#define kvRowColVal(r, colIdx) POINTER_SHIFT(kvRowValues(r), (colIdx)->offset)
#define kvRowColVal(r, colIdx) POINTER_SHIFT(kvRowValues(r), (colIdx)->offset)
...
@@ -464,7 +433,6 @@ typedef struct {
...
@@ -464,7 +433,6 @@ typedef struct {
#define kvRowFree(r) tfree(r)
#define kvRowFree(r) tfree(r)
#define kvRowEnd(r) POINTER_SHIFT(r, kvRowLen(r))
#define kvRowEnd(r) POINTER_SHIFT(r, kvRowLen(r))
#define kvRowVersion(r) (-1)
#define kvRowVersion(r) (-1)
#define kvRowTKey(r) (*(TKEY *)(kvRowValues(r)))
#define kvRowTKey(r) (*(TKEY *)(kvRowValues(r)))
#define kvRowKey(r) tdGetKey(kvRowTKey(r))
#define kvRowKey(r) tdGetKey(kvRowTKey(r))
#define kvRowDeleted(r) TKEY_IS_DELETED(kvRowTKey(r))
#define kvRowDeleted(r) TKEY_IS_DELETED(kvRowTKey(r))
...
...
src/common/src/tdataformat.c
浏览文件 @
c28ac166
...
@@ -225,7 +225,7 @@ void dataColInit(SDataCol *pDataCol, STColumn *pCol, void **pBuf, int maxPoints)
...
@@ -225,7 +225,7 @@ void dataColInit(SDataCol *pDataCol, STColumn *pCol, void **pBuf, int maxPoints)
pDataCol
->
type
=
colType
(
pCol
);
pDataCol
->
type
=
colType
(
pCol
);
pDataCol
->
colId
=
colColId
(
pCol
);
pDataCol
->
colId
=
colColId
(
pCol
);
pDataCol
->
bytes
=
colBytes
(
pCol
);
pDataCol
->
bytes
=
colBytes
(
pCol
);
pDataCol
->
offset
=
colOffset
(
pCol
)
+
TD_
MEM
_ROW_HEAD_SIZE
;
pDataCol
->
offset
=
colOffset
(
pCol
)
+
TD_
DATA
_ROW_HEAD_SIZE
;
pDataCol
->
len
=
0
;
pDataCol
->
len
=
0
;
if
(
IS_VAR_DATA_TYPE
(
pDataCol
->
type
))
{
if
(
IS_VAR_DATA_TYPE
(
pDataCol
->
type
))
{
...
@@ -240,7 +240,6 @@ void dataColInit(SDataCol *pDataCol, STColumn *pCol, void **pBuf, int maxPoints)
...
@@ -240,7 +240,6 @@ void dataColInit(SDataCol *pDataCol, STColumn *pCol, void **pBuf, int maxPoints)
*
pBuf
=
POINTER_SHIFT
(
*
pBuf
,
pDataCol
->
spaceSize
);
*
pBuf
=
POINTER_SHIFT
(
*
pBuf
,
pDataCol
->
spaceSize
);
}
}
}
}
#if 0
// value from timestamp should be TKEY here instead of TSKEY
// value from timestamp should be TKEY here instead of TSKEY
void
dataColAppendVal
(
SDataCol
*
pCol
,
const
void
*
value
,
int
numOfRows
,
int
maxPoints
)
{
void
dataColAppendVal
(
SDataCol
*
pCol
,
const
void
*
value
,
int
numOfRows
,
int
maxPoints
)
{
ASSERT
(
pCol
!=
NULL
&&
value
!=
NULL
);
ASSERT
(
pCol
!=
NULL
&&
value
!=
NULL
);
...
@@ -270,7 +269,6 @@ void dataColAppendVal(SDataCol *pCol, const void *value, int numOfRows, int maxP
...
@@ -270,7 +269,6 @@ void dataColAppendVal(SDataCol *pCol, const void *value, int numOfRows, int maxP
pCol
->
len
+=
pCol
->
bytes
;
pCol
->
len
+=
pCol
->
bytes
;
}
}
}
}
#endif
bool
isNEleNull
(
SDataCol
*
pCol
,
int
nEle
)
{
bool
isNEleNull
(
SDataCol
*
pCol
,
int
nEle
)
{
for
(
int
i
=
0
;
i
<
nEle
;
i
++
)
{
for
(
int
i
=
0
;
i
<
nEle
;
i
++
)
{
...
@@ -648,7 +646,7 @@ int tdSetKVRowDataOfCol(SKVRow *orow, int16_t colId, int8_t type, void *value) {
...
@@ -648,7 +646,7 @@ int tdSetKVRowDataOfCol(SKVRow *orow, int16_t colId, int8_t type, void *value) {
void
*
ptr
=
taosbsearch
(
&
colId
,
kvRowColIdx
(
row
),
kvRowNCols
(
row
),
sizeof
(
SColIdx
),
comparTagId
,
TD_GE
);
void
*
ptr
=
taosbsearch
(
&
colId
,
kvRowColIdx
(
row
),
kvRowNCols
(
row
),
sizeof
(
SColIdx
),
comparTagId
,
TD_GE
);
if
(
ptr
==
NULL
||
((
SColIdx
*
)
ptr
)
->
colId
>
colId
)
{
// need to add a column value to the row
if
(
ptr
==
NULL
||
((
SColIdx
*
)
ptr
)
->
colId
>
colId
)
{
// need to add a column value to the row
uint16_
t
diff
=
IS_VAR_DATA_TYPE
(
type
)
?
varDataTLen
(
value
)
:
TYPE_BYTES
[
type
];
in
t
diff
=
IS_VAR_DATA_TYPE
(
type
)
?
varDataTLen
(
value
)
:
TYPE_BYTES
[
type
];
nrow
=
malloc
(
kvRowLen
(
row
)
+
sizeof
(
SColIdx
)
+
diff
);
nrow
=
malloc
(
kvRowLen
(
row
)
+
sizeof
(
SColIdx
)
+
diff
);
if
(
nrow
==
NULL
)
return
-
1
;
if
(
nrow
==
NULL
)
return
-
1
;
...
...
src/inc/ttype.h
浏览文件 @
c28ac166
...
@@ -121,7 +121,7 @@ typedef struct tstr {
...
@@ -121,7 +121,7 @@ typedef struct tstr {
#define IS_VALID_UINT(_t) ((_t) >= 0 && (_t) < UINT32_MAX)
#define IS_VALID_UINT(_t) ((_t) >= 0 && (_t) < UINT32_MAX)
#define IS_VALID_UBIGINT(_t) ((_t) >= 0 && (_t) < UINT64_MAX)
#define IS_VALID_UBIGINT(_t) ((_t) >= 0 && (_t) < UINT64_MAX)
FORCE_INLINE
bool
isNull
(
const
char
*
val
,
int32_t
type
)
{
static
FORCE_INLINE
bool
isNull
(
const
char
*
val
,
int32_t
type
)
{
switch
(
type
)
{
switch
(
type
)
{
case
TSDB_DATA_TYPE_BOOL
:
case
TSDB_DATA_TYPE_BOOL
:
return
*
(
uint8_t
*
)
val
==
TSDB_DATA_BOOL_NULL
;
return
*
(
uint8_t
*
)
val
==
TSDB_DATA_BOOL_NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录