Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
7e0d1ccf
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7e0d1ccf
编写于
6月 17, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
When modifying the table schema, the calculation of memory size is wrong
上级
4aecd61a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
111 addition
and
49 deletion
+111
-49
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+110
-47
src/mnode/src/mnodeVgroup.c
src/mnode/src/mnodeVgroup.c
+1
-1
tests/script/unique/dnode/balance3.sim
tests/script/unique/dnode/balance3.sim
+0
-1
未找到文件。
src/mnode/src/mnodeTable.c
浏览文件 @
7e0d1ccf
...
...
@@ -185,7 +185,7 @@ static int32_t mnodeChildTableActionUpdate(SSdbOper *pOper) {
void
*
oldTableId
=
pTable
->
info
.
tableId
;
void
*
oldSql
=
pTable
->
sql
;
void
*
oldSchema
=
pTable
->
schema
;
memcpy
(
pTable
,
pNew
,
pOper
->
rowSize
);
memcpy
(
pTable
,
pNew
,
sizeof
(
SChildTableObj
)
);
pTable
->
sql
=
pNew
->
sql
;
pTable
->
schema
=
pNew
->
schema
;
free
(
pNew
);
...
...
@@ -439,7 +439,7 @@ static int32_t mnodeSuperTableActionUpdate(SSdbOper *pOper) {
if
(
pTable
!=
pNew
)
{
void
*
oldTableId
=
pTable
->
info
.
tableId
;
void
*
oldSchema
=
pTable
->
schema
;
memcpy
(
pTable
,
pNew
,
pOper
->
rowSize
);
memcpy
(
pTable
,
pNew
,
sizeof
(
SSuperTableObj
)
);
pTable
->
schema
=
pNew
->
schema
;
free
(
pNew
->
vgHash
);
free
(
pNew
);
...
...
@@ -878,7 +878,16 @@ static int32_t mnodeFindSuperTableTagIndex(SSuperTableObj *pStable, const char *
return
-
1
;
}
static
int32_t
mnodeAddSuperTableTag
(
SMnodeMsg
*
pMsg
,
SSuperTableObj
*
pStable
,
SSchema
schema
[],
int32_t
ntags
)
{
static
int32_t
mnodeAddSuperTableTagCb
(
SMnodeMsg
*
pMsg
,
int32_t
code
)
{
SSuperTableObj
*
pStable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
mLPrint
(
"app:%p:%p, stable %s, add tag result:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
tstrerror
(
code
));
return
code
;
}
static
int32_t
mnodeAddSuperTableTag
(
SMnodeMsg
*
pMsg
,
SSchema
schema
[],
int32_t
ntags
)
{
SSuperTableObj
*
pStable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
if
(
pStable
->
numOfTags
+
ntags
>
TSDB_MAX_TAGS
)
{
mError
(
"app:%p:%p, stable:%s, add tag, too many tags"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
);
return
TSDB_CODE_MND_TOO_MANY_TAGS
;
...
...
@@ -911,24 +920,34 @@ static int32_t mnodeAddSuperTableTag(SMnodeMsg *pMsg, SSuperTableObj *pStable, S
pStable
->
numOfTags
+=
ntags
;
pStable
->
tversion
++
;
mPrint
(
"app:%p:%p, stable %s, start to add tag %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
schema
[
0
].
name
);
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
.
pMsg
=
pMsg
.
pMsg
=
pMsg
,
.
cb
=
mnodeAddSuperTableTagCb
};
int32_t
code
=
sdbUpdateRow
(
&
oper
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
mPrint
(
"app:%p:%p, stable %s, succeed to add tag %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
schema
[
0
].
name
);
code
=
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
return
code
;
}
static
int32_t
mnodeDropSuperTableTag
(
SMnodeMsg
*
pMsg
,
SSuperTableObj
*
pStable
,
char
*
tagName
)
{
static
int32_t
mnodeDropSuperTableTagCb
(
SMnodeMsg
*
pMsg
,
int32_t
code
)
{
SSuperTableObj
*
pStable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
mLPrint
(
"app:%p:%p, stable %s, drop tag result:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
tstrerror
(
code
));
return
code
;
}
static
int32_t
mnodeDropSuperTableTag
(
SMnodeMsg
*
pMsg
,
char
*
tagName
)
{
SSuperTableObj
*
pStable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
int32_t
col
=
mnodeFindSuperTableTagIndex
(
pStable
,
tagName
);
if
(
col
<
0
)
{
mError
(
"app:%p:%p, stable:%s, drop tag, tag:%s not exist"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
...
...
@@ -941,24 +960,33 @@ static int32_t mnodeDropSuperTableTag(SMnodeMsg *pMsg, SSuperTableObj *pStable,
pStable
->
numOfTags
--
;
pStable
->
tversion
++
;
mPrint
(
"app:%p:%p, stable %s, start to drop tag %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
tagName
);
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
.
pMsg
=
pMsg
.
pMsg
=
pMsg
,
.
cb
=
mnodeDropSuperTableTagCb
};
int32_t
code
=
sdbUpdateRow
(
&
oper
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
mPrint
(
"app:%p:%p, stable %s, succeed to drop tag %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
tagName
);
code
=
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
return
code
;
}
static
int32_t
mnodeModifySuperTableTagName
(
SMnodeMsg
*
pMsg
,
SSuperTableObj
*
pStable
,
char
*
oldTagName
,
char
*
newTagName
)
{
static
int32_t
mnodeModifySuperTableTagNameCb
(
SMnodeMsg
*
pMsg
,
int32_t
code
)
{
SSuperTableObj
*
pStable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
mLPrint
(
"app:%p:%p, stable %s, modify tag result:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
tstrerror
(
code
));
return
code
;
}
static
int32_t
mnodeModifySuperTableTagName
(
SMnodeMsg
*
pMsg
,
char
*
oldTagName
,
char
*
newTagName
)
{
SSuperTableObj
*
pStable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
int32_t
col
=
mnodeFindSuperTableTagIndex
(
pStable
,
oldTagName
);
if
(
col
<
0
)
{
mError
(
"app:%p:%p, stable:%s, failed to modify table tag, oldName: %s, newName: %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
...
...
@@ -980,17 +1008,19 @@ static int32_t mnodeModifySuperTableTagName(SMnodeMsg *pMsg, SSuperTableObj *pSt
SSchema
*
schema
=
(
SSchema
*
)
(
pStable
->
schema
+
pStable
->
numOfColumns
+
col
);
tstrncpy
(
schema
->
name
,
newTagName
,
sizeof
(
schema
->
name
));
mPrint
(
"app:%p:%p, stable %s, start to modify tag %s to %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
oldTagName
,
newTagName
);
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
.
pMsg
=
pMsg
.
pMsg
=
pMsg
,
.
cb
=
mnodeModifySuperTableTagNameCb
};
int32_t
code
=
sdbUpdateRow
(
&
oper
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
mPrint
(
"app:%p:%p, stable %s, succeed to modify tag %s to %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
oldTagName
,
newTagName
);
code
=
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
...
...
@@ -1008,8 +1038,16 @@ static int32_t mnodeFindSuperTableColumnIndex(SSuperTableObj *pStable, char *col
return
-
1
;
}
static
int32_t
mnodeAddSuperTableColumn
(
SMnodeMsg
*
pMsg
,
SSuperTableObj
*
pStable
,
SSchema
schema
[],
int32_t
ncols
)
{
static
int32_t
mnodeAddSuperTableColumnCb
(
SMnodeMsg
*
pMsg
,
int32_t
code
)
{
SSuperTableObj
*
pStable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
mLPrint
(
"app:%p:%p, stable %s, add column result:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
tstrerror
(
code
));
return
code
;
}
static
int32_t
mnodeAddSuperTableColumn
(
SMnodeMsg
*
pMsg
,
SSchema
schema
[],
int32_t
ncols
)
{
SDbObj
*
pDb
=
pMsg
->
pDb
;
SSuperTableObj
*
pStable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
if
(
ncols
<=
0
)
{
mError
(
"app:%p:%p, stable:%s, add column, ncols:%d <= 0"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
);
return
TSDB_CODE_MND_APP_ERROR
;
...
...
@@ -1050,24 +1088,34 @@ static int32_t mnodeAddSuperTableColumn(SMnodeMsg *pMsg, SSuperTableObj *pStable
mnodeDecAcctRef
(
pAcct
);
}
mPrint
(
"app:%p:%p, stable %s, start to add column"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
);
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
.
pMsg
=
pMsg
.
pMsg
=
pMsg
,
.
cb
=
mnodeAddSuperTableColumnCb
};
int32_t
code
=
sdbUpdateRow
(
&
oper
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
mPrint
(
"app:%p:%p, stable %s, succeed to add column"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
);
code
=
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
return
code
;
}
static
int32_t
mnodeDropSuperTableColumn
(
SMnodeMsg
*
pMsg
,
SSuperTableObj
*
pStable
,
char
*
colName
)
{
static
int32_t
mnodeDropSuperTableColumnCb
(
SMnodeMsg
*
pMsg
,
int32_t
code
)
{
SSuperTableObj
*
pStable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
mLPrint
(
"app:%p:%p, stable %s, delete column result:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
tstrerror
(
code
));
return
code
;
}
static
int32_t
mnodeDropSuperTableColumn
(
SMnodeMsg
*
pMsg
,
char
*
colName
)
{
SDbObj
*
pDb
=
pMsg
->
pDb
;
SSuperTableObj
*
pStable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
int32_t
col
=
mnodeFindSuperTableColumnIndex
(
pStable
,
colName
);
if
(
col
<=
0
)
{
mError
(
"app:%p:%p, stable:%s, drop column, column:%s not exist"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
,
...
...
@@ -1090,16 +1138,18 @@ static int32_t mnodeDropSuperTableColumn(SMnodeMsg *pMsg, SSuperTableObj *pStabl
mnodeDecAcctRef
(
pAcct
);
}
mPrint
(
"app:%p:%p, stable %s, start to delete column"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
);
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsSuperTableSdb
,
.
pObj
=
pStable
,
.
pMsg
=
pMsg
.
pMsg
=
pMsg
,
.
cb
=
mnodeDropSuperTableColumnCb
};
int32_t
code
=
sdbUpdateRow
(
&
oper
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
mPrint
(
"app:%p:%p, stable %s, succeed to delete column"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pStable
->
info
.
tableId
);
code
=
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
...
...
@@ -1674,10 +1724,6 @@ static int32_t mnodeProcessDropChildTableMsg(SMnodeMsg *pMsg) {
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
static
int32_t
mnodeModifyChildTableTagValue
(
SChildTableObj
*
pTable
,
char
*
tagName
,
char
*
nContent
)
{
return
TSDB_CODE_COM_OPS_NOT_SUPPORT
;
}
static
int32_t
mnodeFindNormalTableColumnIndex
(
SChildTableObj
*
pTable
,
char
*
colName
)
{
SSchema
*
schema
=
(
SSchema
*
)
pTable
->
schema
;
for
(
int32_t
col
=
0
;
col
<
pTable
->
numOfColumns
;
col
++
)
{
...
...
@@ -1689,16 +1735,24 @@ static int32_t mnodeFindNormalTableColumnIndex(SChildTableObj *pTable, char *col
return
-
1
;
}
static
int32_t
mnodeAddNormalTableColumn
(
SMnodeMsg
*
pMsg
,
SChildTableObj
*
pTable
,
SSchema
schema
[],
int32_t
ncols
)
{
static
int32_t
mnodeAddNormalTableColumnCb
(
SMnodeMsg
*
pMsg
,
int32_t
code
)
{
SSuperTableObj
*
pTable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
mLPrint
(
"app:%p:%p, ctable %s, add column result:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
tstrerror
(
code
));
return
code
;
}
static
int32_t
mnodeAddNormalTableColumn
(
SMnodeMsg
*
pMsg
,
SSchema
schema
[],
int32_t
ncols
)
{
SChildTableObj
*
pTable
=
(
SChildTableObj
*
)
pMsg
->
pTable
;
SDbObj
*
pDb
=
pMsg
->
pDb
;
if
(
ncols
<=
0
)
{
mError
(
"app:%p:%p, table:%s, add column, ncols:%d <= 0"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
);
mError
(
"app:%p:%p,
c
table:%s, add column, ncols:%d <= 0"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
);
return
TSDB_CODE_MND_APP_ERROR
;
}
for
(
int32_t
i
=
0
;
i
<
ncols
;
i
++
)
{
if
(
mnodeFindNormalTableColumnIndex
(
pTable
,
schema
[
i
].
name
)
>
0
)
{
mError
(
"app:%p:%p, table:%s, add column, column:%s already exist"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
mError
(
"app:%p:%p,
c
table:%s, add column, column:%s already exist"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
schema
[
i
].
name
);
return
TSDB_CODE_MND_FIELD_ALREAY_EXIST
;
}
...
...
@@ -1723,27 +1777,37 @@ static int32_t mnodeAddNormalTableColumn(SMnodeMsg *pMsg, SChildTableObj *pTable
mnodeDecAcctRef
(
pAcct
);
}
mPrint
(
"app:%p:%p, ctable %s, start to add column"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
);
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
,
.
pMsg
=
pMsg
.
pMsg
=
pMsg
,
.
cb
=
mnodeAddNormalTableColumnCb
};
int32_t
code
=
sdbUpdateRow
(
&
oper
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
mPrint
(
"app:%p:%p, table %s, succeed to add column"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
);
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
return
code
;
}
static
int32_t
mnodeDropNormalTableColumn
(
SMnodeMsg
*
pMsg
,
SChildTableObj
*
pTable
,
char
*
colName
)
{
static
int32_t
mnodeDropNormalTableColumnCb
(
SMnodeMsg
*
pMsg
,
int32_t
code
)
{
SSuperTableObj
*
pTable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
mLPrint
(
"app:%p:%p, ctable %s, drop column result:%s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
tstrerror
(
code
));
return
code
;
}
static
int32_t
mnodeDropNormalTableColumn
(
SMnodeMsg
*
pMsg
,
char
*
colName
)
{
SDbObj
*
pDb
=
pMsg
->
pDb
;
SChildTableObj
*
pTable
=
(
SChildTableObj
*
)
pMsg
->
pTable
;
int32_t
col
=
mnodeFindNormalTableColumnIndex
(
pTable
,
colName
);
if
(
col
<=
0
)
{
mError
(
"app:%p:%p, table:%s, drop column, column:%s not exist"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
mError
(
"app:%p:%p,
c
table:%s, drop column, column:%s not exist"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
colName
);
return
TSDB_CODE_MND_FIELD_NOT_EXIST
;
}
...
...
@@ -1758,16 +1822,18 @@ static int32_t mnodeDropNormalTableColumn(SMnodeMsg *pMsg, SChildTableObj *pTabl
mnodeDecAcctRef
(
pAcct
);
}
mPrint
(
"app:%p:%p, ctable %s, start to drop column %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
colName
);
SSdbOper
oper
=
{
.
type
=
SDB_OPER_GLOBAL
,
.
table
=
tsChildTableSdb
,
.
pObj
=
pTable
,
.
pMsg
=
pMsg
.
pMsg
=
pMsg
,
.
cb
=
mnodeDropNormalTableColumnCb
};
int32_t
code
=
sdbUpdateRow
(
&
oper
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
mPrint
(
"app:%p:%p, table %s, succeed to drop column %s"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pTable
->
info
.
tableId
,
colName
);
return
TSDB_CODE_MND_ACTION_IN_PROGRESS
;
}
...
...
@@ -2323,30 +2389,27 @@ static int32_t mnodeProcessAlterTableMsg(SMnodeMsg *pMsg) {
int32_t
code
=
TSDB_CODE_COM_OPS_NOT_SUPPORT
;
if
(
pMsg
->
pTable
->
type
==
TSDB_SUPER_TABLE
)
{
SSuperTableObj
*
pTable
=
(
SSuperTableObj
*
)
pMsg
->
pTable
;
mTrace
(
"app:%p:%p, table:%s, start to alter stable"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pAlter
->
tableId
);
if
(
pAlter
->
type
==
TSDB_ALTER_TABLE_ADD_TAG_COLUMN
)
{
code
=
mnodeAddSuperTableTag
(
pMsg
,
p
Table
,
p
Alter
->
schema
,
1
);
code
=
mnodeAddSuperTableTag
(
pMsg
,
pAlter
->
schema
,
1
);
}
else
if
(
pAlter
->
type
==
TSDB_ALTER_TABLE_DROP_TAG_COLUMN
)
{
code
=
mnodeDropSuperTableTag
(
pMsg
,
p
Table
,
p
Alter
->
schema
[
0
].
name
);
code
=
mnodeDropSuperTableTag
(
pMsg
,
pAlter
->
schema
[
0
].
name
);
}
else
if
(
pAlter
->
type
==
TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN
)
{
code
=
mnodeModifySuperTableTagName
(
pMsg
,
p
Table
,
p
Alter
->
schema
[
0
].
name
,
pAlter
->
schema
[
1
].
name
);
code
=
mnodeModifySuperTableTagName
(
pMsg
,
pAlter
->
schema
[
0
].
name
,
pAlter
->
schema
[
1
].
name
);
}
else
if
(
pAlter
->
type
==
TSDB_ALTER_TABLE_ADD_COLUMN
)
{
code
=
mnodeAddSuperTableColumn
(
pMsg
,
p
Table
,
p
Alter
->
schema
,
1
);
code
=
mnodeAddSuperTableColumn
(
pMsg
,
pAlter
->
schema
,
1
);
}
else
if
(
pAlter
->
type
==
TSDB_ALTER_TABLE_DROP_COLUMN
)
{
code
=
mnodeDropSuperTableColumn
(
pMsg
,
p
Table
,
p
Alter
->
schema
[
0
].
name
);
code
=
mnodeDropSuperTableColumn
(
pMsg
,
pAlter
->
schema
[
0
].
name
);
}
else
{
}
}
else
{
mTrace
(
"app:%p:%p, table:%s, start to alter ctable"
,
pMsg
->
rpcMsg
.
ahandle
,
pMsg
,
pAlter
->
tableId
);
SChildTableObj
*
pTable
=
(
SChildTableObj
*
)
pMsg
->
pTable
;
if
(
pAlter
->
type
==
TSDB_ALTER_TABLE_UPDATE_TAG_VAL
)
{
char
*
tagVal
=
(
char
*
)(
pAlter
->
schema
+
pAlter
->
numOfCols
);
code
=
mnodeModifyChildTableTagValue
(
pTable
,
pAlter
->
schema
[
0
].
name
,
tagVal
);
return
TSDB_CODE_COM_OPS_NOT_SUPPORT
;
}
else
if
(
pAlter
->
type
==
TSDB_ALTER_TABLE_ADD_COLUMN
)
{
code
=
mnodeAddNormalTableColumn
(
pMsg
,
p
Table
,
p
Alter
->
schema
,
1
);
code
=
mnodeAddNormalTableColumn
(
pMsg
,
pAlter
->
schema
,
1
);
}
else
if
(
pAlter
->
type
==
TSDB_ALTER_TABLE_DROP_COLUMN
)
{
code
=
mnodeDropNormalTableColumn
(
pMsg
,
p
Table
,
p
Alter
->
schema
[
0
].
name
);
code
=
mnodeDropNormalTableColumn
(
pMsg
,
pAlter
->
schema
[
0
].
name
);
}
else
{
}
}
...
...
src/mnode/src/mnodeVgroup.c
浏览文件 @
7e0d1ccf
...
...
@@ -149,7 +149,7 @@ static int32_t mnodeVgroupActionUpdate(SSdbOper *pOper) {
}
}
memcpy
(
pVgroup
,
pNew
,
pOper
->
rowSize
);
memcpy
(
pVgroup
,
pNew
,
sizeof
(
SVgObj
)
);
free
(
pNew
);
for
(
int32_t
i
=
0
;
i
<
pVgroup
->
numOfVnodes
;
++
i
)
{
...
...
tests/script/unique/dnode/balance3.sim
浏览文件 @
7e0d1ccf
...
...
@@ -177,7 +177,6 @@ endi
print ========== step5
sql create dnode $hostname6
system sh/deploy.sh -n dnode6 -i 6
system sh/exec.sh -n dnode6 -s start
$x = 0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录