Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a49fba71
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看板
未验证
提交
a49fba71
编写于
3月 23, 2022
作者:
C
Cary Xu
提交者:
GitHub
3月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #10940 from taosdata/feature/TD-11463-3.0
reset buf
上级
bb04d43a
867ca85a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
50 addition
and
9 deletion
+50
-9
include/common/trow.h
include/common/trow.h
+3
-0
source/common/src/tdataformat.c
source/common/src/tdataformat.c
+2
-0
source/common/src/trow.c
source/common/src/trow.c
+44
-8
tests/script/jenkins/basic.txt
tests/script/jenkins/basic.txt
+1
-1
未找到文件。
include/common/trow.h
浏览文件 @
a49fba71
...
...
@@ -166,6 +166,7 @@ typedef struct {
#define TD_ROW_HEAD_LEN (sizeof(STSRow))
#define TD_ROW_NCOLS_LEN (sizeof(col_id_t))
#define TD_ROW_INFO(r) ((r)->info)
#define TD_ROW_TYPE(r) ((r)->type)
#define TD_ROW_DELETE(r) ((r)->del)
#define TD_ROW_ENDIAN(r) ((r)->endian)
...
...
@@ -180,6 +181,7 @@ typedef struct {
// (int32_t)ceil((double)nCols/TD_VTYPE_PARTS) should be added if TD_SUPPORT_BITMAP defined.
#define TD_ROW_MAX_BYTES_FROM_SCHEMA(s) (schemaTLen(s) + TD_ROW_HEAD_LEN)
#define TD_ROW_SET_INFO(r, i) (TD_ROW_INFO(r) = (i))
#define TD_ROW_SET_TYPE(r, t) (TD_ROW_TYPE(r) = (t))
#define TD_ROW_SET_DELETE(r) (TD_ROW_DELETE(r) = 1)
#define TD_ROW_SET_SVER(r, v) (TD_ROW_SVER(r) = (v))
...
...
@@ -473,6 +475,7 @@ static int32_t tdSRowResetBuf(SRowBuilder *pBuilder, void *pBuf) {
return
terrno
;
}
TD_ROW_SET_INFO
(
pBuilder
->
pBuf
,
0
);
TD_ROW_SET_TYPE
(
pBuilder
->
pBuf
,
pBuilder
->
rowType
);
uint32_t
len
=
0
;
...
...
source/common/src/tdataformat.c
浏览文件 @
a49fba71
...
...
@@ -421,6 +421,7 @@ SDataCols *tdFreeDataCols(SDataCols *pCols) {
return
NULL
;
}
#if 0
SDataCols *tdDupDataCols(SDataCols *pDataCols, bool keepData) {
SDataCols *pRet = tdNewDataCols(pDataCols->maxCols, pDataCols->maxPoints);
if (pRet == NULL) return NULL;
...
...
@@ -454,6 +455,7 @@ SDataCols *tdDupDataCols(SDataCols *pDataCols, bool keepData) {
return pRet;
}
#endif
void
tdResetDataCols
(
SDataCols
*
pCols
)
{
if
(
pCols
!=
NULL
)
{
...
...
source/common/src/trow.c
浏览文件 @
a49fba71
...
...
@@ -78,7 +78,7 @@ static FORCE_INLINE void dataColSetNoneAt(SDataCol *pCol, int index, bool setBit
setNull
(
POINTER_SHIFT
(
pCol
->
pData
,
TYPE_BYTES
[
pCol
->
type
]
*
index
),
pCol
->
type
,
pCol
->
bytes
);
pCol
->
len
+=
TYPE_BYTES
[
pCol
->
type
];
}
if
(
setBitmap
)
{
if
(
setBitmap
)
{
tdSetBitmapValType
(
pCol
->
pBitmap
,
index
,
TD_VTYPE_NONE
);
}
}
...
...
@@ -118,8 +118,8 @@ int trbWriteCol(SRowBuilder *pRB, void *pData, col_id_t cid) {
#endif
STSRow
*
tdRowDup
(
STSRow
*
row
)
{
STSRow
*
trow
=
malloc
(
TD_ROW_LEN
(
row
));
STSRow
*
tdRowDup
(
STSRow
*
row
)
{
STSRow
*
trow
=
malloc
(
TD_ROW_LEN
(
row
));
if
(
trow
==
NULL
)
return
NULL
;
tdRowCpy
(
trow
,
row
);
...
...
@@ -176,7 +176,7 @@ static int32_t tdAppendTpRowToDataCol(STSRow *pRow, STSchema *pSchema, SDataCols
SDataCol
*
pDataCol
=
&
(
pCols
->
cols
[
0
]);
if
(
pDataCol
->
colId
==
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
tdAppendValToDataCol
(
pDataCol
,
TD_VTYPE_NORM
,
&
pRow
->
ts
,
pCols
->
numOfRows
,
pCols
->
maxPoints
);
tdAppendValToDataCol
(
pDataCol
,
TD_VTYPE_NORM
,
&
pRow
->
ts
,
pCols
->
numOfRows
,
pCols
->
maxPoints
);
}
while
(
dcol
<
pCols
->
numOfCols
)
{
...
...
@@ -378,9 +378,7 @@ static void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, i
}
}
STSRow
*
mergeTwoRows
(
void
*
buffer
,
STSRow
*
row1
,
STSRow
*
row2
,
STSchema
*
pSchema1
,
STSchema
*
pSchema2
)
{
STSRow
*
mergeTwoRows
(
void
*
buffer
,
STSRow
*
row1
,
STSRow
*
row2
,
STSchema
*
pSchema1
,
STSchema
*
pSchema2
)
{
#if 0
ASSERT(TD_ROW_KEY(row1) == TD_ROW_KEY(row2));
ASSERT(schemaVersion(pSchema1) == TD_ROW_SVER(row1));
...
...
@@ -473,6 +471,44 @@ STSRow* mergeTwoRows(void *buffer, STSRow* row1, STSRow *row2, STSchema *pSchema
}
taosArrayDestroy(stashRow);
return buffer;
#endif
#endif
return
NULL
;
}
SDataCols
*
tdDupDataCols
(
SDataCols
*
pDataCols
,
bool
keepData
)
{
SDataCols
*
pRet
=
tdNewDataCols
(
pDataCols
->
maxCols
,
pDataCols
->
maxPoints
);
if
(
pRet
==
NULL
)
return
NULL
;
pRet
->
numOfCols
=
pDataCols
->
numOfCols
;
pRet
->
sversion
=
pDataCols
->
sversion
;
if
(
keepData
)
pRet
->
numOfRows
=
pDataCols
->
numOfRows
;
for
(
int
i
=
0
;
i
<
pDataCols
->
numOfCols
;
i
++
)
{
pRet
->
cols
[
i
].
type
=
pDataCols
->
cols
[
i
].
type
;
pRet
->
cols
[
i
].
bitmap
=
pDataCols
->
cols
[
i
].
bitmap
;
pRet
->
cols
[
i
].
colId
=
pDataCols
->
cols
[
i
].
colId
;
pRet
->
cols
[
i
].
bytes
=
pDataCols
->
cols
[
i
].
bytes
;
pRet
->
cols
[
i
].
offset
=
pDataCols
->
cols
[
i
].
offset
;
if
(
keepData
)
{
if
(
pDataCols
->
cols
[
i
].
len
>
0
)
{
if
(
tdAllocMemForCol
(
&
pRet
->
cols
[
i
],
pRet
->
maxPoints
)
<
0
)
{
tdFreeDataCols
(
pRet
);
return
NULL
;
}
pRet
->
cols
[
i
].
len
=
pDataCols
->
cols
[
i
].
len
;
memcpy
(
pRet
->
cols
[
i
].
pData
,
pDataCols
->
cols
[
i
].
pData
,
pDataCols
->
cols
[
i
].
len
);
if
(
IS_VAR_DATA_TYPE
(
pRet
->
cols
[
i
].
type
))
{
int
dataOffSize
=
sizeof
(
VarDataOffsetT
)
*
pDataCols
->
maxPoints
;
memcpy
(
pRet
->
cols
[
i
].
dataOff
,
pDataCols
->
cols
[
i
].
dataOff
,
dataOffSize
);
}
if
(
!
TD_COL_ROWS_NORM
(
pRet
->
cols
+
i
))
{
int32_t
nBitmapBytes
=
(
int32_t
)
TD_BITMAP_BYTES
(
pDataCols
->
maxPoints
);
memcpy
(
pRet
->
cols
[
i
].
pBitmap
,
pDataCols
->
cols
[
i
].
pBitmap
,
nBitmapBytes
);
}
}
}
}
return
pRet
;
}
\ No newline at end of file
tests/script/jenkins/basic.txt
浏览文件 @
a49fba71
...
...
@@ -17,7 +17,7 @@
./test.sh -f tsim/dnode/basic1.sim
# ---- insert
#
./test.sh -f tsim/insert/basic0.sim
./test.sh -f tsim/insert/basic0.sim
# ---- query
./test.sh -f tsim/query/interval.sim
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录