Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
4a365c0d
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看板
提交
4a365c0d
编写于
7月 07, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
compile err and bug fix
上级
c10d065e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
19 deletion
+23
-19
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+20
-14
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+0
-3
src/common/inc/tdataformat.h
src/common/inc/tdataformat.h
+3
-2
未找到文件。
src/client/src/tscParseInsert.c
浏览文件 @
4a365c0d
...
@@ -413,8 +413,8 @@ static FORCE_INLINE uint16_t tsSetColumnValue(char *payload, int16_t columnId, u
...
@@ -413,8 +413,8 @@ static FORCE_INLINE uint16_t tsSetColumnValue(char *payload, int16_t columnId, u
return
PAYLOAD_ID_TYPE_LEN
+
valueLen
;
return
PAYLOAD_ID_TYPE_LEN
+
valueLen
;
}
}
static
int32_t
tsParseOneColumnKV
(
SSchema
*
pSchema
,
SStrToken
*
pToken
,
char
*
p
ayload
,
char
*
msg
,
char
**
str
,
static
int32_t
tsParseOneColumnKV
(
SSchema
*
pSchema
,
SStrToken
*
pToken
,
char
*
p
rimaryKeyStart
,
char
*
payload
,
char
*
msg
,
bool
primaryKey
,
int16_t
timePrec
,
TDRowLenT
*
sizeAppend
,
bool
*
isColNull
,
char
**
str
,
bool
primaryKey
,
int16_t
timePrec
,
TDRowLenT
*
sizeAppend
,
bool
*
isColNull
,
TDRowLenT
*
dataRowColDeltaLen
,
TDRowLenT
*
kvRowColLen
)
{
TDRowLenT
*
dataRowColDeltaLen
,
TDRowLenT
*
kvRowColLen
)
{
int64_t
iv
;
int64_t
iv
;
int32_t
ret
;
int32_t
ret
;
...
@@ -721,8 +721,9 @@ static int32_t tsParseOneColumnKV(SSchema *pSchema, SStrToken *pToken, char *pay
...
@@ -721,8 +721,9 @@ static int32_t tsParseOneColumnKV(SSchema *pSchema, SStrToken *pToken, char *pay
// *((int64_t *)payload) = 0;
// *((int64_t *)payload) = 0;
// When building SKVRow primaryKey, we should not skip even with NULL value.
// When building SKVRow primaryKey, we should not skip even with NULL value.
int64_t
tmpVal
=
0
;
int64_t
tmpVal
=
0
;
*
sizeAppend
=
tsSetColumnValue
(
payload
,
pSchema
->
colId
,
pSchema
->
type
,
&
tmpVal
,
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
]);
*
sizeAppend
=
tsSetColumnValue
(
primaryKeyStart
,
pSchema
->
colId
,
pSchema
->
type
,
&
tmpVal
,
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
]);
*
kvRowColLen
+=
(
TDRowLenT
)(
sizeof
(
SColIdx
)
+
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
]);
*
kvRowColLen
+=
(
TDRowLenT
)(
sizeof
(
SColIdx
)
+
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
]);
}
else
{
}
else
{
// *((int64_t *)payload) = TSDB_DATA_BIGINT_NULL;
// *((int64_t *)payload) = TSDB_DATA_BIGINT_NULL;
...
@@ -735,8 +736,9 @@ static int32_t tsParseOneColumnKV(SSchema *pSchema, SStrToken *pToken, char *pay
...
@@ -735,8 +736,9 @@ static int32_t tsParseOneColumnKV(SSchema *pSchema, SStrToken *pToken, char *pay
}
}
// *((int64_t *)payload) = tmpVal;
// *((int64_t *)payload) = tmpVal;
*
sizeAppend
=
tsSetColumnValue
(
payload
,
pSchema
->
colId
,
pSchema
->
type
,
&
tmpVal
,
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
]);
*
sizeAppend
=
tsSetColumnValue
(
primaryKey
?
primaryKeyStart
:
payload
,
pSchema
->
colId
,
pSchema
->
type
,
&
tmpVal
,
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
]);
*
kvRowColLen
+=
(
TDRowLenT
)(
sizeof
(
SColIdx
)
+
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
]);
*
kvRowColLen
+=
(
TDRowLenT
)(
sizeof
(
SColIdx
)
+
TYPE_BYTES
[
TSDB_DATA_TYPE_TIMESTAMP
]);
}
}
...
@@ -801,7 +803,9 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
...
@@ -801,7 +803,9 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
TDRowLenT
dataRowLen
=
pBuilder
->
allNullLen
;
TDRowLenT
dataRowLen
=
pBuilder
->
allNullLen
;
TDRowLenT
kvRowLen
=
TD_MEM_ROW_KV_VER_SIZE
;
TDRowLenT
kvRowLen
=
TD_MEM_ROW_KV_VER_SIZE
;
char
*
kvStart
=
payload
;
char
*
kvPrimayKeyStart
=
payload
+
PAYLOAD_HEADER_LEN
;
char
*
kvStart
=
kvPrimayKeyStart
+
PLAYLOAD_PRIMARY_COL_LEN
;
// make sure 1st column tuple is primaryKey
for
(
int
i
=
0
;
i
<
spd
->
numOfBound
;
++
i
)
{
for
(
int
i
=
0
;
i
<
spd
->
numOfBound
;
++
i
)
{
// the start position in data block buffer of current value in sql
// the start position in data block buffer of current value in sql
int32_t
colIndex
=
spd
->
boundedColumns
[
i
];
// ordered
int32_t
colIndex
=
spd
->
boundedColumns
[
i
];
// ordered
...
@@ -871,9 +875,9 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
...
@@ -871,9 +875,9 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
TDRowLenT
dataRowDeltaColLen
=
0
;
// When combine the data as SDataRow, the delta len between all NULL columns.
TDRowLenT
dataRowDeltaColLen
=
0
;
// When combine the data as SDataRow, the delta len between all NULL columns.
TDRowLenT
kvRowColLen
=
0
;
TDRowLenT
kvRowColLen
=
0
;
TDRowLenT
colSizeAppended
=
0
;
TDRowLenT
colSizeAppended
=
0
;
int32_t
ret
=
// make sure the Primarykey locates in the 1st column
tsParseOneColumnKV
(
pSchema
,
&
sToken
,
kvStart
+
PAYLOAD_HEADER_LEN
,
pInsertParam
->
msg
,
str
,
isPrimaryKey
,
int32_t
ret
=
tsParseOneColumnKV
(
pSchema
,
&
sToken
,
kvPrimayKeyStart
,
kvStart
,
pInsertParam
->
msg
,
str
,
isPrimaryKey
,
timePrec
,
&
colSizeAppended
,
&
isColNull
,
&
dataRowDeltaColLen
,
&
kvRowColLen
);
timePrec
,
&
colSizeAppended
,
&
isColNull
,
&
dataRowDeltaColLen
,
&
kvRowColLen
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
return
ret
;
return
ret
;
}
}
...
@@ -888,7 +892,9 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
...
@@ -888,7 +892,9 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
}
}
kvRowLen
+=
kvRowColLen
;
kvRowLen
+=
kvRowColLen
;
dataRowLen
+=
dataRowDeltaColLen
;
dataRowLen
+=
dataRowDeltaColLen
;
kvStart
+=
colSizeAppended
;
// move to next column
if
(
!
isPrimaryKey
)
{
kvStart
+=
colSizeAppended
;
// move to next column
}
rowSizeAppended
+=
colSizeAppended
;
// calculate rowLen
rowSizeAppended
+=
colSizeAppended
;
// calculate rowLen
}
}
...
@@ -1134,11 +1140,11 @@ int tscSortRemoveDataBlockDupRows(STableDataBlocks *dataBuf, SBlockKeyInfo *pBlk
...
@@ -1134,11 +1140,11 @@ int tscSortRemoveDataBlockDupRows(STableDataBlocks *dataBuf, SBlockKeyInfo *pBlk
int32_t
i
=
0
;
int32_t
i
=
0
;
int32_t
j
=
1
;
int32_t
j
=
1
;
while
(
j
<
nRows
)
{
while
(
j
<
nRows
)
{
TSKEY
ti
=
*
(
TSKEY
*
)(
pBlkKeyTuple
+
sizeof
(
SBlockKeyTuple
)
*
i
)
;
TSKEY
ti
=
(
pBlkKeyTuple
+
i
)
->
skey
;
TSKEY
tj
=
*
(
TSKEY
*
)(
pBlkKeyTuple
+
sizeof
(
SBlockKeyTuple
)
*
j
)
;
TSKEY
tj
=
(
pBlkKeyTuple
+
j
)
->
skey
;
if
(
ti
==
tj
)
{
if
(
ti
==
tj
)
{
totolPayloadLen
-=
payloadTLen
(
pBlkKeyTuple
+
sizeof
(
SBlockKeyTuple
)
*
j
);
totolPayloadLen
-=
payloadTLen
(
pBlkKeyTuple
+
j
);
++
j
;
++
j
;
continue
;
continue
;
}
}
...
...
src/client/src/tscUtil.c
浏览文件 @
4a365c0d
...
@@ -1703,7 +1703,6 @@ static SMemRow tdGenMemRowFromBuilder(SMemRowBuilder* pBuilder) {
...
@@ -1703,7 +1703,6 @@ static SMemRow tdGenMemRowFromBuilder(SMemRowBuilder* pBuilder) {
++
i
;
++
i
;
}
}
pBuilder
->
buf
=
p
;
}
else
if
(
memRowType
==
SMEM_ROW_KV
)
{
}
else
if
(
memRowType
==
SMEM_ROW_KV
)
{
ASSERT
(
nColsNotNull
<=
pBuilder
->
nCols
);
ASSERT
(
nColsNotNull
<=
pBuilder
->
nCols
);
SKVRow
kvRow
=
(
SKVRow
)
memRowKvBody
(
memRow
);
SKVRow
kvRow
=
(
SKVRow
)
memRowKvBody
(
memRow
);
...
@@ -1723,8 +1722,6 @@ static SMemRow tdGenMemRowFromBuilder(SMemRowBuilder* pBuilder) {
...
@@ -1723,8 +1722,6 @@ static SMemRow tdGenMemRowFromBuilder(SMemRowBuilder* pBuilder) {
++
i
;
++
i
;
}
}
pBuilder
->
buf
=
p
;
}
else
{
}
else
{
ASSERT
(
0
);
ASSERT
(
0
);
}
}
...
...
src/common/inc/tdataformat.h
浏览文件 @
4a365c0d
...
@@ -620,6 +620,7 @@ static FORCE_INLINE void *tdGetMemRowDataOfCol(void *row, int8_t type, int32_t o
...
@@ -620,6 +620,7 @@ static FORCE_INLINE void *tdGetMemRowDataOfCol(void *row, int8_t type, int32_t o
#define PAYLOAD_HEADER_LEN (PAYLOAD_NCOLS_OFFSET + PAYLOAD_NCOLS_LEN)
#define PAYLOAD_HEADER_LEN (PAYLOAD_NCOLS_OFFSET + PAYLOAD_NCOLS_LEN)
#define PAYLOAD_ID_LEN sizeof(int16_t)
#define PAYLOAD_ID_LEN sizeof(int16_t)
#define PAYLOAD_ID_TYPE_LEN (sizeof(int16_t) + sizeof(uint8_t))
#define PAYLOAD_ID_TYPE_LEN (sizeof(int16_t) + sizeof(uint8_t))
#define PLAYLOAD_PRIMARY_COL_LEN (PAYLOAD_ID_TYPE_LEN + sizeof(TSKEY))
#define payloadBody(r) POINTER_SHIFT(r, PAYLOAD_HEADER_LEN)
#define payloadBody(r) POINTER_SHIFT(r, PAYLOAD_HEADER_LEN)
#define payloadType(r) (*(uint8_t *)(r))
#define payloadType(r) (*(uint8_t *)(r))
...
@@ -643,9 +644,9 @@ static FORCE_INLINE void *tdGetMemRowDataOfCol(void *row, int8_t type, int32_t o
...
@@ -643,9 +644,9 @@ static FORCE_INLINE void *tdGetMemRowDataOfCol(void *row, int8_t type, int32_t o
static
FORCE_INLINE
char
*
skipToNextEles
(
char
*
p
)
{
static
FORCE_INLINE
char
*
skipToNextEles
(
char
*
p
)
{
uint8_t
colType
=
payloadColType
(
p
);
uint8_t
colType
=
payloadColType
(
p
);
if
(
IS_VAR_DATA_TYPE
(
colType
))
{
if
(
IS_VAR_DATA_TYPE
(
colType
))
{
return
POINTER_SHIFT
(
p
,
PAYLOAD_ID_TYPE_LEN
+
varDataTLen
(
payloadColValue
(
p
)));
return
(
char
*
)
POINTER_SHIFT
(
p
,
PAYLOAD_ID_TYPE_LEN
+
varDataTLen
(
payloadColValue
(
p
)));
}
else
{
}
else
{
return
POINTER_SHIFT
(
p
,
PAYLOAD_ID_TYPE_LEN
+
TYPE_BYTES
[
colType
]);
return
(
char
*
)
POINTER_SHIFT
(
p
,
PAYLOAD_ID_TYPE_LEN
+
TYPE_BYTES
[
colType
]);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录