Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yiicenne
TDengine
提交
c0643c94
TDengine
项目概览
yiicenne
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c0643c94
编写于
6月 23, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-705] invalid read while create table
上级
2e12fbfa
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
16 deletion
+31
-16
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+31
-16
未找到文件。
src/mnode/src/mnodeTable.c
浏览文件 @
c0643c94
...
@@ -780,6 +780,16 @@ static int32_t mnodeProcessTableMetaMsg(SMnodeMsg *pMsg) {
...
@@ -780,6 +780,16 @@ static int32_t mnodeProcessTableMetaMsg(SMnodeMsg *pMsg) {
}
}
}
}
static
int32_t
mnodeCreateSuperTableCb
(
SMnodeMsg
*
pMsg
,
int32_t
code
)
{
SSuperTableObj
*
pTable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
if
(
pTable
!=
NULL
)
{
mLPrint
(
"app:%p:%p, stable:%s, create result:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
tstrerror
(
code
));
}
return
code
;
}
static
int32_t
mnodeProcessCreateSuperTableMsg
(
SMnodeMsg
*
pMsg
)
{
static
int32_t
mnodeProcessCreateSuperTableMsg
(
SMnodeMsg
*
pMsg
)
{
if
(
pMsg
==
NULL
)
return
TSDB_CODE_MND_APP_ERROR
;
if
(
pMsg
==
NULL
)
return
TSDB_CODE_MND_APP_ERROR
;
...
@@ -819,25 +829,27 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) {
...
@@ -819,25 +829,27 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) {
assert
(
tschema
[
col
].
type
>=
TSDB_DATA_TYPE_BOOL
&&
tschema
[
col
].
type
<=
TSDB_DATA_TYPE_NCHAR
);
assert
(
tschema
[
col
].
type
>=
TSDB_DATA_TYPE_BOOL
&&
tschema
[
col
].
type
<=
TSDB_DATA_TYPE_NCHAR
);
}
}
pMsg
->
pTable
=
(
STableObj
*
)
pStable
;
mnodeIncTableRef
(
pMsg
->
pTable
);
SSdbOper
oper
=
{
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
.
pObj
=
pStable
,
.
rowSize
=
sizeof
(
SSuperTableObj
)
+
schemaSize
,
.
rowSize
=
sizeof
(
SSuperTableObj
)
+
schemaSize
,
.
pMsg
=
pMsg
.
pMsg
=
pMsg
,
.
cb
=
mnodeCreateSuperTableCb
};
};
int32_t
code
=
sdbInsertRow
(
&
oper
);
int32_t
code
=
sdbInsertRow
(
&
oper
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
mnodeDestroySuperTable
(
pStable
);
mnodeDestroySuperTable
(
pStable
);
pMsg
->
pTable
=
NULL
;
mError
(
"app:%p:%p, table:%s, failed to create, sdb error"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pCreate
->
tableId
);
mError
(
"app:%p:%p, table:%s, failed to create, sdb error"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pCreate
->
tableId
);
return
code
;
}
else
{
}
else
{
mLPrint
(
"app:%p:%p, table:%s, is created, tags:%d fields:%d"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
pStable
->
numOfTags
,
pStable
->
numOfColumns
);
code
=
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
}
return
code
;
}
}
static
int32_t
mnodeProcessDropSuperTableMsg
(
SMnodeMsg
*
pMsg
)
{
static
int32_t
mnodeProcessDropSuperTableMsg
(
SMnodeMsg
*
pMsg
)
{
...
@@ -1535,10 +1547,16 @@ static void *mnodeBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableO
...
@@ -1535,10 +1547,16 @@ static void *mnodeBuildCreateChildTableMsg(SCMCreateTableMsg *pMsg, SChildTableO
}
}
static
int32_t
mnodeDoCreateChildTableCb
(
SMnodeMsg
*
pMsg
,
int32_t
code
)
{
static
int32_t
mnodeDoCreateChildTableCb
(
SMnodeMsg
*
pMsg
,
int32_t
code
)
{
SChildTableObj
*
pTable
=
(
SChildTableObj
*
)
pMsg
->
pTable
;
if
(
pTable
!=
NULL
)
{
mTrace
(
"app:%p:%p, table:%s, create table in id:%d, uid:%"
PRIu64
", result:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
pTable
->
sid
,
pTable
->
uid
,
tstrerror
(
code
));
}
if
(
code
!=
TSDB_CODE_SUCCESS
)
return
code
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
return
code
;
SCMCreateTableMsg
*
pCreate
=
pMsg
->
rpcMsg
.
pCont
;
SCMCreateTableMsg
*
pCreate
=
pMsg
->
rpcMsg
.
pCont
;
SMDCreateTableMsg
*
pMDCreate
=
mnodeBuildCreateChildTableMsg
(
pCreate
,
(
SChildTableObj
*
)
pMsg
->
pTable
);
SMDCreateTableMsg
*
pMDCreate
=
mnodeBuildCreateChildTableMsg
(
pCreate
,
pTable
);
if
(
pMDCreate
==
NULL
)
{
if
(
pMDCreate
==
NULL
)
{
return
terrno
;
return
terrno
;
}
}
...
@@ -1639,16 +1657,13 @@ static int32_t mnodeDoCreateChildTable(SMnodeMsg *pMsg, int32_t tid) {
...
@@ -1639,16 +1657,13 @@ static int32_t mnodeDoCreateChildTable(SMnodeMsg *pMsg, int32_t tid) {
int32_t
code
=
sdbInsertRow
(
&
desc
);
int32_t
code
=
sdbInsertRow
(
&
desc
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
free
(
pTable
);
mnodeDestroyChildTable
(
pTable
);
pMsg
->
pTable
=
NULL
;
mError
(
"app:%p:%p, table:%s, update sdb error, reason:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pCreate
->
tableId
,
mError
(
"app:%p:%p, table:%s, update sdb error, reason:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pCreate
->
tableId
,
tstrerror
(
code
));
tstrerror
(
code
));
pMsg
->
pTable
=
NULL
;
}
return
code
;
}
else
{
return
code
;
mTrace
(
"app:%p:%p, table:%s, create table in vgroup:%d, id:%d, uid:%"
PRIu64
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
pVgroup
->
vgId
,
pTable
->
sid
,
pTable
->
uid
);
return
TSDB_CODE_SUCCESS
;
}
}
}
static
int32_t
mnodeProcessCreateChildTableMsg
(
SMnodeMsg
*
pMsg
)
{
static
int32_t
mnodeProcessCreateChildTableMsg
(
SMnodeMsg
*
pMsg
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录