Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
df5bcae1
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
df5bcae1
编写于
11月 23, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
d7c30d6e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
14 addition
and
22 deletion
+14
-22
include/common/tdataformat.h
include/common/tdataformat.h
+0
-2
include/common/trow.h
include/common/trow.h
+1
-1
source/common/src/tdataformat.c
source/common/src/tdataformat.c
+3
-8
source/common/src/trow.c
source/common/src/trow.c
+6
-6
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+4
-4
source/libs/parser/src/parInsertUtil.c
source/libs/parser/src/parInsertUtil.c
+0
-1
未找到文件。
include/common/tdataformat.h
浏览文件 @
df5bcae1
...
...
@@ -132,7 +132,6 @@ struct STSchema {
int32_t
numOfCols
;
int32_t
version
;
int32_t
flen
;
int32_t
vlen
;
int32_t
tlen
;
STColumn
columns
[];
};
...
...
@@ -232,7 +231,6 @@ typedef struct {
int32_t
nCols
;
schema_ver_t
version
;
uint16_t
flen
;
int32_t
vlen
;
int32_t
tlen
;
STColumn
*
columns
;
}
STSchemaBuilder
;
...
...
include/common/trow.h
浏览文件 @
df5bcae1
...
...
@@ -252,7 +252,7 @@ int32_t tdGetBitmapValTypeI(const void *pBitmap, int16_t colIdx, TDRowValT *pVal
*/
static
FORCE_INLINE
void
*
tdGetBitmapAddrTp
(
STSRow
*
pRow
,
uint32_t
flen
)
{
// The primary TS key is stored separatedly.
return
POINTER_SHIFT
(
TD_ROW_DATA
(
pRow
),
flen
-
sizeof
(
TSKEY
)
);
return
POINTER_SHIFT
(
TD_ROW_DATA
(
pRow
),
flen
);
// return POINTER_SHIFT(pRow->ts, flen);
}
...
...
source/common/src/tdataformat.c
浏览文件 @
df5bcae1
...
...
@@ -1108,7 +1108,6 @@ void tdResetTSchemaBuilder(STSchemaBuilder *pBuilder, schema_ver_t version) {
pBuilder
->
nCols
=
0
;
pBuilder
->
tlen
=
0
;
pBuilder
->
flen
=
0
;
pBuilder
->
vlen
=
0
;
pBuilder
->
version
=
version
;
}
...
...
@@ -1127,24 +1126,21 @@ int32_t tdAddColToSchema(STSchemaBuilder *pBuilder, int8_t type, int8_t flags, c
pCol
->
colId
=
colId
;
pCol
->
flags
=
flags
;
if
(
pBuilder
->
nCols
==
0
)
{
pCol
->
offset
=
0
;
pCol
->
offset
=
-
1
;
}
else
{
STColumn
*
pTCol
=
&
(
pBuilder
->
columns
[
pBuilder
->
nCols
-
1
])
;
p
Col
->
offset
=
pTCol
->
offset
+
TYPE_BYTES
[
pTCol
->
type
];
pCol
->
offset
=
pBuilder
->
flen
;
p
Builder
->
flen
+=
TYPE_BYTES
[
type
];
}
if
(
IS_VAR_DATA_TYPE
(
type
))
{
pCol
->
bytes
=
bytes
;
pBuilder
->
tlen
+=
(
TYPE_BYTES
[
type
]
+
bytes
);
pBuilder
->
vlen
+=
bytes
-
sizeof
(
VarDataLenT
);
}
else
{
pCol
->
bytes
=
TYPE_BYTES
[
type
];
pBuilder
->
tlen
+=
TYPE_BYTES
[
type
];
pBuilder
->
vlen
+=
TYPE_BYTES
[
type
];
}
pBuilder
->
nCols
++
;
pBuilder
->
flen
+=
TYPE_BYTES
[
type
];
ASSERT
(
pCol
->
offset
<
pBuilder
->
flen
);
...
...
@@ -1163,7 +1159,6 @@ STSchema *tdGetSchemaFromBuilder(STSchemaBuilder *pBuilder) {
pSchema
->
numOfCols
=
pBuilder
->
nCols
;
pSchema
->
tlen
=
pBuilder
->
tlen
;
pSchema
->
flen
=
pBuilder
->
flen
;
pSchema
->
vlen
=
pBuilder
->
vlen
;
#ifdef TD_SUPPORT_BITMAP
pSchema
->
tlen
+=
(
int
)
TD_BITMAP_BYTES
(
pSchema
->
numOfCols
);
...
...
source/common/src/trow.c
浏览文件 @
df5bcae1
...
...
@@ -192,7 +192,7 @@ bool tdSTpRowGetVal(STSRow *pRow, col_id_t colId, col_type_t colType, int32_t fl
return
true
;
}
void
*
pBitmap
=
tdGetBitmapAddrTp
(
pRow
,
flen
);
tdGetTpRowValOfCol
(
pVal
,
pRow
,
pBitmap
,
colType
,
offset
-
sizeof
(
TSKEY
)
,
colIdx
);
tdGetTpRowValOfCol
(
pVal
,
pRow
,
pBitmap
,
colType
,
offset
,
colIdx
);
return
true
;
}
...
...
@@ -217,7 +217,7 @@ bool tdSTSRowIterFetch(STSRowIter *pIter, col_id_t colId, col_type_t colType, SC
return
false
;
}
}
tdSTSRowIterGetTpVal
(
pIter
,
pCol
->
type
,
pCol
->
offset
-
sizeof
(
TSKEY
)
,
pVal
);
tdSTSRowIterGetTpVal
(
pIter
,
pCol
->
type
,
pCol
->
offset
,
pVal
);
++
pIter
->
colIdx
;
}
else
if
(
TD_IS_KV_ROW
(
pIter
->
pRow
))
{
return
tdSTSRowIterGetKvVal
(
pIter
,
colId
,
&
pIter
->
kvIdx
,
pVal
);
...
...
@@ -244,7 +244,7 @@ bool tdSTSRowIterNext(STSRowIter *pIter, SCellVal *pVal) {
}
if
(
TD_IS_TP_ROW
(
pIter
->
pRow
))
{
tdSTSRowIterGetTpVal
(
pIter
,
pCol
->
type
,
pCol
->
offset
-
sizeof
(
TSKEY
)
,
pVal
);
tdSTSRowIterGetTpVal
(
pIter
,
pCol
->
type
,
pCol
->
offset
,
pVal
);
}
else
if
(
TD_IS_KV_ROW
(
pIter
->
pRow
))
{
tdSTSRowIterGetKvVal
(
pIter
,
pCol
->
colId
,
&
pIter
->
kvIdx
,
pVal
);
}
else
{
...
...
@@ -467,7 +467,7 @@ bool tdSTSRowGetVal(STSRowIter *pIter, col_id_t colId, col_type_t colType, SCell
#ifdef TD_SUPPORT_BITMAP
colIdx
=
POINTER_DISTANCE
(
pCol
,
pSchema
->
columns
)
/
sizeof
(
STColumn
);
#endif
tdGetTpRowValOfCol
(
pVal
,
pRow
,
pIter
->
pBitmap
,
pCol
->
type
,
pCol
->
offset
-
sizeof
(
TSKEY
)
,
colIdx
-
1
);
tdGetTpRowValOfCol
(
pVal
,
pRow
,
pIter
->
pBitmap
,
pCol
->
type
,
pCol
->
offset
,
colIdx
-
1
);
}
else
if
(
TD_IS_KV_ROW
(
pRow
))
{
SKvRowIdx
*
pIdx
=
(
SKvRowIdx
*
)
taosbsearch
(
&
colId
,
TD_ROW_COL_IDX
(
pRow
),
tdRowGetNCols
(
pRow
),
sizeof
(
SKvRowIdx
),
compareKvRowColId
,
TD_EQ
);
...
...
@@ -755,7 +755,7 @@ int32_t tdAppendColValToKvRow(SRowBuilder *pBuilder, TDRowValT valType, const vo
int32_t
tdAppendColValToTpRow
(
SRowBuilder
*
pBuilder
,
TDRowValT
valType
,
const
void
*
val
,
bool
isCopyVarData
,
int8_t
colType
,
int16_t
colIdx
,
int32_t
offset
)
{
if
(
(
offset
<
(
int32_t
)
sizeof
(
TSKEY
))
||
(
colIdx
<
1
)
)
{
if
(
colIdx
<
1
)
{
terrno
=
TSDB_CODE_INVALID_PARA
;
return
terrno
;
}
...
...
@@ -851,7 +851,7 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
memset
(
pBuilder
->
pBitmap
,
TD_VTYPE_NONE_BYTE_II
,
pBuilder
->
nBitmaps
);
#endif
// the primary TS key is stored separatedly
len
=
TD_ROW_HEAD_LEN
+
pBuilder
->
flen
-
sizeof
(
TSKEY
)
+
pBuilder
->
nBitmaps
;
len
=
TD_ROW_HEAD_LEN
+
pBuilder
->
flen
+
pBuilder
->
nBitmaps
;
TD_ROW_SET_LEN
(
pBuilder
->
pBuf
,
len
);
TD_ROW_SET_SVER
(
pBuilder
->
pBuf
,
pBuilder
->
sver
);
break
;
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
df5bcae1
...
...
@@ -1084,11 +1084,11 @@ static int32_t tBlockDataAppendTPRow(SBlockData *pBlockData, STSRow *pRow, STSch
cv
.
flag
=
CV_FLAG_VALUE
;
if
(
IS_VAR_DATA_TYPE
(
pTColumn
->
type
))
{
void
*
pData
=
(
char
*
)
pRow
+
*
(
int32_t
*
)(
pRow
->
data
+
pTColumn
->
offset
-
sizeof
(
TSKEY
)
);
void
*
pData
=
(
char
*
)
pRow
+
*
(
int32_t
*
)(
pRow
->
data
+
pTColumn
->
offset
);
cv
.
value
.
nData
=
varDataLen
(
pData
);
cv
.
value
.
pData
=
varDataVal
(
pData
);
}
else
{
memcpy
(
&
cv
.
value
.
val
,
pRow
->
data
+
pTColumn
->
offset
-
sizeof
(
TSKEY
)
,
pTColumn
->
bytes
);
memcpy
(
&
cv
.
value
.
val
,
pRow
->
data
+
pTColumn
->
offset
,
pTColumn
->
bytes
);
}
code
=
tColDataAppendValue
(
pColData
,
&
cv
);
...
...
@@ -1106,11 +1106,11 @@ static int32_t tBlockDataAppendTPRow(SBlockData *pBlockData, STSRow *pRow, STSch
cv
.
flag
=
CV_FLAG_VALUE
;
if
(
IS_VAR_DATA_TYPE
(
pTColumn
->
type
))
{
void
*
pData
=
(
char
*
)
pRow
+
*
(
int32_t
*
)(
pRow
->
data
+
pTColumn
->
offset
-
sizeof
(
TSKEY
)
);
void
*
pData
=
(
char
*
)
pRow
+
*
(
int32_t
*
)(
pRow
->
data
+
pTColumn
->
offset
);
cv
.
value
.
nData
=
varDataLen
(
pData
);
cv
.
value
.
pData
=
varDataVal
(
pData
);
}
else
{
memcpy
(
&
cv
.
value
.
val
,
pRow
->
data
+
pTColumn
->
offset
-
sizeof
(
TSKEY
)
,
pTColumn
->
bytes
);
memcpy
(
&
cv
.
value
.
val
,
pRow
->
data
+
pTColumn
->
offset
,
pTColumn
->
bytes
);
}
code
=
tColDataAppendValue
(
pColData
,
&
cv
);
...
...
source/libs/parser/src/parInsertUtil.c
浏览文件 @
df5bcae1
...
...
@@ -140,7 +140,6 @@ void insSetBoundColumnInfo(SParsedDataColInfo* pColList, SSchema* pSchema, col_i
pColList
->
cols
[
i
].
offset
=
pColList
->
cols
[
i
-
1
].
offset
+
pSchema
[
i
-
1
].
bytes
;
pColList
->
cols
[
i
].
toffset
=
pColList
->
flen
;
}
pColList
->
flen
+=
TYPE_BYTES
[
type
];
switch
(
type
)
{
case
TSDB_DATA_TYPE_BINARY
:
pColList
->
allNullLen
+=
(
VARSTR_HEADER_SIZE
+
CHAR_BYTES
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录