You need to sign in or sign up before continuing.
提交 7c82b122 编写于 作者: M Minglei Jin

fix: return error if stable's name duplicate with child table

上级 393ee81e
......@@ -176,6 +176,15 @@ int metaCreateSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
// validate req
metaReaderInit(&mr, pMeta, 0);
if (metaGetTableEntryByName(&mr, pReq->name) == 0) {
if (mr.me.type == TSDB_SUPER_TABLE) {
metaReaderClear(&mr);
return 0;
} else {
terrno = TSDB_CODE_TDB_STB_ALREADY_EXIST;
metaReaderClear(&mr);
return -1;
}
/*
// TODO: just for pass case
#if 0
terrno = TSDB_CODE_TDB_STB_ALREADY_EXIST;
......@@ -185,6 +194,7 @@ int metaCreateSTable(SMeta *pMeta, int64_t version, SVCreateStbReq *pReq) {
metaReaderClear(&mr);
return 0;
#endif
*/
}
metaReaderClear(&mr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册