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

taosdata / TDengine / #4688

26 Aug 2025 02:05PM UTC coverage: 56.997% (-0.9%) from 57.894%
#4688

push

travis-ci

web-flow
fix: modify the prompt language of the taos-shell (#32758)

* fix: modify prompt language

* fix: add shell test case

* fix: modify comments

* fix: modify test case for TDengine TSDB

130660 of 292423 branches covered (44.68%)

Branch coverage included in aggregate %.

16 of 17 new or added lines in 2 files covered. (94.12%)

9459 existing lines in 157 files now uncovered.

198294 of 284715 relevant lines covered (69.65%)

4532552.29 hits per line

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

42.37
/source/dnode/bnode/src/bnode.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 "libs/tmqtt/tmqtt.h"
17
#include "bndInt.h"
18

19
int32_t bndOpen(const SBnodeOpt *pOption, SBnode **pBnode) {
89✔
20
  int32_t code = 0;
89✔
21

22
  *pBnode = taosMemoryCalloc(1, sizeof(SBnode));
89!
23
  if (NULL == *pBnode) {
89!
24
    bndError("calloc SBnode failed");
×
25
    code = terrno;
×
26
    TAOS_RETURN(code);
×
27
  }
28

29
  (*pBnode)->msgCb = pOption->msgCb;
89✔
30
  (*pBnode)->dnodeId = pOption->dnodeId;
89✔
31
  (*pBnode)->protocol = (int8_t)pOption->proto;
89✔
32

33
  if (TSDB_BNODE_OPT_PROTO_MQTT == (*pBnode)->protocol) {
89!
34
    if ((code = mqttMgmtStartMqttd((*pBnode)->dnodeId)) != 0) {
89!
35
      bndError("failed to start taosudf since %s", tstrerror(code));
×
UNCOV
36
      taosMemoryFree(*pBnode);
×
37
      *pBnode = NULL;
×
38
      TAOS_RETURN(code);
×
39
    }
40
  } else {
41
    bndError("Unknown bnode proto: %hhd.", (*pBnode)->protocol);
×
UNCOV
42
    taosMemoryFree(*pBnode);
×
43
    *pBnode = NULL;
×
44
    TAOS_RETURN(code);
×
45
  }
46

47
  bndInfo("Bnode opened.");
89!
48

49
  return TSDB_CODE_SUCCESS;
89✔
50
}
51

52
void bndClose(SBnode *pBnode) {
89✔
53
  mqttMgmtStopMqttd();
89✔
54

55
  taosMemoryFree(pBnode);
89!
56

57
  bndInfo("Bnode closed.");
89!
58
}
89✔
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