Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
cfb61d66
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看板
提交
cfb61d66
编写于
8月 10, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: row iter
上级
1d6d0aa2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
7 deletion
+7
-7
include/common/trow.h
include/common/trow.h
+1
-1
source/common/src/trow.c
source/common/src/trow.c
+6
-6
未找到文件。
include/common/trow.h
浏览文件 @
cfb61d66
...
@@ -256,7 +256,7 @@ static FORCE_INLINE void *tdGetBitmapAddrTp(STSRow *pRow, uint32_t flen) {
...
@@ -256,7 +256,7 @@ static FORCE_INLINE void *tdGetBitmapAddrTp(STSRow *pRow, uint32_t flen) {
static
FORCE_INLINE
void
*
tdGetBitmapAddrKv
(
STSRow
*
pRow
,
col_id_t
nKvCols
)
{
static
FORCE_INLINE
void
*
tdGetBitmapAddrKv
(
STSRow
*
pRow
,
col_id_t
nKvCols
)
{
// The primary TS key is stored separatedly and is Norm value, thus should minus 1 firstly
// The primary TS key is stored separatedly and is Norm value, thus should minus 1 firstly
return
POINTER_SHIFT
(
TD_ROW_COL_IDX
(
pRow
),
nKvCols
*
sizeof
(
SKvRowIdx
));
return
POINTER_SHIFT
(
TD_ROW_COL_IDX
(
pRow
),
(
--
nKvCols
)
*
sizeof
(
SKvRowIdx
));
}
}
void
*
tdGetBitmapAddr
(
STSRow
*
pRow
,
uint8_t
rowType
,
uint32_t
flen
,
col_id_t
nKvCols
);
void
*
tdGetBitmapAddr
(
STSRow
*
pRow
,
uint8_t
rowType
,
uint32_t
flen
,
col_id_t
nKvCols
);
int32_t
tdSetBitmapValType
(
void
*
pBitmap
,
int16_t
colIdx
,
TDRowValT
valType
,
int8_t
bitmapMode
);
int32_t
tdSetBitmapValType
(
void
*
pBitmap
,
int16_t
colIdx
,
TDRowValT
valType
,
int8_t
bitmapMode
);
...
...
source/common/src/trow.c
浏览文件 @
cfb61d66
...
@@ -427,7 +427,7 @@ bool tdSKvRowGetVal(STSRow *pRow, col_id_t colId, col_id_t colIdx, SCellVal *pVa
...
@@ -427,7 +427,7 @@ bool tdSKvRowGetVal(STSRow *pRow, col_id_t colId, col_id_t colIdx, SCellVal *pVa
tdRowSetVal
(
pVal
,
TD_VTYPE_NORM
,
TD_ROW_KEY_ADDR
(
pRow
));
tdRowSetVal
(
pVal
,
TD_VTYPE_NORM
,
TD_ROW_KEY_ADDR
(
pRow
));
return
true
;
return
true
;
}
}
int16_t
nCols
=
tdRowGetNCols
(
pRow
);
int16_t
nCols
=
tdRowGetNCols
(
pRow
)
-
1
;
if
(
nCols
<=
0
)
{
if
(
nCols
<=
0
)
{
pVal
->
valType
=
TD_VTYPE_NONE
;
pVal
->
valType
=
TD_VTYPE_NONE
;
return
true
;
return
true
;
...
@@ -488,7 +488,7 @@ bool tdGetKvRowValOfColEx(STSRowIter *pIter, col_id_t colId, col_id_t *nIdx, SCe
...
@@ -488,7 +488,7 @@ bool tdGetKvRowValOfColEx(STSRowIter *pIter, col_id_t colId, col_id_t *nIdx, SCe
STSRow
*
pRow
=
pIter
->
pRow
;
STSRow
*
pRow
=
pIter
->
pRow
;
SKvRowIdx
*
pKvIdx
=
NULL
;
SKvRowIdx
*
pKvIdx
=
NULL
;
bool
colFound
=
false
;
bool
colFound
=
false
;
col_id_t
kvNCols
=
tdRowGetNCols
(
pRow
);
col_id_t
kvNCols
=
tdRowGetNCols
(
pRow
)
-
1
;
void
*
pColIdx
=
TD_ROW_COL_IDX
(
pRow
);
void
*
pColIdx
=
TD_ROW_COL_IDX
(
pRow
);
while
(
*
nIdx
<
kvNCols
)
{
while
(
*
nIdx
<
kvNCols
)
{
...
@@ -534,7 +534,7 @@ bool tdGetTpRowDataOfCol(STSRowIter *pIter, col_type_t colType, int32_t offset,
...
@@ -534,7 +534,7 @@ bool tdGetTpRowDataOfCol(STSRowIter *pIter, col_type_t colType, int32_t offset,
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
if
(
tdGetBitmapValType
(
pIter
->
pBitmap
,
pIter
->
colIdx
,
&
pVal
->
valType
,
0
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
tdGetBitmapValType
(
pIter
->
pBitmap
,
pIter
->
colIdx
-
1
,
&
pVal
->
valType
,
0
)
!=
TSDB_CODE_SUCCESS
)
{
pVal
->
valType
=
TD_VTYPE_NONE
;
pVal
->
valType
=
TD_VTYPE_NONE
;
return
terrno
;
return
terrno
;
}
}
...
@@ -814,7 +814,7 @@ int32_t tdSetBitmapValTypeI(void *pBitmap, int16_t colIdx, TDRowValT valType) {
...
@@ -814,7 +814,7 @@ int32_t tdSetBitmapValTypeI(void *pBitmap, int16_t colIdx, TDRowValT valType) {
int32_t
tdGetKvRowValOfCol
(
SCellVal
*
output
,
STSRow
*
pRow
,
void
*
pBitmap
,
int32_t
offset
,
int16_t
colIdx
)
{
int32_t
tdGetKvRowValOfCol
(
SCellVal
*
output
,
STSRow
*
pRow
,
void
*
pBitmap
,
int32_t
offset
,
int16_t
colIdx
)
{
#ifdef TD_SUPPORT_BITMAP
#ifdef TD_SUPPORT_BITMAP
TASSERT
(
colIdx
<
tdRowGetNCols
(
pRow
));
TASSERT
(
colIdx
<
tdRowGetNCols
(
pRow
)
-
1
);
if
(
tdGetBitmapValType
(
pBitmap
,
colIdx
,
&
output
->
valType
,
0
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
tdGetBitmapValType
(
pBitmap
,
colIdx
,
&
output
->
valType
,
0
)
!=
TSDB_CODE_SUCCESS
)
{
output
->
valType
=
TD_VTYPE_NONE
;
output
->
valType
=
TD_VTYPE_NONE
;
return
terrno
;
return
terrno
;
...
@@ -1054,14 +1054,14 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
...
@@ -1054,14 +1054,14 @@ int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
break
;
break
;
case
TD_ROW_KV
:
case
TD_ROW_KV
:
#ifdef TD_SUPPORT_BITMAP
#ifdef TD_SUPPORT_BITMAP
pBuilder
->
pBitmap
=
tdGetBitmapAddrKv
(
pBuilder
->
pBuf
,
pBuilder
->
nBoundCols
-
1
);
pBuilder
->
pBitmap
=
tdGetBitmapAddrKv
(
pBuilder
->
pBuf
,
pBuilder
->
nBoundCols
);
memset
(
pBuilder
->
pBitmap
,
TD_VTYPE_NONE_BYTE_II
,
pBuilder
->
nBoundBitmaps
);
memset
(
pBuilder
->
pBitmap
,
TD_VTYPE_NONE_BYTE_II
,
pBuilder
->
nBoundBitmaps
);
#endif
#endif
len
=
TD_ROW_HEAD_LEN
+
TD_ROW_NCOLS_LEN
+
(
pBuilder
->
nBoundCols
-
1
)
*
sizeof
(
SKvRowIdx
)
+
len
=
TD_ROW_HEAD_LEN
+
TD_ROW_NCOLS_LEN
+
(
pBuilder
->
nBoundCols
-
1
)
*
sizeof
(
SKvRowIdx
)
+
pBuilder
->
nBoundBitmaps
;
// add
pBuilder
->
nBoundBitmaps
;
// add
TD_ROW_SET_LEN
(
pBuilder
->
pBuf
,
len
);
TD_ROW_SET_LEN
(
pBuilder
->
pBuf
,
len
);
TD_ROW_SET_SVER
(
pBuilder
->
pBuf
,
pBuilder
->
sver
);
TD_ROW_SET_SVER
(
pBuilder
->
pBuf
,
pBuilder
->
sver
);
TD_ROW_SET_NCOLS
(
pBuilder
->
pBuf
,
pBuilder
->
nBoundCols
-
1
);
TD_ROW_SET_NCOLS
(
pBuilder
->
pBuf
,
pBuilder
->
nBoundCols
);
break
;
break
;
default:
default:
TASSERT
(
0
);
TASSERT
(
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录