Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c7a10ae5
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看板
提交
c7a10ae5
编写于
3月 14, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:use table suid in taosx to avoid suid is not same for using suid
上级
e98b32a6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
9 deletion
+39
-9
source/client/src/clientRawBlockWrite.c
source/client/src/clientRawBlockWrite.c
+39
-9
未找到文件。
source/client/src/clientRawBlockWrite.c
浏览文件 @
c7a10ae5
...
...
@@ -776,12 +776,32 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
goto
end
;
}
SCatalog
*
pCatalog
=
NULL
;
code
=
catalogGetHandle
(
pRequest
->
pTscObj
->
pAppInfo
->
clusterId
,
&
pCatalog
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
end
;
}
SRequestConnInfo
conn
=
{.
pTrans
=
pRequest
->
pTscObj
->
pAppInfo
->
pTransporter
,
.
requestId
=
pRequest
->
requestId
,
.
requestObjRefId
=
pRequest
->
self
,
.
mgmtEps
=
getEpSet_s
(
&
pRequest
->
pTscObj
->
pAppInfo
->
mgmtEp
)};
SName
pName
=
{
0
};
toName
(
pRequest
->
pTscObj
->
acctId
,
pRequest
->
pDb
,
req
.
name
,
&
pName
);
STableMeta
*
pTableMeta
=
NULL
;
code
=
catalogGetTableMeta
(
pCatalog
,
&
conn
,
&
pName
,
&
pTableMeta
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
uError
(
"taosCreateTable:catalogGetTableMeta failed. table name: %s"
,
req
.
name
);
goto
end
;
}
pReq
.
suid
=
pTableMeta
->
uid
;
taosMemoryFreeClear
(
pTableMeta
);
// build drop stable
pReq
.
igNotExists
=
true
;
pReq
.
source
=
TD_REQ_FROM_TAOX
;
pReq
.
suid
=
processSuid
(
req
.
suid
,
pRequest
->
pDb
);
//
pReq.suid = processSuid(req.suid, pRequest->pDb);
uDebug
(
"taosDropStb name:%s suid:%"
PRId64
"
processS
uid:%"
PRId64
,
req
.
name
,
req
.
suid
,
pReq
.
suid
);
uDebug
(
"taosDropStb name:%s suid:%"
PRId64
"
new s
uid:%"
PRId64
,
req
.
name
,
req
.
suid
,
pReq
.
suid
);
STscObj
*
pTscObj
=
pRequest
->
pTscObj
;
SName
tableName
=
{
0
};
tNameExtractFullName
(
toName
(
pTscObj
->
acctId
,
pRequest
->
pDb
,
req
.
name
,
&
tableName
),
pReq
.
name
);
...
...
@@ -806,7 +826,7 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
launchQueryImpl
(
pRequest
,
&
pQuery
,
true
,
NULL
);
if
(
pRequest
->
code
==
TSDB_CODE_SUCCESS
)
{
SCatalog
*
pCatalog
=
NULL
;
//
SCatalog* pCatalog = NULL;
catalogGetHandle
(
pTscObj
->
pAppInfo
->
clusterId
,
&
pCatalog
);
catalogRemoveTableMeta
(
pCatalog
,
&
tableName
);
}
...
...
@@ -900,15 +920,15 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
STableMeta
*
pTableMeta
=
NULL
;
SName
sName
=
{
0
};
tb_uid_t
oldSuid
=
pCreateReq
->
ctb
.
suid
;
pCreateReq
->
ctb
.
suid
=
processSuid
(
pCreateReq
->
ctb
.
suid
,
pRequest
->
pDb
);
uDebug
(
"taosCreateTable name:%s sname:%s suid:%"
PRId64
" processSuid:%"
PRId64
,
pCreateReq
->
name
,
pCreateReq
->
ctb
.
stbName
,
pCreateReq
->
ctb
.
suid
,
oldSuid
);
// pCreateReq->ctb.suid = processSuid(pCreateReq->ctb.suid, pRequest->pDb);
toName
(
pTscObj
->
acctId
,
pRequest
->
pDb
,
pCreateReq
->
ctb
.
stbName
,
&
sName
);
code
=
catalogGetTableMeta
(
pCatalog
,
&
conn
,
&
sName
,
&
pTableMeta
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
uError
(
"taosCreateTable:catalogGetTableMeta failed. table name: %s"
,
pCreateReq
->
ctb
.
stbName
);
goto
end
;
}
pCreateReq
->
ctb
.
suid
=
pTableMeta
->
uid
;
uDebug
(
"taosCreateTable name:%s sname:%s suid:%"
PRId64
" new suid:%"
PRId64
,
pCreateReq
->
name
,
pCreateReq
->
ctb
.
stbName
,
oldSuid
,
pCreateReq
->
ctb
.
suid
);
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pCreateReq
->
ctb
.
tagName
);
i
++
)
{
char
*
tName
=
taosArrayGet
(
pCreateReq
->
ctb
.
tagName
,
i
);
...
...
@@ -1041,8 +1061,7 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
for
(
int32_t
iReq
=
0
;
iReq
<
req
.
nReqs
;
iReq
++
)
{
pDropReq
=
req
.
pReqs
+
iReq
;
pDropReq
->
igNotExists
=
true
;
pDropReq
->
suid
=
processSuid
(
pDropReq
->
suid
,
pRequest
->
pDb
);
uDebug
(
"taosDropTable name:%s suid:%"
PRId64
" processSuid:%"
PRId64
,
pDropReq
->
name
,
pDropReq
->
suid
,
pDropReq
->
suid
);
// pDropReq->suid = processSuid(pDropReq->suid, pRequest->pDb);
SVgroupInfo
pInfo
=
{
0
};
SName
pName
=
{
0
};
...
...
@@ -1052,6 +1071,17 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
goto
end
;
}
STableMeta
*
pTableMeta
=
NULL
;
code
=
catalogGetTableMeta
(
pCatalog
,
&
conn
,
&
pName
,
&
pTableMeta
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
uError
(
"taosDropTable:catalogGetTableMeta failed. table name: %s"
,
pDropReq
->
name
);
goto
end
;
}
tb_uid_t
oldSuid
=
pDropReq
->
suid
;
pDropReq
->
suid
=
pTableMeta
->
suid
;
taosMemoryFreeClear
(
pTableMeta
);
uDebug
(
"taosDropTable name:%s suid:%"
PRId64
" new suid:%"
PRId64
,
pDropReq
->
name
,
oldSuid
,
pDropReq
->
suid
);
taosArrayPush
(
pRequest
->
tableList
,
&
pName
);
SVgroupDropTableBatch
*
pTableBatch
=
taosHashGet
(
pVgroupHashmap
,
&
pInfo
.
vgId
,
sizeof
(
pInfo
.
vgId
));
if
(
pTableBatch
==
NULL
)
{
...
...
@@ -1673,7 +1703,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
}
if
(
strcmp
(
tbName
,
pCreateReq
.
name
)
==
0
)
{
cloneSVreateTbReq
(
&
pCreateReq
,
&
pCreateReqDst
);
pCreateReqDst
->
ctb
.
suid
=
processSuid
(
pCreateReqDst
->
ctb
.
suid
,
pRequest
->
pDb
);
//
pCreateReqDst->ctb.suid = processSuid(pCreateReqDst->ctb.suid, pRequest->pDb);
tDecoderClear
(
&
decoderTmp
);
break
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录