Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8be78dde
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
8be78dde
编写于
4月 26, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:[TD-23881] check the max row's length in schemaless
上级
13332714
变更
3
展开全部
显示空白变更内容
内联
并排
Showing
3 changed file
with
72 addition
and
2 deletion
+72
-2
source/client/src/clientSml.c
source/client/src/clientSml.c
+44
-1
source/client/src/clientSmlJson.c
source/client/src/clientSmlJson.c
+1
-1
utils/test/c/sml_test.c
utils/test/c/sml_test.c
+27
-0
未找到文件。
source/client/src/clientSml.c
浏览文件 @
8be78dde
...
@@ -649,6 +649,17 @@ static int32_t smlBuildFieldsList(SSmlHandle *info, SSchema *schemaField, SHashO
...
@@ -649,6 +649,17 @@ static int32_t smlBuildFieldsList(SSmlHandle *info, SSchema *schemaField, SHashO
field
->
bytes
=
getBytes
(
kv
->
type
,
kv
->
length
);
field
->
bytes
=
getBytes
(
kv
->
type
,
kv
->
length
);
}
}
}
}
int32_t
maxLen
=
isTag
?
TSDB_MAX_TAGS_LEN
:
TSDB_MAX_BYTES_PER_ROW
;
int32_t
len
=
0
;
for
(
int
j
=
0
;
j
<
taosArrayGetSize
(
results
);
++
j
)
{
SField
*
field
=
taosArrayGet
(
results
,
j
);
len
+=
field
->
bytes
;
}
if
(
len
>
maxLen
){
return
TSDB_CODE_TSC_INVALID_VALUE
;
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -781,11 +792,15 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
...
@@ -781,11 +792,15 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
code
=
smlBuildFieldsList
(
info
,
NULL
,
NULL
,
sTableData
->
tags
,
pTags
,
0
,
true
);
code
=
smlBuildFieldsList
(
info
,
NULL
,
NULL
,
sTableData
->
tags
,
pTags
,
0
,
true
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
uError
(
"SML:0x%"
PRIx64
" smlBuildFieldsList tag1 failed. %s"
,
info
->
id
,
pName
.
tname
);
uError
(
"SML:0x%"
PRIx64
" smlBuildFieldsList tag1 failed. %s"
,
info
->
id
,
pName
.
tname
);
taosArrayDestroy
(
pColumns
);
taosArrayDestroy
(
pTags
);
goto
end
;
goto
end
;
}
}
code
=
smlBuildFieldsList
(
info
,
NULL
,
NULL
,
sTableData
->
cols
,
pColumns
,
0
,
false
);
code
=
smlBuildFieldsList
(
info
,
NULL
,
NULL
,
sTableData
->
cols
,
pColumns
,
0
,
false
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
uError
(
"SML:0x%"
PRIx64
" smlBuildFieldsList col1 failed. %s"
,
info
->
id
,
pName
.
tname
);
uError
(
"SML:0x%"
PRIx64
" smlBuildFieldsList col1 failed. %s"
,
info
->
id
,
pName
.
tname
);
taosArrayDestroy
(
pColumns
);
taosArrayDestroy
(
pTags
);
goto
end
;
goto
end
;
}
}
code
=
smlSendMetaMsg
(
info
,
&
pName
,
pColumns
,
pTags
,
NULL
,
SCHEMA_ACTION_CREATE_STABLE
);
code
=
smlSendMetaMsg
(
info
,
&
pName
,
pColumns
,
pTags
,
NULL
,
SCHEMA_ACTION_CREATE_STABLE
);
...
@@ -837,6 +852,23 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
...
@@ -837,6 +852,23 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
pTableMeta
->
tableInfo
.
numOfColumns
,
true
);
pTableMeta
->
tableInfo
.
numOfColumns
,
true
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
uError
(
"SML:0x%"
PRIx64
" smlBuildFieldsList tag2 failed. %s"
,
info
->
id
,
pName
.
tname
);
uError
(
"SML:0x%"
PRIx64
" smlBuildFieldsList tag2 failed. %s"
,
info
->
id
,
pName
.
tname
);
taosArrayDestroy
(
pColumns
);
taosArrayDestroy
(
pTags
);
goto
end
;
}
if
(
taosArrayGetSize
(
pTags
)
+
pTableMeta
->
tableInfo
.
numOfColumns
>
TSDB_MAX_COLUMNS
)
{
uError
(
"SML:0x%"
PRIx64
" too many columns than 4096"
,
info
->
id
);
code
=
TSDB_CODE_PAR_TOO_MANY_COLUMNS
;
taosArrayDestroy
(
pColumns
);
taosArrayDestroy
(
pTags
);
goto
end
;
}
if
(
taosArrayGetSize
(
pTags
)
>
TSDB_MAX_TAGS
)
{
uError
(
"SML:0x%"
PRIx64
" too many tags than 128"
,
info
->
id
);
code
=
TSDB_CODE_PAR_INVALID_TAGS_NUM
;
taosArrayDestroy
(
pColumns
);
taosArrayDestroy
(
pTags
);
goto
end
;
goto
end
;
}
}
...
@@ -891,6 +923,16 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
...
@@ -891,6 +923,16 @@ static int32_t smlModifyDBSchemas(SSmlHandle *info) {
pTableMeta
->
tableInfo
.
numOfColumns
,
false
);
pTableMeta
->
tableInfo
.
numOfColumns
,
false
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
uError
(
"SML:0x%"
PRIx64
" smlBuildFieldsList col2 failed. %s"
,
info
->
id
,
pName
.
tname
);
uError
(
"SML:0x%"
PRIx64
" smlBuildFieldsList col2 failed. %s"
,
info
->
id
,
pName
.
tname
);
taosArrayDestroy
(
pColumns
);
taosArrayDestroy
(
pTags
);
goto
end
;
}
if
(
taosArrayGetSize
(
pColumns
)
+
pTableMeta
->
tableInfo
.
numOfTags
>
TSDB_MAX_COLUMNS
)
{
uError
(
"SML:0x%"
PRIx64
" too many columns than 4096"
,
info
->
id
);
code
=
TSDB_CODE_PAR_TOO_MANY_COLUMNS
;
taosArrayDestroy
(
pColumns
);
taosArrayDestroy
(
pTags
);
goto
end
;
goto
end
;
}
}
...
@@ -1514,7 +1556,8 @@ static int smlProcess(SSmlHandle *info, char *lines[], char *rawLine, char *rawL
...
@@ -1514,7 +1556,8 @@ static int smlProcess(SSmlHandle *info, char *lines[], char *rawLine, char *rawL
do
{
do
{
code
=
smlModifyDBSchemas
(
info
);
code
=
smlModifyDBSchemas
(
info
);
if
(
code
==
0
||
code
==
TSDB_CODE_SML_INVALID_DATA
)
break
;
if
(
code
==
0
||
code
==
TSDB_CODE_SML_INVALID_DATA
||
code
==
TSDB_CODE_PAR_TOO_MANY_COLUMNS
||
code
==
TSDB_CODE_PAR_INVALID_TAGS_NUM
)
break
;
taosMsleep
(
100
);
taosMsleep
(
100
);
uInfo
(
"SML:0x%"
PRIx64
" smlModifyDBSchemas retry code:%s, times:%d"
,
info
->
id
,
tstrerror
(
code
),
retryNum
);
uInfo
(
"SML:0x%"
PRIx64
" smlModifyDBSchemas retry code:%s, times:%d"
,
info
->
id
,
tstrerror
(
code
),
retryNum
);
}
while
(
retryNum
++
<
taosHashGetSize
(
info
->
superTables
)
*
MAX_RETRY_TIMES
);
}
while
(
retryNum
++
<
taosHashGetSize
(
info
->
superTables
)
*
MAX_RETRY_TIMES
);
...
...
source/client/src/clientSmlJson.c
浏览文件 @
8be78dde
...
@@ -575,7 +575,7 @@ static int32_t smlConvertJSONString(SSmlKv *pVal, char *typeStr, cJSON *value) {
...
@@ -575,7 +575,7 @@ static int32_t smlConvertJSONString(SSmlKv *pVal, char *typeStr, cJSON *value) {
uError
(
"OTD:invalid type(%s) for JSON String"
,
typeStr
);
uError
(
"OTD:invalid type(%s) for JSON String"
,
typeStr
);
return
TSDB_CODE_TSC_INVALID_JSON_TYPE
;
return
TSDB_CODE_TSC_INVALID_JSON_TYPE
;
}
}
pVal
->
length
=
(
int16_t
)
strlen
(
value
->
valuestring
);
pVal
->
length
=
strlen
(
value
->
valuestring
);
if
(
pVal
->
type
==
TSDB_DATA_TYPE_BINARY
&&
pVal
->
length
>
TSDB_MAX_BINARY_LEN
-
VARSTR_HEADER_SIZE
)
{
if
(
pVal
->
type
==
TSDB_DATA_TYPE_BINARY
&&
pVal
->
length
>
TSDB_MAX_BINARY_LEN
-
VARSTR_HEADER_SIZE
)
{
return
TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN
;
return
TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN
;
...
...
utils/test/c/sml_test.c
浏览文件 @
8be78dde
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录