Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0d9cf348
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看板
提交
0d9cf348
编写于
6月 30, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SKVRow offset bug fix
上级
8f58cb6c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
10 addition
and
11 deletion
+10
-11
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+3
-6
src/common/inc/tdataformat.h
src/common/inc/tdataformat.h
+3
-3
src/common/src/tdataformat.c
src/common/src/tdataformat.c
+2
-1
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+2
-1
未找到文件。
src/client/src/tscUtil.c
浏览文件 @
0d9cf348
...
@@ -1667,7 +1667,7 @@ int32_t tscGetDataBlockFromList(SHashObj* pHashList, int64_t id, int32_t size, i
...
@@ -1667,7 +1667,7 @@ int32_t tscGetDataBlockFromList(SHashObj* pHashList, int64_t id, int32_t size, i
// pBuilder->size = 0;
// pBuilder->size = 0;
// }
// }
#define KvRowNColsThresh 1 // default value:
32 TODO: for test, restore to 32
after test finished
#define KvRowNColsThresh 1 // default value:
128 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
,
uint16_t
*
nColsNotNull
)
{
uint16_t
*
nColsNotNull
)
{
...
@@ -1724,7 +1724,6 @@ SMemRow tdGenMemRowFromBuilder(SMemRowBuilder* pBuilder) {
...
@@ -1724,7 +1724,6 @@ SMemRow tdGenMemRowFromBuilder(SMemRowBuilder* pBuilder) {
uint16_t
nColsNotNull
=
0
;
uint16_t
nColsNotNull
=
0
;
uint8_t
memRowType
=
tdRowTypeJudger
(
pSchema
,
p
,
pBuilder
->
nCols
,
pBuilder
->
flen
,
&
nColsNotNull
);
uint8_t
memRowType
=
tdRowTypeJudger
(
pSchema
,
p
,
pBuilder
->
nCols
,
pBuilder
->
flen
,
&
nColsNotNull
);
tscDebug
(
"prop:memType is %d"
,
memRowType
);
tscDebug
(
"prop:memType is %d"
,
memRowType
);
memRowType
=
SMEM_ROW_DATA
;
SMemRow
*
memRow
=
(
SMemRow
)
pBuilder
->
pDataBlock
;
SMemRow
*
memRow
=
(
SMemRow
)
pBuilder
->
pDataBlock
;
memRowSetType
(
memRow
,
memRowType
);
memRowSetType
(
memRow
,
memRowType
);
...
@@ -1744,12 +1743,10 @@ SMemRow tdGenMemRowFromBuilder(SMemRowBuilder* pBuilder) {
...
@@ -1744,12 +1743,10 @@ SMemRow tdGenMemRowFromBuilder(SMemRowBuilder* pBuilder) {
pBuilder
->
buf
=
p
;
pBuilder
->
buf
=
p
;
}
else
if
(
memRowType
==
SMEM_ROW_KV
)
{
}
else
if
(
memRowType
==
SMEM_ROW_KV
)
{
ASSERT
(
nColsNotNull
<
pBuilder
->
nCols
);
ASSERT
(
nColsNotNull
<
pBuilder
->
nCols
);
uint16_t
tlen
=
TD_KV_ROW_HEAD_SIZE
+
sizeof
(
SColIdx
)
*
nColsNotNull
+
pBuilder
->
size
;
SKVRow
kvRow
=
(
SKVRow
)
memRowBody
(
memRow
);
SKVRow
kvRow
=
(
SKVRow
)
memRowBody
(
memRow
);
uint16_t
tlen
=
TD_KV_ROW_HEAD_SIZE
+
sizeof
(
SColIdx
)
*
nColsNotNull
;
kvRowSetNCols
(
kvRow
,
nColsNotNull
);
kvRowSetLen
(
kvRow
,
tlen
);
kvRowSetLen
(
kvRow
,
tlen
);
kvRowSetNCols
(
kvRow
,
nColsNotNull
);
int
toffset
=
0
;
int
toffset
=
0
;
p
=
(
char
*
)
pBuilder
->
buf
;
p
=
(
char
*
)
pBuilder
->
buf
;
...
...
src/common/inc/tdataformat.h
浏览文件 @
0d9cf348
...
@@ -214,7 +214,7 @@ typedef void *SMemRow;
...
@@ -214,7 +214,7 @@ typedef void *SMemRow;
#define TD_DATA_ROW_HEAD_SIZE (sizeof(uint16_t) + sizeof(int16_t))
#define TD_DATA_ROW_HEAD_SIZE (sizeof(uint16_t) + sizeof(int16_t))
#define dataRowLen(r) (*(uint16_t *)(r))
#define dataRowLen(r) (*(uint16_t *)(r))
#define dataRowVersion(r)
*(int16_t *)POINTER_SHIFT(r, sizeof(int16_t
))
#define dataRowVersion(r)
(*(int16_t *)POINTER_SHIFT(r, sizeof(int16_t)
))
#define dataRowTuple(r) POINTER_SHIFT(r, TD_DATA_ROW_HEAD_SIZE)
#define dataRowTuple(r) POINTER_SHIFT(r, TD_DATA_ROW_HEAD_SIZE)
#define dataRowTKey(r) (*(TKEY *)(dataRowTuple(r)))
#define dataRowTKey(r) (*(TKEY *)(dataRowTuple(r)))
#define dataRowKey(r) tdGetKey(dataRowTKey(r))
#define dataRowKey(r) tdGetKey(dataRowTKey(r))
...
@@ -425,7 +425,7 @@ typedef struct {
...
@@ -425,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)
...
@@ -468,7 +468,7 @@ static FORCE_INLINE int tdAppendKvColVal(SKVRow row, const void *value, int16_t
...
@@ -468,7 +468,7 @@ static FORCE_INLINE int tdAppendKvColVal(SKVRow row, const void *value, int16_t
char
*
ptr
=
(
char
*
)
POINTER_SHIFT
(
row
,
kvRowLen
(
row
));
char
*
ptr
=
(
char
*
)
POINTER_SHIFT
(
row
,
kvRowLen
(
row
));
pColIdx
->
colId
=
colId
;
pColIdx
->
colId
=
colId
;
pColIdx
->
offset
=
kvRowLen
(
row
);
pColIdx
->
offset
=
kvRowLen
(
row
);
// offset of pColIdx including the TD_KV_ROW_HEAD_SIZE
if
(
IS_VAR_DATA_TYPE
(
type
))
{
if
(
IS_VAR_DATA_TYPE
(
type
))
{
memcpy
(
ptr
,
value
,
varDataTLen
(
value
));
memcpy
(
ptr
,
value
,
varDataTLen
(
value
));
...
...
src/common/src/tdataformat.c
浏览文件 @
0d9cf348
...
@@ -527,7 +527,8 @@ static void tdAppendKvRowToDataCol(SKVRow row, STSchema *pSchema, SDataCols *pCo
...
@@ -527,7 +527,8 @@ static void tdAppendKvRowToDataCol(SKVRow row, STSchema *pSchema, SDataCols *pCo
int
nRowColsMatched
=
0
;
int
nRowColsMatched
=
0
;
STColumn
stColumn
[
nRowCols
];
STColumn
stColumn
[
nRowCols
];
tdGetKVRowColInfo
(
pSchema
,
kvRowColIdx
(
row
),
nRowCols
,
stColumn
,
&
nRowColsMatched
);
tdGetKVRowColInfo
(
pSchema
,
kvRowColIdx
(
row
),
nRowCols
,
stColumn
,
&
nRowColsMatched
);
uDebug
(
"kvRow: nRowCols=%d, nRowColsMatched=%d, nSchemaCols=%d"
,
nRowCols
,
nRowColsMatched
,
schemaNCols
(
pSchema
));
uDebug
(
"prop:kvRow: nRowCols=%d, nRowColsMatched=%d, nSchemaCols=%d"
,
nRowCols
,
nRowColsMatched
,
schemaNCols
(
pSchema
));
while
(
dcol
<
pCols
->
numOfCols
)
{
while
(
dcol
<
pCols
->
numOfCols
)
{
SDataCol
*
pDataCol
=
&
(
pCols
->
cols
[
dcol
]);
SDataCol
*
pDataCol
=
&
(
pCols
->
cols
[
dcol
]);
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
0d9cf348
...
@@ -1550,7 +1550,8 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity,
...
@@ -1550,7 +1550,8 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity,
if
(
pColIdx
->
colId
==
pColInfo
->
info
.
colId
)
{
if
(
pColIdx
->
colId
==
pColInfo
->
info
.
colId
)
{
STColumn
*
pSTColumn
=
tdGetColOfID
(
pSchema
,
pColIdx
->
colId
);
STColumn
*
pSTColumn
=
tdGetColOfID
(
pSchema
,
pColIdx
->
colId
);
if
(
pSTColumn
!=
NULL
)
{
if
(
pSTColumn
!=
NULL
)
{
void
*
value
=
tdGetKvRowDataOfCol
(
row
,
pSTColumn
->
type
,
TD_MEM_ROW_HEAD_SIZE
+
pColIdx
->
offset
);
// offset of pColIdx including the TD_KV_ROW_HEAD_SIZE
void
*
value
=
tdGetKvRowDataOfCol
(
kvRow
,
pSTColumn
->
type
,
pColIdx
->
offset
);
switch
(
pColInfo
->
info
.
type
)
{
switch
(
pColInfo
->
info
.
type
)
{
case
TSDB_DATA_TYPE_BINARY
:
case
TSDB_DATA_TYPE_BINARY
:
case
TSDB_DATA_TYPE_NCHAR
:
case
TSDB_DATA_TYPE_NCHAR
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录