Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9b792a8d
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9b792a8d
编写于
5月 18, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix failed cases
上级
d939f382
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
20 addition
and
11 deletion
+20
-11
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+3
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+11
-9
src/mnode/src/mgmtTable.c
src/mnode/src/mgmtTable.c
+6
-1
未找到文件。
src/client/src/tscParseInsert.c
浏览文件 @
9b792a8d
...
...
@@ -1016,7 +1016,9 @@ int doParseInsertSql(SSqlObj *pSql, char *str) {
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
}
if
((
code
=
tscAllocPayload
(
pCmd
,
TSDB_PAYLOAD_SIZE
))
!=
TSDB_CODE_SUCCESS
)
{
// TODO: 2048 is added because TSDB_MAX_TAGS_LEN now is 65536
// but TSDB_PAYLOAD_SIZE is 65380
if
((
code
=
tscAllocPayload
(
pCmd
,
TSDB_PAYLOAD_SIZE
+
2048
))
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
src/client/src/tscServer.c
浏览文件 @
9b792a8d
...
...
@@ -1487,15 +1487,16 @@ int tscBuildTableMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
char
*
pMsg
;
int
msgLen
=
0
;
char
*
tmpData
=
0
;
if
(
pSql
->
cmd
.
allocSize
>
0
)
{
tmpData
=
calloc
(
1
,
pSql
->
cmd
.
allocSize
);
char
*
tmpData
=
NULL
;
uint32_t
len
=
pSql
->
cmd
.
payloadLen
;
if
(
len
>
0
)
{
tmpData
=
calloc
(
1
,
len
);
if
(
NULL
==
tmpData
)
{
return
TSDB_CODE_CLI_OUT_OF_MEMORY
;
}
// STagData is in binary format, strncpy is not available
memcpy
(
tmpData
,
pSql
->
cmd
.
payload
,
pSql
->
cmd
.
allocSize
);
memcpy
(
tmpData
,
pSql
->
cmd
.
payload
,
len
);
}
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
...
...
@@ -1509,9 +1510,9 @@ int tscBuildTableMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pMsg
=
(
char
*
)
pInfoMsg
+
sizeof
(
SCMTableInfoMsg
);
if
(
pSql
->
cmd
.
autoCreated
)
{
memcpy
(
pInfoMsg
->
tags
,
tmpData
,
sizeof
(
STagData
)
);
pMsg
+=
sizeof
(
STagData
)
;
if
(
pSql
->
cmd
.
autoCreated
&&
len
>
0
)
{
memcpy
(
pInfoMsg
->
tags
,
tmpData
,
len
);
pMsg
+=
len
;
}
pCmd
->
payloadLen
=
pMsg
-
(
char
*
)
pInfoMsg
;;
...
...
@@ -2394,7 +2395,7 @@ static int32_t getTableMetaFromMgmt(SSqlObj *pSql, STableMetaInfo *pTableMetaInf
tscGetQueryInfoDetailSafely
(
&
pNew
->
cmd
,
0
,
&
pNewQueryInfo
);
pNew
->
cmd
.
autoCreated
=
pSql
->
cmd
.
autoCreated
;
// create table if not exists
if
(
TSDB_CODE_SUCCESS
!=
tscAllocPayload
(
&
pNew
->
cmd
,
TSDB_DEFAULT_PAYLOAD_SIZE
))
{
if
(
TSDB_CODE_SUCCESS
!=
tscAllocPayload
(
&
pNew
->
cmd
,
TSDB_DEFAULT_PAYLOAD_SIZE
+
pSql
->
cmd
.
payloadLen
))
{
tscError
(
"%p malloc failed for payload to get table meta"
,
pSql
);
free
(
pNew
);
...
...
@@ -2405,7 +2406,8 @@ static int32_t getTableMetaFromMgmt(SSqlObj *pSql, STableMetaInfo *pTableMetaInf
assert
(
pNew
->
cmd
.
numOfClause
==
1
&&
pNewQueryInfo
->
numOfTables
==
1
);
strncpy
(
pNewMeterMetaInfo
->
name
,
pTableMetaInfo
->
name
,
tListLen
(
pNewMeterMetaInfo
->
name
));
memcpy
(
pNew
->
cmd
.
payload
,
pSql
->
cmd
.
payload
,
TSDB_DEFAULT_PAYLOAD_SIZE
);
// tag information if table does not exists.
memcpy
(
pNew
->
cmd
.
payload
,
pSql
->
cmd
.
payload
,
pSql
->
cmd
.
payloadLen
);
// tag information if table does not exists.
pNew
->
cmd
.
payloadLen
=
pSql
->
cmd
.
payloadLen
;
tscTrace
(
"%p new pSqlObj:%p to get tableMeta, auto create:%d"
,
pSql
,
pNew
,
pNew
->
cmd
.
autoCreated
);
pNew
->
fp
=
tscTableMetaCallBack
;
...
...
src/mnode/src/mgmtTable.c
浏览文件 @
9b792a8d
...
...
@@ -1736,7 +1736,12 @@ static void mgmtAutoCreateChildTable(SQueuedMsg *pMsg) {
pCreateMsg
->
igExists
=
1
;
pCreateMsg
->
getMeta
=
1
;
pCreateMsg
->
contLen
=
htonl
(
contLen
);
memcpy
(
pCreateMsg
->
schema
,
pInfo
->
tags
,
sizeof
(
STagData
));
contLen
=
sizeof
(
STagData
);
if
(
contLen
>
pMsg
->
contLen
-
sizeof
(
SCMTableInfoMsg
))
{
contLen
=
pMsg
->
contLen
-
sizeof
(
SCMTableInfoMsg
);
}
memcpy
(
pCreateMsg
->
schema
,
pInfo
->
tags
,
contLen
);
SQueuedMsg
*
newMsg
=
mgmtCloneQueuedMsg
(
pMsg
);
pMsg
->
pCont
=
newMsg
->
pCont
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录