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

taosdata / TDengine / #3720

26 Mar 2025 06:20AM UTC coverage: 30.242% (-31.7%) from 61.936%
#3720

push

travis-ci

web-flow
feat(taosBenchmark): supports decimal data type (#30456)

* feat: taosBenchmark supports decimal data type

* build: decimal script not use pytest.sh

* fix: fix typo for decimal script

* test: insertBasic.py debug

71234 of 313946 branches covered (22.69%)

Branch coverage included in aggregate %.

38 of 423 new or added lines in 8 files covered. (8.98%)

120240 existing lines in 447 files now uncovered.

118188 of 312400 relevant lines covered (37.83%)

1450220.33 hits per line

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

51.49
/tools/shell/src/shellMain.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
#define __USE_XOPEN
17
#include "shellAuto.h"
18
#include "shellInt.h"
19

20
extern SShellObj shell;
21

22
void shellCrashHandler(int signum, void *sigInfo, void *context) {
×
23
  taosIgnSignal(SIGTERM);
×
24
  taosIgnSignal(SIGHUP);
×
25
  taosIgnSignal(SIGINT);
×
26
  taosIgnSignal(SIGBREAK);
×
27
  taosIgnSignal(SIGABRT);
×
28
  taosIgnSignal(SIGFPE);
×
29
  taosIgnSignal(SIGSEGV);
×
30
#if !defined(WINDOWS)
31
  taosIgnSignal(SIGBUS);
×
32
#endif
33
#ifdef USE_REPORT
34
  taos_write_crashinfo(signum, sigInfo, context);
×
35
#endif
36
#ifdef _TD_DARWIN_64
37
  exit(signum);
38
#elif defined(WINDOWS)
39
  exit(signum);
40
#endif
41
}
×
42

43
// init arguments
44
void initArgument(SShellArgs *pArgs) {
25✔
45
  pArgs->host     = NULL;
25✔
46
  pArgs->port     = 0;
25✔
47
  pArgs->user     = NULL;
25✔
48
  pArgs->database = NULL;
25✔
49

50
  // conn mode
51
  pArgs->dsn      = NULL;
25✔
52
  pArgs->connMode = CONN_MODE_INVALID;
25✔
53

54
  pArgs->port_inputted = false;
25✔
55
}
25✔
56

57
int main(int argc, char *argv[]) {
25✔
58
  int code  = 0;
25✔
59
#if !defined(WINDOWS)
60
  taosSetSignal(SIGBUS, shellCrashHandler);
25✔
61
#endif
62
  taosSetSignal(SIGABRT, shellCrashHandler);
25✔
63
  taosSetSignal(SIGFPE, shellCrashHandler);
25✔
64
  taosSetSignal(SIGSEGV, shellCrashHandler);
25✔
65

66
  initArgument(&shell.args);
25✔
67

68
  if (shellCheckIntSize() != 0) {
25!
UNCOV
69
    return -1;
×
70
  }
71

72
  if (shellParseArgs(argc, argv) != 0) {
25!
UNCOV
73
    return -1;
×
74
  }
75

76
  if (shell.args.is_version) {
24!
77
    shellPrintVersion();
×
UNCOV
78
    return 0;
×
79
  }
80

81
  if (shell.args.is_gen_auth) {
24!
UNCOV
82
    shellGenerateAuth();
×
UNCOV
83
    return 0;
×
84
  }
85

86
  if (shell.args.is_help) {
24!
87
    shellPrintHelp();
×
UNCOV
88
    return 0;
×
89
  }
90

91
  if (shell.args.netrole != NULL) {
24!
UNCOV
92
    shellTestNetWork();
×
UNCOV
93
    return 0;
×
94
  }
95

96
  if (getDsnEnv() != 0) {
24!
UNCOV
97
    return -1;
×
98
  }
99

100
  // first taos_option(TSDB_OPTION_DRIVER ...) no load driver
101
  if (setConnMode(shell.args.connMode, shell.args.dsn, false)) {
24!
UNCOV
102
    return -1;
×
103
  }
104

105
  // second taos_option(TSDB_OPTION_CONFIGDIR ...) set configDir global
106
  if (configDirShell[0] != 0) {
24✔
107
    code = taos_options(TSDB_OPTION_CONFIGDIR, configDirShell);
4✔
108
    if (code) {
4!
UNCOV
109
      fprintf(stderr, "failed to set config dir:%s  code:[0x%08X]\r\n", configDirShell, code);
×
UNCOV
110
      return -1;
×
111
    }
112
    //printf("Load with input config dir:%s\n", configDirShell);
113
  }  
114

115
#ifndef TD_ASTRA
116
  // dump config
117
  if (shell.args.is_dump_config) {
24!
118
    shellDumpConfig();
×
119
    return 0;
×
120
  }
121
#endif
122

123
  // taos_init
124
  if (taos_init() != 0) {
24!
UNCOV
125
    fprintf(stderr, "failed to init shell since %s [0x%08X]\r\n", taos_errstr(NULL), taos_errno(NULL));
×
UNCOV
126
    return -1;
×
127
  }
128

129
  // kill heart-beat thread when quit
130
  taos_set_hb_quit(1);
24✔
131

132
#ifndef TD_ASTRA
133
  if (shell.args.is_startup || shell.args.is_check) {
24!
UNCOV
134
    shellCheckServerStatus();
×
UNCOV
135
    taos_cleanup();
×
UNCOV
136
    return 0;
×
137
  }
138

139
  if (shell.args.netrole != NULL) {
24!
UNCOV
140
    shellTestNetWork();
×
UNCOV
141
    taos_cleanup();
×
UNCOV
142
    return 0;
×
143
  }
144
#endif
145
  // support port feature
146
  shellAutoInit();
24✔
147
  int32_t ret = shellExecute(argc, argv);
24✔
148
  shellAutoExit();
24✔
149

150
  return ret;
24✔
151
}
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