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

taosdata / TDengine / #3621

22 Feb 2025 11:44AM UTC coverage: 2.037% (-61.5%) from 63.573%
#3621

push

travis-ci

web-flow
Merge pull request #29874 from taosdata/merge/mainto3.0

merge: from main to 3.0 branch

4357 of 287032 branches covered (1.52%)

Branch coverage included in aggregate %.

0 of 174 new or added lines in 18 files covered. (0.0%)

213359 existing lines in 469 files now uncovered.

7260 of 283369 relevant lines covered (2.56%)

23737.72 hits per line

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

0.0
/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

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

UNCOV
24
  mndAddShowRetrieveHandle(pMnode, TSDB_MGMT_TABLE_VIEWS, mndRetrieveView);
×
UNCOV
25
  mndAddShowFreeIterHandle(pMnode, TSDB_MGMT_TABLE_VIEWS, mndCancelGetNextView);
×
26

27
#ifdef TD_ENTERPRISE
UNCOV
28
  initDynViewVersion();
×
29

UNCOV
30
  SSdbTable table = {
×
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

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

UNCOV
46
void mndCleanupView(SMnode *pMnode) { mDebug("mnd view cleanup"); }
×
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

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

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

UNCOV
88
  return mndProcessViewMetaReqImpl(&req, pReq);
×
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