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

taosdata / TDengine / #4863

26 Nov 2025 05:46AM UTC coverage: 64.539% (+0.2%) from 64.294%
#4863

push

travis-ci

guanshengliang
Merge branch '3.0' into cover/3.0

767 of 945 new or added lines in 33 files covered. (81.16%)

701 existing lines in 109 files now uncovered.

158204 of 245129 relevant lines covered (64.54%)

111903199.95 hits per line

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

69.83
/source/client/wrapper/src/wrapperFunc.c
1
/*
2
 * Copyright (c) 2025 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 "version.h"
17
#include "wrapper.h"
18

19
static TdThreadOnce tsDriverOnce = PTHREAD_ONCE_INIT;
20
volatile int32_t    tsDriverOnceRet = 0;
21

22
static TdThreadOnce tsInitOnce = PTHREAD_ONCE_INIT;
23
volatile int32_t    tsInitOnceRet = 0;
24

25
#define ERR_VOID(code) \
26
  terrno = code;       \
27
  return;
28

29
#define ERR_PTR(code) \
30
  terrno = code;      \
31
  return NULL;
32

33
#define ERR_INT(code) \
34
  terrno = code;      \
35
  return -1;
36

37
#define ERR_BOOL(code) \
38
  terrno = code;       \
39
  return false;
40

41
#define ERR_CONFRET(code)           \
42
  terrno = code;                    \
43
  setConfRet ret = {.retCode = -1}; \
44
  return ret;
45

46
#define CHECK_VOID(fp)               \
47
  if (tsDriver == NULL) {            \
48
    ERR_VOID(TSDB_CODE_DLL_NOT_LOAD) \
49
  }                                  \
50
  if (fp == NULL) {                  \
51
    ERR_VOID(TSDB_CODE_DLL_FUNC_NOT_LOAD) \
52
  }
53

54
#define CHECK_PTR(fp)               \
55
  if (tsDriver == NULL) {           \
56
    ERR_PTR(TSDB_CODE_DLL_NOT_LOAD) \
57
  }                                 \
58
  if (fp == NULL) {                 \
59
    ERR_PTR(TSDB_CODE_DLL_FUNC_NOT_LOAD) \
60
  }
61

62
#define CHECK_INT(fp)               \
63
  if (tsDriver == NULL) {           \
64
    ERR_INT(TSDB_CODE_DLL_NOT_LOAD) \
65
  }                                 \
66
  if (fp == NULL) {                 \
67
    ERR_INT(TSDB_CODE_DLL_FUNC_NOT_LOAD) \
68
  }
69

70
#define CHECK_BOOL(fp)               \
71
  if (tsDriver == NULL) {            \
72
    ERR_BOOL(TSDB_CODE_DLL_NOT_LOAD) \
73
  }                                  \
74
  if (fp == NULL) {                  \
75
    ERR_BOOL(TSDB_CODE_DLL_FUNC_NOT_LOAD) \
76
  }
77

78
#define CHECK_CONFRET(fp)               \
79
  if (tsDriver == NULL) {               \
80
    ERR_CONFRET(TSDB_CODE_DLL_NOT_LOAD) \
81
  }                                     \
82
  if (fp == NULL) {                     \
83
    ERR_CONFRET(TSDB_CODE_DLL_FUNC_NOT_LOAD) \
84
  }
85

86
setConfRet taos_set_config(const char *config) {
642✔
87
  if (taos_init() != 0) {
642✔
88
    ERR_CONFRET(TSDB_CODE_DLL_NOT_LOAD)
×
89
  }
90

91
  CHECK_CONFRET(fp_taos_set_config);
642✔
92
  return (*fp_taos_set_config)(config);
642✔
93
}
94

95
static void taos_init_driver(void) {
1,299,935✔
96
  tsDriverOnceRet = taosDriverInit(tsDriverType);
1,299,935✔
97
  if (tsDriverOnceRet != 0) return;
1,299,935✔
98

99
  tsDriverOnceRet = 0;
1,299,935✔
100
}
101
static void taos_init_wrapper(void) {
1,296,775✔
102
  if (fp_taos_init == NULL) {
1,296,775✔
103
    terrno = TSDB_CODE_DLL_FUNC_NOT_LOAD;
×
104
    tsInitOnceRet = -1;
×
105
  } else {
106
    tsInitOnceRet = (*fp_taos_init)();
1,296,775✔
107
  }
108
}
1,296,775✔
109

110
int taos_init(void) {
859,423,686✔
111
  (void)taosThreadOnce(&tsDriverOnce, taos_init_driver);
859,423,686✔
112
  (void)taosThreadOnce(&tsInitOnce, taos_init_wrapper);
859,420,418✔
113
  return tsInitOnceRet;
859,418,670✔
114
}
115

116
void taos_cleanup(void) {
925,019✔
117
  CHECK_VOID(fp_taos_cleanup);
925,019✔
118
  (*fp_taos_cleanup)();
925,019✔
119
}
120

121
int taos_options(TSDB_OPTION option, const void *arg, ...) {
1,588,751✔
122
  if (option == TSDB_OPTION_DRIVER) {
1,588,751✔
123
    if (tsDriver == NULL) {
951,940✔
124
      if (strcasecmp((const char *)arg, "native") == 0) {
951,940✔
125
        tsDriverType = DRIVER_NATIVE;
927,993✔
126
        return 0;
927,993✔
127
      }
128
      if (strcasecmp((const char *)arg, "websocket") == 0) {
23,947✔
129
        tsDriverType = DRIVER_WEBSOCKET;
23,947✔
130
        return 0;
23,947✔
131
      }
132
    }
133
    terrno = TSDB_CODE_REPEAT_INIT;
×
134
    return -1;
×
135
  }
136
  (void)taosThreadOnce(&tsDriverOnce, taos_init_driver);
636,811✔
137

138
  CHECK_INT(fp_taos_options);
636,811✔
139
  return (*fp_taos_options)(option, arg);
636,811✔
140
}
141

142
int taos_options_connection(TAOS *taos, TSDB_OPTION_CONNECTION option, const void *arg, ...) {
×
143
  CHECK_INT(fp_taos_options_connection);
×
144
  return (*fp_taos_options_connection)(taos, option, (const char *)arg);
×
145
}
146

147
TAOS *taos_connect(const char *ip, const char *user, const char *pass, const char *db, uint16_t port) {
3,183,496✔
148
  if (taos_init() != 0) {
3,183,496✔
149
    //terrno = TSDB_CODE_DLL_NOT_LOAD;
150
    return NULL;
×
151
  }
152

153
  CHECK_PTR(fp_taos_connect);
3,183,781✔
154
  return (*fp_taos_connect)(ip, user, pass, db, port);
3,183,781✔
155
}
156

157
TAOS *taos_connect_auth(const char *ip, const char *user, const char *auth, const char *db, uint16_t port) {
821✔
158
  if (taos_init() != 0) {
821✔
159
    terrno = TSDB_CODE_DLL_NOT_LOAD;
×
160
    return NULL;
×
161
  }
162

163
  CHECK_PTR(fp_taos_connect_auth);
821✔
164
  return (*fp_taos_connect_auth)(ip, user, auth, db, port);
821✔
165
}
166

167
void taos_close(TAOS *taos) {
3,169,725✔
168
  CHECK_VOID(fp_taos_close);
3,169,725✔
169
  (*fp_taos_close)(taos);
3,169,725✔
170
}
171

172
const char *taos_data_type(int type) {
×
173
  (void)taos_init();
×
174
  CHECK_PTR(fp_taos_data_type);
×
175
  return (*fp_taos_data_type)(type);
×
176
}
177

178
TAOS_STMT *taos_stmt_init(TAOS *taos) {
401,007✔
179
  CHECK_PTR(fp_taos_stmt_init);
401,007✔
180
  return (*fp_taos_stmt_init)(taos);
401,007✔
181
}
182

183
TAOS_STMT *taos_stmt_init_with_reqid(TAOS *taos, int64_t reqid) {
12,575✔
184
  CHECK_PTR(fp_taos_stmt_init_with_reqid);
12,575✔
185
  return (*fp_taos_stmt_init_with_reqid)(taos, reqid);
12,575✔
186
}
187

188
TAOS_STMT *taos_stmt_init_with_options(TAOS *taos, TAOS_STMT_OPTIONS *options) {
33,074✔
189
  CHECK_PTR(fp_taos_stmt_init_with_options);
33,074✔
190
  return (*fp_taos_stmt_init_with_options)(taos, options);
33,074✔
191
}
192

193
int taos_stmt_prepare(TAOS_STMT *stmt, const char *sql, unsigned long length) {
965,526✔
194
  CHECK_INT(fp_taos_stmt_prepare);
965,526✔
195
  return (*fp_taos_stmt_prepare)(stmt, sql, length);
965,526✔
196
}
197

198
int taos_stmt_set_tbname_tags(TAOS_STMT *stmt, const char *name, TAOS_MULTI_BIND *tags) {
20,176✔
199
  CHECK_INT(fp_taos_stmt_set_tbname_tags);
20,176✔
200
  return (*fp_taos_stmt_set_tbname_tags)(stmt, name, tags);
20,176✔
201
}
202

203
int taos_stmt_set_tbname(TAOS_STMT *stmt, const char *name) {
16,552,475✔
204
  CHECK_INT(fp_taos_stmt_set_tbname);
16,552,475✔
205
  return (*fp_taos_stmt_set_tbname)(stmt, name);
16,552,475✔
206
}
207

208
int taos_stmt_set_tags(TAOS_STMT *stmt, TAOS_MULTI_BIND *tags) {
9,847✔
209
  CHECK_INT(fp_taos_stmt_set_tags);
9,847✔
210
  return (*fp_taos_stmt_set_tags)(stmt, tags);
9,847✔
211
}
212

213
int taos_stmt_set_sub_tbname(TAOS_STMT *stmt, const char *name) {
×
214
  CHECK_INT(fp_taos_stmt_set_sub_tbname);
×
215
  return (*fp_taos_stmt_set_sub_tbname)(stmt, name);
×
216
}
217

218
int taos_stmt_get_tag_fields(TAOS_STMT *stmt, int *fieldNum, TAOS_FIELD_E **fields) {
×
219
  CHECK_INT(fp_taos_stmt_get_tag_fields);
×
220
  return (*fp_taos_stmt_get_tag_fields)(stmt, fieldNum, fields);
×
221
}
222

223
int taos_stmt_get_col_fields(TAOS_STMT *stmt, int *fieldNum, TAOS_FIELD_E **fields) {
×
224
  CHECK_INT(fp_taos_stmt_get_col_fields);
×
225
  return (*fp_taos_stmt_get_col_fields)(stmt, fieldNum, fields);
×
226
}
227

228
void taos_stmt_reclaim_fields(TAOS_STMT *stmt, TAOS_FIELD_E *fields) {
×
229
  CHECK_VOID(fp_taos_stmt_reclaim_fields);
×
230
  (*fp_taos_stmt_reclaim_fields)(stmt, fields);
×
231
}
232

233
int taos_stmt_is_insert(TAOS_STMT *stmt, int *insert) {
×
234
  CHECK_INT(fp_taos_stmt_is_insert);
×
235
  return (*fp_taos_stmt_is_insert)(stmt, insert);
×
236
}
237

238
int taos_stmt_num_params(TAOS_STMT *stmt, int *nums) {
×
239
  CHECK_INT(fp_taos_stmt_num_params);
×
240
  return (*fp_taos_stmt_num_params)(stmt, nums);
×
241
}
242

243
int taos_stmt_get_param(TAOS_STMT *stmt, int idx, int *type, int *bytes) {
×
244
  CHECK_INT(fp_taos_stmt_get_param);
×
245
  return (*fp_taos_stmt_get_param)(stmt, idx, type, bytes);
×
246
}
247

248
int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind) {
53,135✔
249
  CHECK_INT(fp_taos_stmt_bind_param);
53,135✔
250
  return (*fp_taos_stmt_bind_param)(stmt, bind);
53,135✔
251
}
252

253
int taos_stmt_bind_param_batch(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind) {
347,808,897✔
254
  CHECK_INT(fp_taos_stmt_bind_param_batch);
347,808,897✔
255
  return (*fp_taos_stmt_bind_param_batch)(stmt, bind);
347,808,897✔
256
}
257

258
int taos_stmt_bind_single_param_batch(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind, int colIdx) {
55,020✔
259
  CHECK_INT(fp_taos_stmt_bind_single_param_batch);
55,020✔
260
  return (*fp_taos_stmt_bind_single_param_batch)(stmt, bind, colIdx);
55,020✔
261
}
262

263
int taos_stmt_add_batch(TAOS_STMT *stmt) {
336,737,963✔
264
  CHECK_INT(fp_taos_stmt_add_batch);
336,737,963✔
265
  return (*fp_taos_stmt_add_batch)(stmt);
336,737,963✔
266
}
267

268
int taos_stmt_execute(TAOS_STMT *stmt) {
6,973,650✔
269
  CHECK_INT(fp_taos_stmt_execute);
6,973,650✔
270
  return (*fp_taos_stmt_execute)(stmt);
6,973,650✔
271
}
272

273
TAOS_RES *taos_stmt_use_result(TAOS_STMT *stmt) {
10,080✔
274
  CHECK_PTR(fp_taos_stmt_use_result);
10,080✔
275
  return (*fp_taos_stmt_use_result)(stmt);
10,080✔
276
}
277

278
int taos_stmt_close(TAOS_STMT *stmt) {
434,522✔
279
  CHECK_INT(fp_taos_stmt_close);
434,522✔
280
  return (*fp_taos_stmt_close)(stmt);
434,522✔
281
}
282

283
char *taos_stmt_errstr(TAOS_STMT *stmt) {
10,453✔
284
  CHECK_PTR(fp_taos_stmt_errstr);
10,453✔
285
  return (*fp_taos_stmt_errstr)(stmt);
10,453✔
286
}
287

288
int taos_stmt_affected_rows(TAOS_STMT *stmt) {
7,150✔
289
  CHECK_INT(fp_taos_stmt_affected_rows);
7,150✔
290
  return (*fp_taos_stmt_affected_rows)(stmt);
7,150✔
291
}
292

293
int taos_stmt_affected_rows_once(TAOS_STMT *stmt) {
2,530✔
294
  CHECK_INT(fp_taos_stmt_affected_rows_once);
2,530✔
295
  return (*fp_taos_stmt_affected_rows_once)(stmt);
2,530✔
296
}
297

298
TAOS_STMT2 *taos_stmt2_init(TAOS *taos, TAOS_STMT2_OPTION *option) {
24,859✔
299
  CHECK_PTR(fp_taos_stmt2_init);
24,859✔
300
  return (*fp_taos_stmt2_init)(taos, option);
24,859✔
301
}
302

303
int taos_stmt2_prepare(TAOS_STMT2 *stmt, const char *sql, unsigned long length) {
26,851✔
304
  CHECK_INT(fp_taos_stmt2_prepare);
26,851✔
305
  return (*fp_taos_stmt2_prepare)(stmt, sql, length);
26,851✔
306
}
307

308
int taos_stmt2_bind_param(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t col_idx) {
9,675,593✔
309
  CHECK_INT(fp_taos_stmt2_bind_param);
9,675,593✔
310
  return (*fp_taos_stmt2_bind_param)(stmt, bindv, col_idx);
9,675,593✔
311
}
312

313
int taos_stmt2_bind_param_a(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t col_idx, __taos_async_fn_t fp,
×
314
                            void *param) {
315
  CHECK_INT(fp_taos_stmt2_bind_param_a);
×
316
  return (*fp_taos_stmt2_bind_param_a)(stmt, bindv, col_idx, fp, param);
×
317
}
318

319
int taos_stmt2_exec(TAOS_STMT2 *stmt, int *affected_rows) {
9,677,277✔
320
  CHECK_INT(fp_taos_stmt2_exec);
9,677,277✔
321
  return (*fp_taos_stmt2_exec)(stmt, affected_rows);
9,677,277✔
322
}
323

324
int taos_stmt2_close(TAOS_STMT2 *stmt) {
24,859✔
325
  CHECK_INT(fp_taos_stmt2_close);
24,859✔
326
  return (*fp_taos_stmt2_close)(stmt);
24,859✔
327
}
328

UNCOV
329
int taos_stmt2_is_insert(TAOS_STMT2 *stmt, int *insert) {
×
UNCOV
330
  CHECK_INT(fp_taos_stmt2_is_insert);
×
UNCOV
331
  return (*fp_taos_stmt2_is_insert)(stmt, insert);
×
332
}
333

UNCOV
334
int taos_stmt2_get_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_ALL **fields) {
×
UNCOV
335
  CHECK_INT(fp_taos_stmt2_get_fields);
×
UNCOV
336
  return (*fp_taos_stmt2_get_fields)(stmt, count, fields);
×
337
}
338

UNCOV
339
void taos_stmt2_free_fields(TAOS_STMT2 *stmt, TAOS_FIELD_ALL *fields) {
×
UNCOV
340
  CHECK_VOID(fp_taos_stmt2_free_fields);
×
UNCOV
341
  (*fp_taos_stmt2_free_fields)(stmt, fields);
×
342
}
343

UNCOV
344
TAOS_RES *taos_stmt2_result(TAOS_STMT2 *stmt) {
×
UNCOV
345
  CHECK_PTR(fp_taos_stmt2_result);
×
UNCOV
346
  return (*fp_taos_stmt2_result)(stmt);
×
347
}
348

349
char *taos_stmt2_error(TAOS_STMT2 *stmt) {
×
350
  CHECK_PTR(fp_taos_stmt2_error);
×
351
  return (*fp_taos_stmt2_error)(stmt);
×
352
}
353

354
TAOS_RES *taos_query(TAOS *taos, const char *sql) {
648,537,511✔
355
  CHECK_PTR(fp_taos_query);
648,537,511✔
356
  return (*fp_taos_query)(taos, sql);
648,537,511✔
357
}
358

359
TAOS_RES *taos_query_with_reqid(TAOS *taos, const char *sql, int64_t reqId) {
2,602,477✔
360
  CHECK_PTR(fp_taos_query_with_reqid);
2,602,477✔
361
  return (*fp_taos_query_with_reqid)(taos, sql, reqId);
2,602,477✔
362
}
363

364
TAOS_ROW taos_fetch_row(TAOS_RES *res) {
1,327,160,783✔
365
  CHECK_PTR(fp_taos_fetch_row);
1,327,160,783✔
366
  return (*fp_taos_fetch_row)(res);
1,327,160,783✔
367
}
368

369
int taos_result_precision(TAOS_RES *res) {
103,354,667✔
370
  CHECK_INT(fp_taos_result_precision);
103,354,667✔
371
  return (*fp_taos_result_precision)(res);
103,354,667✔
372
}
373

374
void taos_free_result(TAOS_RES *res) {
652,465,041✔
375
  CHECK_VOID(fp_taos_free_result);
652,465,041✔
376
  return (*fp_taos_free_result)(res);
652,465,041✔
377
}
378

379
void taos_kill_query(TAOS *taos) {
1,462✔
380
  CHECK_VOID(fp_taos_kill_query);
1,462✔
381
  return (*fp_taos_kill_query)(taos);
1,462✔
382
}
383

384
int taos_field_count(TAOS_RES *res) {
2,147,483,647✔
385
  CHECK_INT(fp_taos_field_count);
2,147,483,647✔
386
  return (*fp_taos_field_count)(res);
2,147,483,647✔
387
}
388

389
int taos_num_fields(TAOS_RES *res) {
1,369,293,877✔
390
  CHECK_INT(fp_taos_num_fields);
1,369,293,877✔
391
  return (*fp_taos_num_fields)(res);
1,369,293,877✔
392
}
393

394
int taos_affected_rows(TAOS_RES *res) {
504,754,538✔
395
  CHECK_INT(fp_taos_affected_rows);
504,754,538✔
396
  return (*fp_taos_affected_rows)(res);
504,754,538✔
397
}
398

399
int64_t taos_affected_rows64(TAOS_RES *res) {
1,299,741✔
400
  CHECK_INT(fp_taos_affected_rows64);
1,299,741✔
401
  return (*fp_taos_affected_rows64)(res);
1,299,741✔
402
}
403

404
TAOS_FIELD *taos_fetch_fields(TAOS_RES *res) {
184,954,979✔
405
  CHECK_PTR(fp_taos_fetch_fields);
184,954,979✔
406
  return (*fp_taos_fetch_fields)(res);
184,954,979✔
407
}
408

409
TAOS_FIELD_E *taos_fetch_fields_e(TAOS_RES *res) {
1,093✔
410
  CHECK_PTR(fp_taos_fetch_fields_e);
1,093✔
411
  return (*fp_taos_fetch_fields_e)(res);
1,093✔
412
}
413

414
int taos_select_db(TAOS *taos, const char *db) {
166,043✔
415
  CHECK_INT(fp_taos_select_db);
166,043✔
416
  return (*fp_taos_select_db)(taos, db);
166,043✔
417
}
418

419
int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields) {
80,998,103✔
420
  CHECK_INT(fp_taos_print_row);
80,998,103✔
421
  return (*fp_taos_print_row)(str, row, fields, num_fields);
80,998,103✔
422
}
423

424
int taos_print_row_with_size(char *str, uint32_t size, TAOS_ROW row, TAOS_FIELD *fields, int num_fields) {
81,044,723✔
425
  CHECK_INT(fp_taos_print_row_with_size);
81,044,723✔
426
  return (*fp_taos_print_row_with_size)(str, size, row, fields, num_fields);
81,044,723✔
427
}
428

429
void taos_stop_query(TAOS_RES *res) {
59,305,433✔
430
  CHECK_VOID(fp_taos_stop_query);
59,305,433✔
431
  (*fp_taos_stop_query)(res);
59,305,433✔
432
}
433

434
bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col) {
×
435
  CHECK_BOOL(fp_taos_is_null);
×
436
  return (*fp_taos_is_null)(res, row, col);
×
437
}
438

439
int taos_is_null_by_column(TAOS_RES *res, int columnIndex, bool result[], int *rows) {
332,240,340✔
440
  CHECK_INT(fp_taos_is_null_by_column);
332,240,340✔
441
  return (*fp_taos_is_null_by_column)(res, columnIndex, result, rows);
332,240,340✔
442
}
443

444
bool taos_is_update_query(TAOS_RES *res) {
9,121,257✔
445
  CHECK_BOOL(fp_taos_is_update_query);
9,121,257✔
446
  return (*fp_taos_is_update_query)(res);
9,121,257✔
447
}
448

449
int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
176,956,304✔
450
  CHECK_INT(fp_taos_fetch_block);
176,956,304✔
451
  return (*fp_taos_fetch_block)(res, rows);
176,956,304✔
452
}
453

454
int taos_fetch_block_s(TAOS_RES *res, int *numOfRows, TAOS_ROW *rows) {
×
455
  CHECK_INT(fp_taos_fetch_block_s);
×
456
  return (*fp_taos_fetch_block_s)(res, numOfRows, rows);
×
457
}
458

459
int taos_fetch_raw_block(TAOS_RES *res, int *numOfRows, void **pData) {
2,665,607✔
460
  CHECK_INT(fp_taos_fetch_raw_block);
2,665,607✔
461
  return (*fp_taos_fetch_raw_block)(res, numOfRows, pData);
2,665,607✔
462
}
463

464
int *taos_get_column_data_offset(TAOS_RES *res, int columnIndex) {
117,972,251✔
465
  CHECK_PTR(fp_taos_get_column_data_offset);
117,972,251✔
466
  return (*fp_taos_get_column_data_offset)(res, columnIndex);
117,972,251✔
467
}
468

469
int taos_validate_sql(TAOS *taos, const char *sql) {
×
470
  CHECK_INT(fp_taos_validate_sql);
×
471
  return (*fp_taos_validate_sql)(taos, sql);
×
472
}
473

474
void taos_reset_current_db(TAOS *taos) {
×
475
  CHECK_VOID(fp_taos_reset_current_db);
×
476
  (*fp_taos_reset_current_db)(taos);
×
477
}
478

479
int *taos_fetch_lengths(TAOS_RES *res) {
1,239,084,228✔
480
  CHECK_PTR(fp_taos_fetch_lengths);
1,239,084,228✔
481
  return (*fp_taos_fetch_lengths)(res);
1,239,084,228✔
482
}
483

484
TAOS_ROW *taos_result_block(TAOS_RES *res) {
×
485
  CHECK_PTR(fp_taos_result_block);
×
486
  return (*fp_taos_result_block)(res);
×
487
}
488

489
const char *taos_get_server_info(TAOS *taos) {
48,387✔
490
  CHECK_PTR(fp_taos_get_server_info);
48,387✔
491
  return (*fp_taos_get_server_info)(taos);
48,387✔
492
}
493

494
const char *taos_get_client_info() {
1,501,526✔
495
  if (fp_taos_get_client_info == NULL) {
1,501,526✔
496
    return td_version;
691,051✔
497
  } else {
498
    return (*fp_taos_get_client_info)();
810,475✔
499
  }
500
}
501

502
int taos_get_current_db(TAOS *taos, char *database, int len, int *required) {
×
503
  CHECK_INT(fp_taos_get_current_db);
×
504
  return (*fp_taos_get_current_db)(taos, database, len, required);
×
505
}
506

507
const char *taos_errstr(TAOS_RES *res) {
21,745,610✔
508
  (void)taos_init();
21,745,610✔
509
  if (fp_taos_errstr == NULL) {
21,745,610✔
510
    return tstrerror(terrno);
×
511
  }
512
  return (*fp_taos_errstr)(res);
21,745,610✔
513
}
514

515
int taos_errno(TAOS_RES *res) {
830,312,788✔
516
  (void)taos_init();
830,312,788✔
517
  if (fp_taos_errno == NULL) {
830,306,982✔
518
    return terrno;
×
519
  }
520
  return (*fp_taos_errno)(res);
830,306,982✔
521
}
522

523
void taos_query_a(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param) {
64,178✔
524
  CHECK_VOID(fp_taos_query_a);
64,178✔
525
  (*fp_taos_query_a)(taos, sql, fp, param);
64,178✔
526
}
527

528
void taos_query_a_with_reqid(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param, int64_t reqid) {
×
529
  CHECK_VOID(fp_taos_query_a_with_reqid);
×
530
  (*fp_taos_query_a_with_reqid)(taos, sql, fp, param, reqid);
×
531
}
532

533
void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
14,422,220✔
534
  CHECK_VOID(fp_taos_fetch_rows_a);
14,422,220✔
535
  (*fp_taos_fetch_rows_a)(res, fp, param);
14,422,220✔
536
}
537

538
void taos_fetch_raw_block_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
7,721✔
539
  CHECK_VOID(fp_taos_fetch_raw_block_a);
7,721✔
540
  (*fp_taos_fetch_raw_block_a)(res, fp, param);
7,721✔
541
}
542

543
const void *taos_get_raw_block(TAOS_RES *res) {
4,540✔
544
  CHECK_PTR(fp_taos_get_raw_block);
4,540✔
545
  return (*fp_taos_get_raw_block)(res);
4,540✔
546
}
547

548
int taos_get_db_route_info(TAOS *taos, const char *db, TAOS_DB_ROUTE_INFO *dbInfo) {
×
549
  CHECK_INT(fp_taos_get_db_route_info);
×
550
  return (*fp_taos_get_db_route_info)(taos, db, dbInfo);
×
551
}
552

553
int taos_get_table_vgId(TAOS *taos, const char *db, const char *table, int *vgId) {
×
554
  CHECK_INT(fp_taos_get_table_vgId);
×
555
  return (*fp_taos_get_table_vgId)(taos, db, table, vgId);
×
556
}
557

558
int taos_get_tables_vgId(TAOS *taos, const char *db, const char *table[], int tableNum, int *vgId) {
×
559
  CHECK_INT(fp_taos_get_tables_vgId);
×
560
  return (*fp_taos_get_tables_vgId)(taos, db, table, tableNum, vgId);
×
561
}
562

563
int taos_load_table_info(TAOS *taos, const char *tableNameList) {
1,260✔
564
  CHECK_INT(fp_taos_load_table_info);
1,260✔
565
  return (*fp_taos_load_table_info)(taos, tableNameList);
1,260✔
566
}
567

568
void taos_set_hb_quit(int8_t quitByKill) {
808,667✔
569
  if (taos_init() != 0) {
808,667✔
570
    return;
×
571
  }
572

573
  CHECK_VOID(fp_taos_set_hb_quit);
808,667✔
574
  return (*fp_taos_set_hb_quit)(quitByKill);
808,667✔
575
}
576

577
int taos_set_notify_cb(TAOS *taos, __taos_notify_fn_t fp, void *param, int type) {
18,550✔
578
  CHECK_INT(fp_taos_set_notify_cb);
18,550✔
579
  return (*fp_taos_set_notify_cb)(taos, fp, param, type);
18,550✔
580
}
581

582
void taos_fetch_whitelist_a(TAOS *taos, __taos_async_whitelist_fn_t fp, void *param) {
×
583
  CHECK_VOID(fp_taos_fetch_whitelist_a);
×
584
  return (*fp_taos_fetch_whitelist_a)(taos, fp, param);
×
585
}
586

587
void taos_fetch_whitelist_dual_stack_a(TAOS *taos, __taos_async_whitelist_dual_stack_fn_t fp, void *param) {
×
588
  CHECK_VOID(fp_taos_fetch_whitelist_dual_stack_a);
×
589
  return (*fp_taos_fetch_whitelist_dual_stack_a)(taos, fp, param);
×
590
}
591

592
int taos_set_conn_mode(TAOS *taos, int mode, int value) {
4,281✔
593
  CHECK_INT(fp_taos_set_conn_mode);
4,281✔
594
  return (*fp_taos_set_conn_mode)(taos, mode, value);
4,281✔
595
}
596

597
TAOS_RES *taos_schemaless_insert(TAOS *taos, char *lines[], int numLines, int protocol, int precision) {
726,968✔
598
  CHECK_PTR(fp_taos_schemaless_insert);
726,968✔
599
  return (*fp_taos_schemaless_insert)(taos, lines, numLines, protocol, precision);
726,968✔
600
}
601

602
TAOS_RES *taos_schemaless_insert_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision,
×
603
                                            int64_t reqid) {
604
  CHECK_PTR(fp_taos_schemaless_insert_with_reqid);
×
605
  return (*fp_taos_schemaless_insert_with_reqid)(taos, lines, numLines, protocol, precision, reqid);
×
606
}
607

608
TAOS_RES *taos_schemaless_insert_raw(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
1,350✔
609
                                     int precision) {
610
  CHECK_PTR(fp_taos_schemaless_insert_raw);
1,350✔
611
  return (*fp_taos_schemaless_insert_raw)(taos, lines, len, totalRows, protocol, precision);
1,350✔
612
}
613

614
TAOS_RES *taos_schemaless_insert_raw_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
1,800✔
615
                                                int precision, int64_t reqid) {
616
  CHECK_PTR(fp_taos_schemaless_insert_raw_with_reqid);
1,800✔
617
  return (*fp_taos_schemaless_insert_raw_with_reqid)(taos, lines, len, totalRows, protocol, precision, reqid);
1,800✔
618
}
619

620
TAOS_RES *taos_schemaless_insert_ttl(TAOS *taos, char *lines[], int numLines, int protocol, int precision,
×
621
                                     int32_t ttl) {
622
  CHECK_PTR(fp_taos_schemaless_insert_ttl);
×
623
  return (*fp_taos_schemaless_insert_ttl)(taos, lines, numLines, protocol, precision, ttl);
×
624
}
625

626
TAOS_RES *taos_schemaless_insert_ttl_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision,
290,290✔
627
                                                int32_t ttl, int64_t reqid) {
628
  CHECK_PTR(fp_taos_schemaless_insert_ttl_with_reqid);
290,290✔
629
  return (*fp_taos_schemaless_insert_ttl_with_reqid)(taos, lines, numLines, protocol, precision, ttl, reqid);
290,290✔
630
}
631

632
TAOS_RES *taos_schemaless_insert_raw_ttl(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
×
633
                                         int precision, int32_t ttl) {
634
  CHECK_PTR(fp_taos_schemaless_insert_raw_ttl);
×
635
  return (*fp_taos_schemaless_insert_raw_ttl)(taos, lines, len, totalRows, protocol, precision, ttl);
×
636
}
637

638
TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
3,597✔
639
                                                    int precision, int32_t ttl, int64_t reqid) {
640
  CHECK_PTR(fp_taos_schemaless_insert_raw_ttl_with_reqid);
3,597✔
641
  return (*fp_taos_schemaless_insert_raw_ttl_with_reqid)(taos, lines, len, totalRows, protocol, precision, ttl, reqid);
3,597✔
642
}
643

644
TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid_tbname_key(TAOS *taos, char *lines, int len, int32_t *totalRows,
×
645
                                                               int protocol, int precision, int32_t ttl, int64_t reqid,
646
                                                               char *tbnameKey) {
647
  CHECK_PTR(fp_taos_schemaless_insert_raw_ttl_with_reqid_tbname_key);
×
648
  return (*fp_taos_schemaless_insert_raw_ttl_with_reqid_tbname_key)(taos, lines, len, totalRows, protocol, precision,
×
649
                                                                    ttl, reqid, tbnameKey);
650
}
651

652
TAOS_RES *taos_schemaless_insert_ttl_with_reqid_tbname_key(TAOS *taos, char *lines[], int numLines, int protocol,
290,290✔
653
                                                           int precision, int32_t ttl, int64_t reqid, char *tbnameKey) {
654
  CHECK_PTR(fp_taos_schemaless_insert_ttl_with_reqid_tbname_key);
290,290✔
655
  return (*fp_taos_schemaless_insert_ttl_with_reqid_tbname_key)(taos, lines, numLines, protocol, precision, ttl, reqid,
290,290✔
656
                                                                tbnameKey);
657
}
658

659
tmq_conf_t *tmq_conf_new() {
29,820✔
660
  (void)taos_init();
29,820✔
661
  CHECK_PTR(fp_tmq_conf_new);
29,820✔
662
  return (*fp_tmq_conf_new)();
29,820✔
663
}
664

665
tmq_conf_res_t tmq_conf_set(tmq_conf_t *conf, const char *key, const char *value) {
198,523✔
666
  CHECK_INT(fp_tmq_conf_set);
198,523✔
667
  return (*fp_tmq_conf_set)(conf, key, value);
198,523✔
668
}
669

670
void tmq_conf_destroy(tmq_conf_t *conf) {
29,820✔
671
  CHECK_VOID(fp_tmq_conf_destroy);
29,820✔
672
  (*fp_tmq_conf_destroy)(conf);
29,820✔
673
}
674

675
void tmq_conf_set_auto_commit_cb(tmq_conf_t *conf, tmq_commit_cb *cb, void *param) {
417✔
676
  CHECK_VOID(fp_tmq_conf_set_auto_commit_cb);
417✔
677
  (*fp_tmq_conf_set_auto_commit_cb)(conf, cb, param);
417✔
678
}
679

680
tmq_list_t *tmq_list_new() {
37,844✔
681
  (void)taos_init();
37,844✔
682
  CHECK_PTR(fp_tmq_list_new);
37,844✔
683
  return (*fp_tmq_list_new)();
37,844✔
684
}
685

686
int32_t tmq_list_append(tmq_list_t *tlist, const char *val) {
31,354✔
687
  CHECK_INT(fp_tmq_list_append);
31,354✔
688
  return (*fp_tmq_list_append)(tlist, val);
31,354✔
689
}
690

691
void tmq_list_destroy(tmq_list_t *tlist) {
38,237✔
692
  CHECK_VOID(fp_tmq_list_destroy);
38,237✔
693
  (*fp_tmq_list_destroy)(tlist);
38,237✔
694
}
695

696
int32_t tmq_list_get_size(const tmq_list_t *tlist) {
2,578✔
697
  CHECK_INT(fp_tmq_list_get_size);
2,578✔
698
  return (*fp_tmq_list_get_size)(tlist);
2,578✔
699
}
700

701
char **tmq_list_to_c_array(const tmq_list_t *tlist) {
2,578✔
702
  CHECK_PTR(fp_tmq_list_to_c_array);
2,578✔
703
  return (*fp_tmq_list_to_c_array)(tlist);
2,578✔
704
}
705

706
tmq_t *tmq_consumer_new(tmq_conf_t *conf, char *errstr, int32_t errstrLen) {
29,820✔
707
  (void)taos_init();
29,820✔
708
  CHECK_PTR(fp_tmq_consumer_new);
29,820✔
709
  return (*fp_tmq_consumer_new)(conf, errstr, errstrLen);
29,820✔
710
}
711

712
int32_t tmq_subscribe(tmq_t *tmq, const tmq_list_t *topic_list) {
35,659✔
713
  CHECK_INT(fp_tmq_subscribe);
35,659✔
714
  return (*fp_tmq_subscribe)(tmq, topic_list);
35,659✔
715
}
716

717
int32_t tmq_unsubscribe(tmq_t *tmq) {
22,742✔
718
  CHECK_INT(fp_tmq_unsubscribe);
22,742✔
719
  return (*fp_tmq_unsubscribe)(tmq);
22,742✔
720
}
721

722
int32_t tmq_subscription(tmq_t *tmq, tmq_list_t **topics) {
2,578✔
723
  CHECK_INT(fp_tmq_subscription);
2,578✔
724
  return (*fp_tmq_subscription)(tmq, topics);
2,578✔
725
}
726

727
TAOS_RES *tmq_consumer_poll(tmq_t *tmq, int64_t timeout) {
510,391✔
728
  CHECK_PTR(fp_tmq_consumer_poll);
510,391✔
729
  return (*fp_tmq_consumer_poll)(tmq, timeout);
510,391✔
730
}
731

732
int32_t tmq_consumer_close(tmq_t *tmq) {
31,261✔
733
  CHECK_INT(fp_tmq_consumer_close);
31,261✔
734
  return (*fp_tmq_consumer_close)(tmq);
31,261✔
735
}
736

737
int32_t tmq_commit_sync(tmq_t *tmq, const TAOS_RES *msg) {
31,316✔
738
  CHECK_INT(fp_tmq_commit_sync);
31,316✔
739
  return (*fp_tmq_commit_sync)(tmq, msg);
31,316✔
740
}
741

742
void tmq_commit_async(tmq_t *tmq, const TAOS_RES *msg, tmq_commit_cb *cb, void *param) {
×
743
  CHECK_VOID(fp_tmq_commit_async);
×
744
  (*fp_tmq_commit_async)(tmq, msg, cb, param);
×
745
}
746

747
int32_t tmq_commit_offset_sync(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset) {
424✔
748
  CHECK_INT(fp_tmq_commit_offset_sync);
424✔
749
  return (*fp_tmq_commit_offset_sync)(tmq, pTopicName, vgId, offset);
424✔
750
}
751

752
void tmq_commit_offset_async(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset, tmq_commit_cb *cb,
×
753
                             void *param) {
754
  CHECK_VOID(fp_tmq_commit_offset_async);
×
755
  (*fp_tmq_commit_offset_async)(tmq, pTopicName, vgId, offset, cb, param);
×
756
}
757

758
int32_t tmq_get_topic_assignment(tmq_t *tmq, const char *pTopicName, tmq_topic_assignment **assignment,
4,072✔
759
                                 int32_t *numOfAssignment) {
760
  CHECK_INT(fp_tmq_get_topic_assignment);
4,072✔
761
  return (*fp_tmq_get_topic_assignment)(tmq, pTopicName, assignment, numOfAssignment);
4,072✔
762
}
763

764
void tmq_free_assignment(tmq_topic_assignment *pAssignment) {
1,444✔
765
  CHECK_VOID(fp_tmq_free_assignment);
1,444✔
766
  (*fp_tmq_free_assignment)(pAssignment);
1,444✔
767
}
768

769
int32_t tmq_offset_seek(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset) {
3,545✔
770
  CHECK_INT(fp_tmq_offset_seek);
3,545✔
771
  return (*fp_tmq_offset_seek)(tmq, pTopicName, vgId, offset);
3,545✔
772
}
773

774
int64_t tmq_position(tmq_t *tmq, const char *pTopicName, int32_t vgId) {
636✔
775
  CHECK_INT(fp_tmq_position);
636✔
776
  return (*fp_tmq_position)(tmq, pTopicName, vgId);
636✔
777
}
778

779
int64_t tmq_committed(tmq_t *tmq, const char *pTopicName, int32_t vgId) {
742✔
780
  CHECK_INT(fp_tmq_committed);
742✔
781
  return (*fp_tmq_committed)(tmq, pTopicName, vgId);
742✔
782
}
783

784
TAOS *tmq_get_connect(tmq_t *tmq) {
×
785
  CHECK_PTR(fp_tmq_get_connect);
×
786
  return (*fp_tmq_get_connect)(tmq);
×
787
}
788

789
const char *tmq_get_table_name(TAOS_RES *res) {
84,027,139✔
790
  CHECK_PTR(fp_tmq_get_table_name);
84,027,139✔
791
  return (*fp_tmq_get_table_name)(res);
84,027,139✔
792
}
793

794
tmq_res_t tmq_get_res_type(TAOS_RES *res) {
354,738✔
795
  CHECK_INT(fp_tmq_get_res_type);
354,738✔
796
  return (*fp_tmq_get_res_type)(res);
354,738✔
797
}
798

799
const char *tmq_get_topic_name(TAOS_RES *res) {
89,410✔
800
  CHECK_PTR(fp_tmq_get_topic_name);
89,410✔
801
  return (*fp_tmq_get_topic_name)(res);
89,410✔
802
}
803

804
const char *tmq_get_db_name(TAOS_RES *res) {
81,013✔
805
  CHECK_PTR(fp_tmq_get_db_name);
81,013✔
806
  return (*fp_tmq_get_db_name)(res);
81,013✔
807
}
808

809
int32_t tmq_get_vgroup_id(TAOS_RES *res) {
89,410✔
810
  CHECK_INT(fp_tmq_get_vgroup_id);
89,410✔
811
  return (*fp_tmq_get_vgroup_id)(res);
89,410✔
812
}
813

814
int64_t tmq_get_vgroup_offset(TAOS_RES *res) {
220,341✔
815
  CHECK_INT(fp_tmq_get_vgroup_offset);
220,341✔
816
  return (*fp_tmq_get_vgroup_offset)(res);
220,341✔
817
}
818

819
const char *tmq_err2str(int32_t code) {
5,487✔
820
  CHECK_PTR(fp_tmq_err2str);
5,487✔
821
  return (*fp_tmq_err2str)(code);
5,487✔
822
}
823

UNCOV
824
int32_t tmq_get_raw(TAOS_RES *res, tmq_raw_data *raw) {
×
UNCOV
825
  CHECK_INT(fp_tmq_get_raw);
×
UNCOV
826
  return (*fp_tmq_get_raw)(res, raw);
×
827
}
828

829
int32_t tmq_write_raw(TAOS *taos, tmq_raw_data raw) {
×
830
  CHECK_INT(fp_tmq_write_raw);
×
831
  return (*fp_tmq_write_raw)(taos, raw);
×
832
}
833

834
int taos_write_raw_block(TAOS *taos, int numOfRows, char *pData, const char *tbname) {
×
835
  CHECK_INT(fp_taos_write_raw_block);
×
836
  return (*fp_taos_write_raw_block)(taos, numOfRows, pData, tbname);
×
837
}
838

839
int taos_write_raw_block_with_reqid(TAOS *taos, int numOfRows, char *pData, const char *tbname, int64_t reqid) {
×
840
  CHECK_INT(fp_taos_write_raw_block_with_reqid);
×
841
  return (*fp_taos_write_raw_block_with_reqid)(taos, numOfRows, pData, tbname, reqid);
×
842
}
843

844
int taos_write_raw_block_with_fields(TAOS *taos, int rows, char *pData, const char *tbname, TAOS_FIELD *fields,
×
845
                                     int numFields) {
846
  CHECK_INT(fp_taos_write_raw_block_with_fields);
×
847
  return (*fp_taos_write_raw_block_with_fields)(taos, rows, pData, tbname, fields, numFields);
×
848
}
849

850
int taos_write_raw_block_with_fields_with_reqid(TAOS *taos, int rows, char *pData, const char *tbname,
×
851
                                                TAOS_FIELD *fields, int numFields, int64_t reqid) {
852
  CHECK_INT(fp_taos_write_raw_block_with_fields_with_reqid);
×
853
  return (*fp_taos_write_raw_block_with_fields_with_reqid)(taos, rows, pData, tbname, fields, numFields, reqid);
×
854
}
855

856
void tmq_free_raw(tmq_raw_data raw) {
×
857
  CHECK_VOID(fp_tmq_free_raw);
×
858
  (*fp_tmq_free_raw)(raw);
×
859
}
860

861
char *tmq_get_json_meta(TAOS_RES *res) {
416✔
862
  CHECK_PTR(fp_tmq_get_json_meta);
416✔
863
  return (*fp_tmq_get_json_meta)(res);
416✔
864
}
865

866
void tmq_free_json_meta(char *jsonMeta) {
416✔
867
  CHECK_VOID(fp_tmq_free_json_meta);
416✔
868
  return (*fp_tmq_free_json_meta)(jsonMeta);
416✔
869
}
870

871
TSDB_SERVER_STATUS taos_check_server_status(const char *fqdn, int port, char *details, int maxlen) {
1,262✔
872
  CHECK_INT(fp_taos_check_server_status);
1,262✔
873
  return (*fp_taos_check_server_status)(fqdn, port, details, maxlen);
1,262✔
874
}
875

876
void taos_write_crashinfo(int signum, void *sigInfo, void *context) {
×
877
  (void)taos_init();
×
878
  CHECK_VOID(fp_taos_write_crashinfo);
×
879
  (*fp_taos_write_crashinfo)(signum, sigInfo, context);
×
880
}
881

882
char *getBuildInfo() {
×
883
  (void)taos_init();
×
884
  CHECK_PTR(fp_getBuildInfo);
×
885
  return (*fp_getBuildInfo)();
×
886
}
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