• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #3562

20 Dec 2024 09:57AM UTC coverage: 26.655% (-32.2%) from 58.812%
#3562

push

travis-ci

web-flow
Merge pull request #29229 from taosdata/enh/TS-5749-3.0

enh: seperate tsdb async tasks to different thread pools

21498 of 109421 branches covered (19.65%)

Branch coverage included in aggregate %.

66 of 96 new or added lines in 7 files covered. (68.75%)

39441 existing lines in 157 files now uncovered.

35007 of 102566 relevant lines covered (34.13%)

53922.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

37.78
/source/dnode/mnode/impl/src/mndView.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#include "mndView.h"
17
#include "mndShow.h"
18

19
int32_t mndInitView(SMnode *pMnode) {
13✔
20
  mndSetMsgHandle(pMnode, TDMT_MND_CREATE_VIEW, mndProcessCreateViewReq);
13✔
21
  mndSetMsgHandle(pMnode, TDMT_MND_DROP_VIEW, mndProcessDropViewReq);
13✔
22
  mndSetMsgHandle(pMnode, TDMT_MND_VIEW_META, mndProcessGetViewMetaReq);
13✔
23

24
  mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_VIEWS, mndRetrieveView);
13✔
25
  mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_VIEWS, mndCancelGetNextView);
13✔
26

27
#ifdef TD_ENTERPRISE
28
  initDynViewVersion();
13✔
29

30
  SSdbTable table = {
13✔
31
      .sdbType = SDB_VIEW,
32
      .keyType = SDB_KEY_BINARY,
33
      .encodeFp = (SdbEncodeFp)mndViewActionEncode,
34
      .decodeFp = (SdbDecodeFp)mndViewActionDecode,
35
      .insertFp = (SdbInsertFp)mndViewActionInsert,
36
      .updateFp = (SdbUpdateFp)mndViewActionUpdate,
37
      .deleteFp = (SdbDeleteFp)mndViewActionDelete,
38
  };
39

40
  return sdbSetTable(pMnode->pSdb, table);
13✔
41
#else
42
  return TSDB_CODE_SUCCESS;
43
#endif
44
}
45

46
void mndCleanupView(SMnode *pMnode) { mDebug("mnd view cleanup"); }
13✔
47

UNCOV
48
int32_t mndProcessCreateViewReq(SRpcMsg *pReq) {
×
49
#ifndef TD_ENTERPRISE
50
  return TSDB_CODE_OPS_NOT_SUPPORT;
51
#else
UNCOV
52
  SCMCreateViewReq createViewReq = {0};
×
UNCOV
53
  if (tDeserializeSCMCreateViewReq(pReq->pCont, pReq->contLen, &createViewReq) != 0) {
×
54
    TAOS_RETURN(TSDB_CODE_INVALID_MSG);
×
55
  }
56

UNCOV
57
  mInfo("start to create view:%s, sql:%s", createViewReq.fullname, createViewReq.sql);
×
58

UNCOV
59
  return mndProcessCreateViewReqImpl(&createViewReq, pReq);
×
60
#endif
61
}
62

UNCOV
63
int32_t mndProcessDropViewReq(SRpcMsg *pReq) {
×
64
#ifndef TD_ENTERPRISE
65
  return TSDB_CODE_OPS_NOT_SUPPORT;
66
#else
UNCOV
67
  SCMDropViewReq dropViewReq = {0};
×
UNCOV
68
  if (tDeserializeSCMDropViewReq(pReq->pCont, pReq->contLen, &dropViewReq) != 0) {
×
69
    TAOS_RETURN(TSDB_CODE_INVALID_MSG);
×
70
  }
71

UNCOV
72
  mInfo("start to drop view:%s, sql:%s", dropViewReq.name, dropViewReq.sql);
×
73

UNCOV
74
  return mndProcessDropViewReqImpl(&dropViewReq, pReq);
×
75
#endif
76
}
77

78
int32_t mndProcessGetViewMetaReq(SRpcMsg *pReq) {
9,851✔
79
#ifndef TD_ENTERPRISE
80
  return TSDB_CODE_OPS_NOT_SUPPORT;
81
#else
82
  SViewMetaReq req = {0};
9,851✔
83

84
  if (tDeserializeSViewMetaReq(pReq->pCont, pReq->contLen, &req) != 0) {
9,851!
85
    TAOS_RETURN(TSDB_CODE_INVALID_MSG);
×
86
  }
87

88
  return mndProcessViewMetaReqImpl(&req, pReq);
9,851✔
89
#endif
90
}
91

UNCOV
92
int32_t mndRetrieveView(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) {
×
93
#ifndef TD_ENTERPRISE
94
  return 0;
95
#else
UNCOV
96
  return mndRetrieveViewImpl(pReq, pShow, pBlock, rows);
×
97
#endif
98
}
99

100
void mndCancelGetNextView(SMnode *pMnode, void *pIter) {
×
101
  SSdb *pSdb = pMnode->pSdb;
×
102
  sdbCancelFetchByType(pSdb, pIter, SDB_VIEW);
×
103
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc