Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2f271fa6
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看板
提交
2f271fa6
编写于
7月 15, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code optimization and give the same hint when exceed max columns
上级
0063cb84
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
11 addition
and
20 deletion
+11
-20
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-3
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+2
-7
src/client/src/tscPrepare.c
src/client/src/tscPrepare.c
+2
-8
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+5
-1
src/inc/taosdef.h
src/inc/taosdef.h
+1
-1
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
2f271fa6
...
...
@@ -41,8 +41,6 @@ extern "C" {
// forward declaration
struct
SSqlInfo
;
#define KvRowNColsThresh 128 // default 128
typedef
void
(
*
__async_cb_func_t
)(
void
*
param
,
TAOS_RES
*
tres
,
int32_t
numOfRows
);
typedef
struct
SNewVgroupInfo
{
...
...
@@ -111,7 +109,7 @@ typedef struct SParsedDataColInfo {
int8_t
orderStatus
;
// bounded columns:
}
SParsedDataColInfo
;
#define IS_DATA_COL_ORDERED(s)
(((s)->orderStatu
s) == (int8_t)ORDER_STATUS_ORDERED)
#define IS_DATA_COL_ORDERED(s)
((
s) == (int8_t)ORDER_STATUS_ORDERED)
typedef
struct
{
SSchema
*
pSchema
;
...
...
src/client/src/tscParseInsert.c
浏览文件 @
2f271fa6
...
...
@@ -406,7 +406,6 @@ static FORCE_INLINE TDRowLenT tsSetPayloadColValue(char *payloadStart, char *pay
payloadColSetId
(
payload
,
columnId
);
payloadColSetType
(
payload
,
columnType
);
memcpy
(
POINTER_SHIFT
(
payloadStart
,
tOffset
),
value
,
valueLen
);
// payloadSetTLen(payloadStart, payloadTLen(payloadStart) + valueLen);
return
valueLen
;
}
...
...
@@ -867,7 +866,7 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
TDRowLenT
kvRowColLen
=
0
;
TDRowLenT
colValAppended
=
0
;
if
(
!
IS_DATA_COL_ORDERED
(
spd
))
{
if
(
!
IS_DATA_COL_ORDERED
(
spd
->
orderStatus
))
{
ASSERT
(
spd
->
colIdxInfo
!=
NULL
);
if
(
!
isPrimaryKey
)
{
kvStart
=
POINTER_SHIFT
(
kvPrimaryKeyStart
,
spd
->
colIdxInfo
[
i
].
finalIdx
*
PAYLOAD_COL_HEAD_LEN
);
...
...
@@ -891,7 +890,7 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
payloadColSetOffset
(
kvPrimaryKeyStart
,
colValOffset
);
}
else
{
payloadColSetOffset
(
kvStart
,
colValOffset
);
if
(
spd
->
orderStatus
==
ORDER_STATUS_ORDERED
)
{
if
(
IS_DATA_COL_ORDERED
(
spd
->
orderStatus
)
)
{
kvStart
+=
PAYLOAD_COL_HEAD_LEN
;
// move to next column
}
}
...
...
@@ -910,10 +909,6 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, int16_t timePrec, i
*
len
=
(
int32_t
)(
payloadValOffset
+
colValOffset
);
payloadSetTLen
(
payload
,
*
len
);
// TSKEY tsKey = payloadKey(payload);
// ASSERT((tsKey < 1627747200000000 && tsKey > 1498838400000000) || (tsKey < 1627747200000 && tsKey > 1498838400000) ||
// (tsKey < 1627747200 && tsKey > 1498838400));
return
TSDB_CODE_SUCCESS
;
}
...
...
src/client/src/tscPrepare.c
浏览文件 @
2f271fa6
...
...
@@ -370,7 +370,7 @@ static int refactorPayload(STableDataBlocks* pBlock, int32_t rowNum) {
bool
isPrimaryKey
=
(
colIndex
==
PRIMARYKEY_TIMESTAMP_COL_INDEX
);
// the primary key locates in 1st column
if
(
!
IS_DATA_COL_ORDERED
(
spd
))
{
if
(
!
IS_DATA_COL_ORDERED
(
spd
->
orderStatus
))
{
ASSERT
(
spd
->
colIdxInfo
!=
NULL
);
if
(
!
isPrimaryKey
)
{
kvStart
=
POINTER_SHIFT
(
kvPrimaryKeyStart
,
spd
->
colIdxInfo
[
i
].
finalIdx
*
PAYLOAD_COL_HEAD_LEN
);
...
...
@@ -406,7 +406,7 @@ static int refactorPayload(STableDataBlocks* pBlock, int32_t rowNum) {
kvRowLen
+=
TYPE_BYTES
[
pSchema
->
type
];
}
if
(
IS_DATA_COL_ORDERED
(
spd
))
{
if
(
IS_DATA_COL_ORDERED
(
spd
->
orderStatus
))
{
kvStart
+=
PAYLOAD_COL_HEAD_LEN
;
// move to next column
}
}
...
...
@@ -425,12 +425,6 @@ static int refactorPayload(STableDataBlocks* pBlock, int32_t rowNum) {
TDRowTLenT
len
=
payloadValOffset
+
colValOffset
;
payloadSetTLen
(
destPayload
,
len
);
#if 0
TSKEY tsKey = payloadKey(destPayload);
ASSERT((tsKey < 1627747200000000 && tsKey > 1498838400000000) || (tsKey < 1627747200000 && tsKey > 1498838400000) ||
(tsKey < 1627747200 && tsKey > 1498838400));
#endif
// next loop
srcPayload
+=
pBlock
->
rowSize
;
destPayload
+=
len
;
...
...
src/client/src/tscSQLParser.c
浏览文件 @
2f271fa6
...
...
@@ -1245,12 +1245,16 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) {
const
char
*
msg4
=
"invalid data type"
;
const
char
*
msg5
=
"invalid binary/nchar column length"
;
const
char
*
msg6
=
"invalid column name"
;
const
char
*
msg7
=
"too many columns"
;
// number of fields no less than 2
size_t
numOfCols
=
taosArrayGetSize
(
pFieldList
);
if
(
numOfCols
<=
1
||
numOfCols
>
TSDB_MAX_COLUMNS
)
{
if
(
numOfCols
<=
1
)
{
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg
);
return
false
;
}
else
if
(
numOfCols
>
TSDB_MAX_COLUMNS
)
{
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg7
);
return
false
;
}
// first column must be timestamp
...
...
src/inc/taosdef.h
浏览文件 @
2f271fa6
...
...
@@ -198,7 +198,7 @@ do { \
/**
* In some scenarios uint16_t (0~65535) is used to store the row len.
* - Firstly, we use 65531(65535 - 4), as the SDataRow and SKVRow including 4 bits header.
* - Secondly, if all cols are Var
T
ype except primary key, we need 4 bits to store the offset, thus
* - Secondly, if all cols are Var
DataT t
ype except primary key, we need 4 bits to store the offset, thus
* the final value is 65531-(4096-1)*4 = 49151.
*/
#define TSDB_MAX_BYTES_PER_ROW 49151
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录