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

taosdata / TDengine / #4905

29 Dec 2025 02:08PM UTC coverage: 65.423% (-0.3%) from 65.734%
#4905

push

travis-ci

web-flow
enh: sign connect request (#34067)

23 of 29 new or added lines in 4 files covered. (79.31%)

11614 existing lines in 186 files now uncovered.

193476 of 295730 relevant lines covered (65.42%)

115752566.53 hits per line

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

63.64
/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) {
383,863✔
20
  mndSetMsgHandle(pMnode, TDMT_MND_CREATE_VIEW, mndProcessCreateViewReq);
383,863✔
21
  mndSetMsgHandle(pMnode, TDMT_MND_DROP_VIEW, mndProcessDropViewReq);
383,863✔
22
  mndSetMsgHandle(pMnode, TDMT_MND_VIEW_META, mndProcessGetViewMetaReq);
383,863✔
23

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

27
#ifdef TD_ENTERPRISE
28
  initDynViewVersion();
383,863✔
29

30
  SSdbTable table = {
383,863✔
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);
383,863✔
41
#else
42
  return TSDB_CODE_SUCCESS;
43
#endif
44
}
45

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

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

57
  mInfo("start to create view:%s, sql:%s", createViewReq.fullname, createViewReq.sql);
14,889✔
58

59
  return mndProcessCreateViewReqImpl(&createViewReq, pReq);
14,889✔
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) {
14,969,195✔
79
#ifndef TD_ENTERPRISE
80
  return TSDB_CODE_OPS_NOT_SUPPORT;
81
#else
82
  SViewMetaReq req = {0};
14,969,195✔
83

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

88
  return mndProcessViewMetaReqImpl(&req, pReq);
14,969,195✔
89
#endif
90
}
91

92
int32_t mndRetrieveView(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) {
2,347✔
93
#ifndef TD_ENTERPRISE
94
  return 0;
95
#else
96
  return mndRetrieveViewImpl(pReq, pShow, pBlock, rows);
2,347✔
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