Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4a388c42
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看板
未验证
提交
4a388c42
编写于
2月 11, 2022
作者:
C
Cary Xu
提交者:
GitHub
2月 11, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Feature/td 11381 3.0 (#10220)
* calculate boundNullLen * add extendedRowSize
上级
54b0fb0e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
8 deletion
+29
-8
2.0/src/client/src/tscParseInsert.c
2.0/src/client/src/tscParseInsert.c
+4
-4
include/common/trow.h
include/common/trow.h
+10
-2
source/libs/parser/src/dataBlockMgt.c
source/libs/parser/src/dataBlockMgt.c
+1
-0
source/libs/parser/src/insertParser.c
source/libs/parser/src/insertParser.c
+14
-2
未找到文件。
2.0/src/client/src/tscParseInsert.c
浏览文件 @
4a388c42
...
...
@@ -1209,10 +1209,10 @@ static int32_t parseBoundColumns(SInsertStatementParam *pInsertParam, SParsedDat
++
pColInfo
->
numOfBound
;
switch
(
pSchema
[
t
].
type
)
{
case
TSDB_DATA_TYPE_BINARY
:
pColInfo
->
boundNullLen
+=
(
VARSTR_HEADER_SIZE
+
CHAR_BYTES
);
pColInfo
->
boundNullLen
+=
(
sizeof
(
VarDataOffsetT
)
+
VARSTR_HEADER_SIZE
+
CHAR_BYTES
);
break
;
case
TSDB_DATA_TYPE_NCHAR
:
pColInfo
->
boundNullLen
+=
(
VARSTR_HEADER_SIZE
+
TSDB_NCHAR_SIZE
);
pColInfo
->
boundNullLen
+=
(
sizeof
(
VarDataOffsetT
)
+
VARSTR_HEADER_SIZE
+
TSDB_NCHAR_SIZE
);
break
;
default:
pColInfo
->
boundNullLen
+=
TYPE_BYTES
[
pSchema
[
t
].
type
];
...
...
@@ -1243,10 +1243,10 @@ static int32_t parseBoundColumns(SInsertStatementParam *pInsertParam, SParsedDat
++
pColInfo
->
numOfBound
;
switch
(
pSchema
[
t
].
type
)
{
case
TSDB_DATA_TYPE_BINARY
:
pColInfo
->
boundNullLen
+=
(
VARSTR_HEADER_SIZE
+
CHAR_BYTES
);
pColInfo
->
boundNullLen
+=
(
sizeof
(
VarDataOffsetT
)
+
VARSTR_HEADER_SIZE
+
CHAR_BYTES
);
break
;
case
TSDB_DATA_TYPE_NCHAR
:
pColInfo
->
boundNullLen
+=
(
VARSTR_HEADER_SIZE
+
TSDB_NCHAR_SIZE
);
pColInfo
->
boundNullLen
+=
(
sizeof
(
VarDataOffsetT
)
+
VARSTR_HEADER_SIZE
+
TSDB_NCHAR_SIZE
);
break
;
default:
pColInfo
->
boundNullLen
+=
TYPE_BYTES
[
pSchema
[
t
].
type
];
...
...
include/common/trow.h
浏览文件 @
4a388c42
...
...
@@ -423,8 +423,16 @@ static FORCE_INLINE int32_t tdSRowSetInfo(SRowBuilder *pBuilder, int32_t nCols,
*/
static
FORCE_INLINE
int32_t
tdSRowSetExtendedInfo
(
SRowBuilder
*
pBuilder
,
int32_t
nCols
,
int32_t
nBoundCols
,
int32_t
flen
,
int32_t
allNullLen
,
int32_t
boundNullLen
)
{
if
((
boundNullLen
>
0
)
&&
(
allNullLen
>
0
)
&&
isSelectKVRow
(
boundNullLen
,
allNullLen
))
{
pBuilder
->
rowType
=
TD_ROW_KV
;
if
((
boundNullLen
>
0
)
&&
(
allNullLen
>
0
)
&&
(
nBoundCols
>
0
))
{
uint32_t
tpLen
=
allNullLen
;
uint32_t
kvLen
=
sizeof
(
col_id_t
)
+
sizeof
(
SKvRowIdx
)
*
nBoundCols
+
boundNullLen
;
if
(
isSelectKVRow
(
kvLen
,
tpLen
))
{
pBuilder
->
rowType
=
TD_ROW_KV
;
}
else
{
pBuilder
->
rowType
=
TD_ROW_TP
;
}
}
else
{
pBuilder
->
rowType
=
TD_ROW_TP
;
}
...
...
source/libs/parser/src/dataBlockMgt.c
浏览文件 @
4a388c42
...
...
@@ -77,6 +77,7 @@ void setBoundColumnInfo(SParsedDataColInfo* pColList, SSchema* pSchema, int32_t
pColList
->
boundedColumns
[
i
]
=
pSchema
[
i
].
colId
;
}
pColList
->
allNullLen
+=
pColList
->
flen
;
pColList
->
boundNullLen
=
pColList
->
allNullLen
;
// default set allNullLen
pColList
->
extendedVarLen
=
(
uint16_t
)(
nVar
*
sizeof
(
VarDataOffsetT
));
}
...
...
source/libs/parser/src/insertParser.c
浏览文件 @
4a388c42
...
...
@@ -292,6 +292,7 @@ static int32_t parseBoundColumns(SInsertParseContext* pCxt, SParsedDataColInfo*
int32_t
nCols
=
pColList
->
numOfCols
;
pColList
->
numOfBound
=
0
;
pColList
->
boundNullLen
=
0
;
memset
(
pColList
->
boundedColumns
,
0
,
sizeof
(
int32_t
)
*
nCols
);
for
(
int32_t
i
=
0
;
i
<
nCols
;
++
i
)
{
pColList
->
cols
[
i
].
valStat
=
VAL_STAT_NONE
;
...
...
@@ -323,6 +324,17 @@ static int32_t parseBoundColumns(SInsertParseContext* pCxt, SParsedDataColInfo*
pColList
->
cols
[
index
].
valStat
=
VAL_STAT_HAS
;
pColList
->
boundedColumns
[
pColList
->
numOfBound
]
=
index
;
++
pColList
->
numOfBound
;
switch
(
pSchema
[
t
].
type
)
{
case
TSDB_DATA_TYPE_BINARY
:
pColList
->
boundNullLen
+=
(
sizeof
(
VarDataOffsetT
)
+
VARSTR_HEADER_SIZE
+
CHAR_BYTES
);
break
;
case
TSDB_DATA_TYPE_NCHAR
:
pColList
->
boundNullLen
+=
(
sizeof
(
VarDataOffsetT
)
+
VARSTR_HEADER_SIZE
+
TSDB_NCHAR_SIZE
);
break
;
default:
pColList
->
boundNullLen
+=
TYPE_BYTES
[
pSchema
[
t
].
type
];
break
;
}
}
pColList
->
orderStatus
=
isOrdered
?
ORDER_STATUS_ORDERED
:
ORDER_STATUS_DISORDERED
;
...
...
@@ -450,7 +462,7 @@ static int parseOneRow(SInsertParseContext* pCxt, STableDataBlocks* pDataBlocks,
}
}
*
len
=
pBuilder
->
extendedRowSize
;
//
*len = pBuilder->extendedRowSize;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -480,7 +492,7 @@ static int32_t parseValues(SInsertParseContext* pCxt, STableDataBlocks* pDataBlo
int32_t
len
=
0
;
CHECK_CODE
(
parseOneRow
(
pCxt
,
pDataBlock
,
tinfo
.
precision
,
&
len
,
tmpTokenBuf
));
pDataBlock
->
size
+=
len
;
pDataBlock
->
size
+=
extendedRowSize
;
//
len;
NEXT_TOKEN
(
pCxt
->
pSql
,
sToken
);
if
(
TK_RP
!=
sToken
.
type
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录