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

taosdata / TDengine / #4875

09 Dec 2025 01:22AM UTC coverage: 64.472% (-0.2%) from 64.623%
#4875

push

travis-ci

guanshengliang
fix: temporarily disable memory leak detection for UDF tests (#33856)

162014 of 251293 relevant lines covered (64.47%)

104318075.66 hits per line

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

71.34
/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) {
432✔
87
  if (taos_init() != 0) {
432✔
88
    ERR_CONFRET(TSDB_CODE_DLL_NOT_LOAD)
×
89
  }
90

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

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

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

110
int taos_init(void) {
822,223,870✔
111
  (void)taosThreadOnce(&tsDriverOnce, taos_init_driver);
822,223,870✔
112
  (void)taosThreadOnce(&tsInitOnce, taos_init_wrapper);
822,224,641✔
113
  return tsInitOnceRet;
822,220,916✔
114
}
115

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

121
int taos_options(TSDB_OPTION option, const void *arg, ...) {
1,494,272✔
122
  if (option == TSDB_OPTION_DRIVER) {
1,494,272✔
123
    if (tsDriver == NULL) {
910,198✔
124
      if (strcasecmp((const char *)arg, "native") == 0) {
910,198✔
125
        tsDriverType = DRIVER_NATIVE;
887,784✔
126
        return 0;
887,784✔
127
      }
128
      if (strcasecmp((const char *)arg, "websocket") == 0) {
22,414✔
129
        tsDriverType = DRIVER_WEBSOCKET;
22,414✔
130
        return 0;
22,414✔
131
      }
132
    }
133
    terrno = TSDB_CODE_REPEAT_INIT;
×
134
    return -1;
×
135
  }
136
  (void)taosThreadOnce(&tsDriverOnce, taos_init_driver);
584,074✔
137

138
  CHECK_INT(fp_taos_options);
584,074✔
139
  return (*fp_taos_options)(option, arg);
584,074✔
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,062,386✔
148
  if (taos_init() != 0) {
3,062,386✔
149
    //terrno = TSDB_CODE_DLL_NOT_LOAD;
150
    return NULL;
×
151
  }
152

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

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

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

167
TAOS *taos_connect_with_dsn(const char *dsn) {
×
168
  if (taos_init() != 0) {
×
169
    return NULL;
×
170
  }
171

172
  CHECK_PTR(fp_taos_connect_with_dsn);
×
173
  return (*fp_taos_connect_with_dsn)(dsn);
×
174
}
175

176
void taos_close(TAOS *taos) {
3,041,340✔
177
  CHECK_VOID(fp_taos_close);
3,041,340✔
178
  (*fp_taos_close)(taos);
3,041,340✔
179
}
180

181
const char *taos_data_type(int type) {
×
182
  (void)taos_init();
×
183
  CHECK_PTR(fp_taos_data_type);
×
184
  return (*fp_taos_data_type)(type);
×
185
}
186

187
TAOS_STMT *taos_stmt_init(TAOS *taos) {
385,956✔
188
  CHECK_PTR(fp_taos_stmt_init);
385,956✔
189
  return (*fp_taos_stmt_init)(taos);
385,956✔
190
}
191

192
TAOS_STMT *taos_stmt_init_with_reqid(TAOS *taos, int64_t reqid) {
11,320✔
193
  CHECK_PTR(fp_taos_stmt_init_with_reqid);
11,320✔
194
  return (*fp_taos_stmt_init_with_reqid)(taos, reqid);
11,320✔
195
}
196

197
TAOS_STMT *taos_stmt_init_with_options(TAOS *taos, TAOS_STMT_OPTIONS *options) {
30,139✔
198
  CHECK_PTR(fp_taos_stmt_init_with_options);
30,139✔
199
  return (*fp_taos_stmt_init_with_options)(taos, options);
30,139✔
200
}
201

202
int taos_stmt_prepare(TAOS_STMT *stmt, const char *sql, unsigned long length) {
757,389✔
203
  CHECK_INT(fp_taos_stmt_prepare);
757,389✔
204
  return (*fp_taos_stmt_prepare)(stmt, sql, length);
757,389✔
205
}
206

207
int taos_stmt_set_tbname_tags(TAOS_STMT *stmt, const char *name, TAOS_MULTI_BIND *tags) {
17,952✔
208
  CHECK_INT(fp_taos_stmt_set_tbname_tags);
17,952✔
209
  return (*fp_taos_stmt_set_tbname_tags)(stmt, name, tags);
17,952✔
210
}
211

212
int taos_stmt_set_tbname(TAOS_STMT *stmt, const char *name) {
15,250,965✔
213
  CHECK_INT(fp_taos_stmt_set_tbname);
15,250,965✔
214
  return (*fp_taos_stmt_set_tbname)(stmt, name);
15,250,965✔
215
}
216

217
int taos_stmt_set_tags(TAOS_STMT *stmt, TAOS_MULTI_BIND *tags) {
4,969✔
218
  CHECK_INT(fp_taos_stmt_set_tags);
4,969✔
219
  return (*fp_taos_stmt_set_tags)(stmt, tags);
4,969✔
220
}
221

222
int taos_stmt_set_sub_tbname(TAOS_STMT *stmt, const char *name) {
×
223
  CHECK_INT(fp_taos_stmt_set_sub_tbname);
×
224
  return (*fp_taos_stmt_set_sub_tbname)(stmt, name);
×
225
}
226

227
int taos_stmt_get_tag_fields(TAOS_STMT *stmt, int *fieldNum, TAOS_FIELD_E **fields) {
×
228
  CHECK_INT(fp_taos_stmt_get_tag_fields);
×
229
  return (*fp_taos_stmt_get_tag_fields)(stmt, fieldNum, fields);
×
230
}
231

232
int taos_stmt_get_col_fields(TAOS_STMT *stmt, int *fieldNum, TAOS_FIELD_E **fields) {
×
233
  CHECK_INT(fp_taos_stmt_get_col_fields);
×
234
  return (*fp_taos_stmt_get_col_fields)(stmt, fieldNum, fields);
×
235
}
236

237
void taos_stmt_reclaim_fields(TAOS_STMT *stmt, TAOS_FIELD_E *fields) {
×
238
  CHECK_VOID(fp_taos_stmt_reclaim_fields);
×
239
  (*fp_taos_stmt_reclaim_fields)(stmt, fields);
×
240
}
241

242
int taos_stmt_is_insert(TAOS_STMT *stmt, int *insert) {
×
243
  CHECK_INT(fp_taos_stmt_is_insert);
×
244
  return (*fp_taos_stmt_is_insert)(stmt, insert);
×
245
}
246

247
int taos_stmt_num_params(TAOS_STMT *stmt, int *nums) {
×
248
  CHECK_INT(fp_taos_stmt_num_params);
×
249
  return (*fp_taos_stmt_num_params)(stmt, nums);
×
250
}
251

252
int taos_stmt_get_param(TAOS_STMT *stmt, int idx, int *type, int *bytes) {
×
253
  CHECK_INT(fp_taos_stmt_get_param);
×
254
  return (*fp_taos_stmt_get_param)(stmt, idx, type, bytes);
×
255
}
256

257
int taos_stmt_bind_param(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind) {
52,923✔
258
  CHECK_INT(fp_taos_stmt_bind_param);
52,923✔
259
  return (*fp_taos_stmt_bind_param)(stmt, bind);
52,923✔
260
}
261

262
int taos_stmt_bind_param_batch(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind) {
512,063,312✔
263
  CHECK_INT(fp_taos_stmt_bind_param_batch);
512,063,312✔
264
  return (*fp_taos_stmt_bind_param_batch)(stmt, bind);
512,063,312✔
265
}
266

267
int taos_stmt_bind_single_param_batch(TAOS_STMT *stmt, TAOS_MULTI_BIND *bind, int colIdx) {
27,580✔
268
  CHECK_INT(fp_taos_stmt_bind_single_param_batch);
27,580✔
269
  return (*fp_taos_stmt_bind_single_param_batch)(stmt, bind, colIdx);
27,580✔
270
}
271

272
int taos_stmt_add_batch(TAOS_STMT *stmt) {
501,084,012✔
273
  CHECK_INT(fp_taos_stmt_add_batch);
501,084,012✔
274
  return (*fp_taos_stmt_add_batch)(stmt);
501,084,012✔
275
}
276

277
int taos_stmt_execute(TAOS_STMT *stmt) {
6,289,640✔
278
  CHECK_INT(fp_taos_stmt_execute);
6,289,640✔
279
  return (*fp_taos_stmt_execute)(stmt);
6,289,640✔
280
}
281

282
TAOS_RES *taos_stmt_use_result(TAOS_STMT *stmt) {
9,856✔
283
  CHECK_PTR(fp_taos_stmt_use_result);
9,856✔
284
  return (*fp_taos_stmt_use_result)(stmt);
9,856✔
285
}
286

287
int taos_stmt_close(TAOS_STMT *stmt) {
415,956✔
288
  CHECK_INT(fp_taos_stmt_close);
415,956✔
289
  return (*fp_taos_stmt_close)(stmt);
415,956✔
290
}
291

292
char *taos_stmt_errstr(TAOS_STMT *stmt) {
10,283✔
293
  CHECK_PTR(fp_taos_stmt_errstr);
10,283✔
294
  return (*fp_taos_stmt_errstr)(stmt);
10,283✔
295
}
296

297
int taos_stmt_affected_rows(TAOS_STMT *stmt) {
4,818✔
298
  CHECK_INT(fp_taos_stmt_affected_rows);
4,818✔
299
  return (*fp_taos_stmt_affected_rows)(stmt);
4,818✔
300
}
301

302
int taos_stmt_affected_rows_once(TAOS_STMT *stmt) {
2,370✔
303
  CHECK_INT(fp_taos_stmt_affected_rows_once);
2,370✔
304
  return (*fp_taos_stmt_affected_rows_once)(stmt);
2,370✔
305
}
306

307
TAOS_STMT2 *taos_stmt2_init(TAOS *taos, TAOS_STMT2_OPTION *option) {
24,170✔
308
  CHECK_PTR(fp_taos_stmt2_init);
24,170✔
309
  return (*fp_taos_stmt2_init)(taos, option);
24,170✔
310
}
311

312
int taos_stmt2_prepare(TAOS_STMT2 *stmt, const char *sql, unsigned long length) {
26,034✔
313
  CHECK_INT(fp_taos_stmt2_prepare);
26,034✔
314
  return (*fp_taos_stmt2_prepare)(stmt, sql, length);
26,034✔
315
}
316

317
int taos_stmt2_bind_param(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t col_idx) {
9,079,265✔
318
  CHECK_INT(fp_taos_stmt2_bind_param);
9,079,265✔
319
  return (*fp_taos_stmt2_bind_param)(stmt, bindv, col_idx);
9,079,265✔
320
}
321

322
int taos_stmt2_bind_param_a(TAOS_STMT2 *stmt, TAOS_STMT2_BINDV *bindv, int32_t col_idx, __taos_async_fn_t fp,
×
323
                            void *param) {
324
  CHECK_INT(fp_taos_stmt2_bind_param_a);
×
325
  return (*fp_taos_stmt2_bind_param_a)(stmt, bindv, col_idx, fp, param);
×
326
}
327

328
int taos_stmt2_exec(TAOS_STMT2 *stmt, int *affected_rows) {
9,081,370✔
329
  CHECK_INT(fp_taos_stmt2_exec);
9,081,370✔
330
  return (*fp_taos_stmt2_exec)(stmt, affected_rows);
9,081,370✔
331
}
332

333
int taos_stmt2_close(TAOS_STMT2 *stmt) {
24,170✔
334
  CHECK_INT(fp_taos_stmt2_close);
24,170✔
335
  return (*fp_taos_stmt2_close)(stmt);
24,170✔
336
}
337

338
int taos_stmt2_is_insert(TAOS_STMT2 *stmt, int *insert) {
887✔
339
  CHECK_INT(fp_taos_stmt2_is_insert);
887✔
340
  return (*fp_taos_stmt2_is_insert)(stmt, insert);
887✔
341
}
342

343
int taos_stmt2_get_fields(TAOS_STMT2 *stmt, int *count, TAOS_FIELD_ALL **fields) {
657✔
344
  CHECK_INT(fp_taos_stmt2_get_fields);
657✔
345
  return (*fp_taos_stmt2_get_fields)(stmt, count, fields);
657✔
346
}
347

348
void taos_stmt2_free_fields(TAOS_STMT2 *stmt, TAOS_FIELD_ALL *fields) {
657✔
349
  CHECK_VOID(fp_taos_stmt2_free_fields);
657✔
350
  (*fp_taos_stmt2_free_fields)(stmt, fields);
657✔
351
}
352

353
TAOS_RES *taos_stmt2_result(TAOS_STMT2 *stmt) {
230✔
354
  CHECK_PTR(fp_taos_stmt2_result);
230✔
355
  return (*fp_taos_stmt2_result)(stmt);
230✔
356
}
357

358
char *taos_stmt2_error(TAOS_STMT2 *stmt) {
×
359
  CHECK_PTR(fp_taos_stmt2_error);
×
360
  return (*fp_taos_stmt2_error)(stmt);
×
361
}
362

363
TAOS_RES *taos_query(TAOS *taos, const char *sql) {
622,555,454✔
364
  CHECK_PTR(fp_taos_query);
622,555,454✔
365
  return (*fp_taos_query)(taos, sql);
622,555,454✔
366
}
367

368
TAOS_RES *taos_query_with_reqid(TAOS *taos, const char *sql, int64_t reqId) {
2,470,989✔
369
  CHECK_PTR(fp_taos_query_with_reqid);
2,470,989✔
370
  return (*fp_taos_query_with_reqid)(taos, sql, reqId);
2,470,989✔
371
}
372

373
TAOS_ROW taos_fetch_row(TAOS_RES *res) {
1,216,365,089✔
374
  CHECK_PTR(fp_taos_fetch_row);
1,216,365,089✔
375
  return (*fp_taos_fetch_row)(res);
1,216,365,089✔
376
}
377

378
int taos_result_precision(TAOS_RES *res) {
96,067,593✔
379
  CHECK_INT(fp_taos_result_precision);
96,067,593✔
380
  return (*fp_taos_result_precision)(res);
96,067,593✔
381
}
382

383
void taos_free_result(TAOS_RES *res) {
625,775,675✔
384
  CHECK_VOID(fp_taos_free_result);
625,775,675✔
385
  return (*fp_taos_free_result)(res);
625,775,675✔
386
}
387

388
void taos_kill_query(TAOS *taos) {
1,185✔
389
  CHECK_VOID(fp_taos_kill_query);
1,185✔
390
  return (*fp_taos_kill_query)(taos);
1,185✔
391
}
392

393
int taos_field_count(TAOS_RES *res) {
1,894,857,128✔
394
  CHECK_INT(fp_taos_field_count);
1,894,857,128✔
395
  return (*fp_taos_field_count)(res);
1,894,857,128✔
396
}
397

398
int taos_num_fields(TAOS_RES *res) {
1,032,386,954✔
399
  CHECK_INT(fp_taos_num_fields);
1,032,386,954✔
400
  return (*fp_taos_num_fields)(res);
1,032,386,954✔
401
}
402

403
int taos_affected_rows(TAOS_RES *res) {
486,105,848✔
404
  CHECK_INT(fp_taos_affected_rows);
486,105,848✔
405
  return (*fp_taos_affected_rows)(res);
486,105,848✔
406
}
407

408
int64_t taos_affected_rows64(TAOS_RES *res) {
1,285,494✔
409
  CHECK_INT(fp_taos_affected_rows64);
1,285,494✔
410
  return (*fp_taos_affected_rows64)(res);
1,285,494✔
411
}
412

413
TAOS_FIELD *taos_fetch_fields(TAOS_RES *res) {
169,098,593✔
414
  CHECK_PTR(fp_taos_fetch_fields);
169,098,593✔
415
  return (*fp_taos_fetch_fields)(res);
169,098,593✔
416
}
417

418
TAOS_FIELD_E *taos_fetch_fields_e(TAOS_RES *res) {
1,707✔
419
  CHECK_PTR(fp_taos_fetch_fields_e);
1,707✔
420
  return (*fp_taos_fetch_fields_e)(res);
1,707✔
421
}
422

423
int taos_select_db(TAOS *taos, const char *db) {
155,282✔
424
  CHECK_INT(fp_taos_select_db);
155,282✔
425
  return (*fp_taos_select_db)(taos, db);
155,282✔
426
}
427

428
int taos_print_row(char *str, TAOS_ROW row, TAOS_FIELD *fields, int num_fields) {
75,492,543✔
429
  CHECK_INT(fp_taos_print_row);
75,492,543✔
430
  return (*fp_taos_print_row)(str, row, fields, num_fields);
75,492,543✔
431
}
432

433
int taos_print_row_with_size(char *str, uint32_t size, TAOS_ROW row, TAOS_FIELD *fields, int num_fields) {
75,505,048✔
434
  CHECK_INT(fp_taos_print_row_with_size);
75,505,048✔
435
  return (*fp_taos_print_row_with_size)(str, size, row, fields, num_fields);
75,505,048✔
436
}
437

438
void taos_stop_query(TAOS_RES *res) {
53,933,435✔
439
  CHECK_VOID(fp_taos_stop_query);
53,933,435✔
440
  (*fp_taos_stop_query)(res);
53,933,435✔
441
}
442

443
bool taos_is_null(TAOS_RES *res, int32_t row, int32_t col) {
×
444
  CHECK_BOOL(fp_taos_is_null);
×
445
  return (*fp_taos_is_null)(res, row, col);
×
446
}
447

448
int taos_is_null_by_column(TAOS_RES *res, int columnIndex, bool result[], int *rows) {
321,078,521✔
449
  CHECK_INT(fp_taos_is_null_by_column);
321,078,521✔
450
  return (*fp_taos_is_null_by_column)(res, columnIndex, result, rows);
321,078,521✔
451
}
452

453
bool taos_is_update_query(TAOS_RES *res) {
7,462,743✔
454
  CHECK_BOOL(fp_taos_is_update_query);
7,462,743✔
455
  return (*fp_taos_is_update_query)(res);
7,462,743✔
456
}
457

458
int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
169,397,372✔
459
  CHECK_INT(fp_taos_fetch_block);
169,397,372✔
460
  return (*fp_taos_fetch_block)(res, rows);
169,397,372✔
461
}
462

463
int taos_fetch_block_s(TAOS_RES *res, int *numOfRows, TAOS_ROW *rows) {
×
464
  CHECK_INT(fp_taos_fetch_block_s);
×
465
  return (*fp_taos_fetch_block_s)(res, numOfRows, rows);
×
466
}
467

468
int taos_fetch_raw_block(TAOS_RES *res, int *numOfRows, void **pData) {
1,142,159✔
469
  CHECK_INT(fp_taos_fetch_raw_block);
1,142,159✔
470
  return (*fp_taos_fetch_raw_block)(res, numOfRows, pData);
1,142,159✔
471
}
472

473
int *taos_get_column_data_offset(TAOS_RES *res, int columnIndex) {
114,736,938✔
474
  CHECK_PTR(fp_taos_get_column_data_offset);
114,736,938✔
475
  return (*fp_taos_get_column_data_offset)(res, columnIndex);
114,736,938✔
476
}
477

478
int taos_validate_sql(TAOS *taos, const char *sql) {
×
479
  CHECK_INT(fp_taos_validate_sql);
×
480
  return (*fp_taos_validate_sql)(taos, sql);
×
481
}
482

483
void taos_reset_current_db(TAOS *taos) {
×
484
  CHECK_VOID(fp_taos_reset_current_db);
×
485
  (*fp_taos_reset_current_db)(taos);
×
486
}
487

488
int *taos_fetch_lengths(TAOS_RES *res) {
1,133,788,022✔
489
  CHECK_PTR(fp_taos_fetch_lengths);
1,133,788,022✔
490
  return (*fp_taos_fetch_lengths)(res);
1,133,788,022✔
491
}
492

493
TAOS_ROW *taos_result_block(TAOS_RES *res) {
×
494
  CHECK_PTR(fp_taos_result_block);
×
495
  return (*fp_taos_result_block)(res);
×
496
}
497

498
const char *taos_get_server_info(TAOS *taos) {
46,026✔
499
  CHECK_PTR(fp_taos_get_server_info);
46,026✔
500
  return (*fp_taos_get_server_info)(taos);
46,026✔
501
}
502

503
const char *taos_get_client_info() {
1,445,016✔
504
  if (fp_taos_get_client_info == NULL) {
1,445,016✔
505
    return td_version;
670,300✔
506
  } else {
507
    return (*fp_taos_get_client_info)();
774,716✔
508
  }
509
}
510

511
int taos_get_current_db(TAOS *taos, char *database, int len, int *required) {
×
512
  CHECK_INT(fp_taos_get_current_db);
×
513
  return (*fp_taos_get_current_db)(taos, database, len, required);
×
514
}
515

516
const char *taos_errstr(TAOS_RES *res) {
21,164,293✔
517
  (void)taos_init();
21,164,293✔
518
  if (fp_taos_errstr == NULL) {
21,164,293✔
519
    return tstrerror(terrno);
×
520
  }
521
  return (*fp_taos_errstr)(res);
21,164,293✔
522
}
523

524
int taos_errno(TAOS_RES *res) {
793,998,196✔
525
  (void)taos_init();
793,998,196✔
526
  if (fp_taos_errno == NULL) {
793,997,196✔
527
    return terrno;
×
528
  }
529
  return (*fp_taos_errno)(res);
793,997,196✔
530
}
531

532
void taos_query_a(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param) {
32,251✔
533
  CHECK_VOID(fp_taos_query_a);
32,251✔
534
  (*fp_taos_query_a)(taos, sql, fp, param);
32,251✔
535
}
536

537
void taos_query_a_with_reqid(TAOS *taos, const char *sql, __taos_async_fn_t fp, void *param, int64_t reqid) {
×
538
  CHECK_VOID(fp_taos_query_a_with_reqid);
×
539
  (*fp_taos_query_a_with_reqid)(taos, sql, fp, param, reqid);
×
540
}
541

542
void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
8,281,425✔
543
  CHECK_VOID(fp_taos_fetch_rows_a);
8,281,425✔
544
  (*fp_taos_fetch_rows_a)(res, fp, param);
8,281,425✔
545
}
546

547
void taos_fetch_raw_block_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
3,905✔
548
  CHECK_VOID(fp_taos_fetch_raw_block_a);
3,905✔
549
  (*fp_taos_fetch_raw_block_a)(res, fp, param);
3,905✔
550
}
551

552
const void *taos_get_raw_block(TAOS_RES *res) {
2,296✔
553
  CHECK_PTR(fp_taos_get_raw_block);
2,296✔
554
  return (*fp_taos_get_raw_block)(res);
2,296✔
555
}
556

557
int taos_get_db_route_info(TAOS *taos, const char *db, TAOS_DB_ROUTE_INFO *dbInfo) {
×
558
  CHECK_INT(fp_taos_get_db_route_info);
×
559
  return (*fp_taos_get_db_route_info)(taos, db, dbInfo);
×
560
}
561

562
int taos_get_table_vgId(TAOS *taos, const char *db, const char *table, int *vgId) {
×
563
  CHECK_INT(fp_taos_get_table_vgId);
×
564
  return (*fp_taos_get_table_vgId)(taos, db, table, vgId);
×
565
}
566

567
int taos_get_tables_vgId(TAOS *taos, const char *db, const char *table[], int tableNum, int *vgId) {
×
568
  CHECK_INT(fp_taos_get_tables_vgId);
×
569
  return (*fp_taos_get_tables_vgId)(taos, db, table, tableNum, vgId);
×
570
}
571

572
int taos_load_table_info(TAOS *taos, const char *tableNameList) {
1,232✔
573
  CHECK_INT(fp_taos_load_table_info);
1,232✔
574
  return (*fp_taos_load_table_info)(taos, tableNameList);
1,232✔
575
}
576

577
void taos_set_hb_quit(int8_t quitByKill) {
774,119✔
578
  if (taos_init() != 0) {
774,119✔
579
    return;
×
580
  }
581

582
  CHECK_VOID(fp_taos_set_hb_quit);
774,119✔
583
  return (*fp_taos_set_hb_quit)(quitByKill);
774,119✔
584
}
585

586
int taos_set_notify_cb(TAOS *taos, __taos_notify_fn_t fp, void *param, int type) {
17,290✔
587
  CHECK_INT(fp_taos_set_notify_cb);
17,290✔
588
  return (*fp_taos_set_notify_cb)(taos, fp, param, type);
17,290✔
589
}
590

591
void taos_fetch_whitelist_a(TAOS *taos, __taos_async_whitelist_fn_t fp, void *param) {
×
592
  CHECK_VOID(fp_taos_fetch_whitelist_a);
×
593
  return (*fp_taos_fetch_whitelist_a)(taos, fp, param);
×
594
}
595

596
void taos_fetch_whitelist_dual_stack_a(TAOS *taos, __taos_async_whitelist_dual_stack_fn_t fp, void *param) {
×
597
  CHECK_VOID(fp_taos_fetch_whitelist_dual_stack_a);
×
598
  return (*fp_taos_fetch_whitelist_dual_stack_a)(taos, fp, param);
×
599
}
600

601
void taos_fetch_ip_whitelist_a(TAOS *taos, __taos_async_ip_whitelist_fn_t fp, void *param) {
×
602
  CHECK_VOID(fp_taos_fetch_ip_whitelist_a);
×
603
  return (*fp_taos_fetch_ip_whitelist_a)(taos, fp, param);
×
604
}
605

606
void taos_fetch_datetime_whitelist_a(TAOS *taos, __taos_async_datetime_whitelist_fn_t fp, void *param) {
×
607
  CHECK_VOID(fp_taos_fetch_datetime_whitelist_a);
×
608
  return (*fp_taos_fetch_datetime_whitelist_a)(taos, fp, param);
×
609
}
610

611
int taos_set_conn_mode(TAOS *taos, int mode, int value) {
4,103✔
612
  CHECK_INT(fp_taos_set_conn_mode);
4,103✔
613
  return (*fp_taos_set_conn_mode)(taos, mode, value);
4,103✔
614
}
615

616
TAOS_RES *taos_schemaless_insert(TAOS *taos, char *lines[], int numLines, int protocol, int precision) {
696,194✔
617
  CHECK_PTR(fp_taos_schemaless_insert);
696,194✔
618
  return (*fp_taos_schemaless_insert)(taos, lines, numLines, protocol, precision);
696,194✔
619
}
620

621
TAOS_RES *taos_schemaless_insert_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision,
×
622
                                            int64_t reqid) {
623
  CHECK_PTR(fp_taos_schemaless_insert_with_reqid);
×
624
  return (*fp_taos_schemaless_insert_with_reqid)(taos, lines, numLines, protocol, precision, reqid);
×
625
}
626

627
TAOS_RES *taos_schemaless_insert_raw(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
682✔
628
                                     int precision) {
629
  CHECK_PTR(fp_taos_schemaless_insert_raw);
682✔
630
  return (*fp_taos_schemaless_insert_raw)(taos, lines, len, totalRows, protocol, precision);
682✔
631
}
632

633
TAOS_RES *taos_schemaless_insert_raw_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
909✔
634
                                                int precision, int64_t reqid) {
635
  CHECK_PTR(fp_taos_schemaless_insert_raw_with_reqid);
909✔
636
  return (*fp_taos_schemaless_insert_raw_with_reqid)(taos, lines, len, totalRows, protocol, precision, reqid);
909✔
637
}
638

639
TAOS_RES *taos_schemaless_insert_ttl(TAOS *taos, char *lines[], int numLines, int protocol, int precision,
×
640
                                     int32_t ttl) {
641
  CHECK_PTR(fp_taos_schemaless_insert_ttl);
×
642
  return (*fp_taos_schemaless_insert_ttl)(taos, lines, numLines, protocol, precision, ttl);
×
643
}
644

645
TAOS_RES *taos_schemaless_insert_ttl_with_reqid(TAOS *taos, char *lines[], int numLines, int protocol, int precision,
269,644✔
646
                                                int32_t ttl, int64_t reqid) {
647
  CHECK_PTR(fp_taos_schemaless_insert_ttl_with_reqid);
269,644✔
648
  return (*fp_taos_schemaless_insert_ttl_with_reqid)(taos, lines, numLines, protocol, precision, ttl, reqid);
269,644✔
649
}
650

651
TAOS_RES *taos_schemaless_insert_raw_ttl(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
×
652
                                         int precision, int32_t ttl) {
653
  CHECK_PTR(fp_taos_schemaless_insert_raw_ttl);
×
654
  return (*fp_taos_schemaless_insert_raw_ttl)(taos, lines, len, totalRows, protocol, precision, ttl);
×
655
}
656

657
TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid(TAOS *taos, char *lines, int len, int32_t *totalRows, int protocol,
2,949✔
658
                                                    int precision, int32_t ttl, int64_t reqid) {
659
  CHECK_PTR(fp_taos_schemaless_insert_raw_ttl_with_reqid);
2,949✔
660
  return (*fp_taos_schemaless_insert_raw_ttl_with_reqid)(taos, lines, len, totalRows, protocol, precision, ttl, reqid);
2,949✔
661
}
662

663
TAOS_RES *taos_schemaless_insert_raw_ttl_with_reqid_tbname_key(TAOS *taos, char *lines, int len, int32_t *totalRows,
×
664
                                                               int protocol, int precision, int32_t ttl, int64_t reqid,
665
                                                               char *tbnameKey) {
666
  CHECK_PTR(fp_taos_schemaless_insert_raw_ttl_with_reqid_tbname_key);
×
667
  return (*fp_taos_schemaless_insert_raw_ttl_with_reqid_tbname_key)(taos, lines, len, totalRows, protocol, precision,
×
668
                                                                    ttl, reqid, tbnameKey);
669
}
670

671
TAOS_RES *taos_schemaless_insert_ttl_with_reqid_tbname_key(TAOS *taos, char *lines[], int numLines, int protocol,
269,644✔
672
                                                           int precision, int32_t ttl, int64_t reqid, char *tbnameKey) {
673
  CHECK_PTR(fp_taos_schemaless_insert_ttl_with_reqid_tbname_key);
269,644✔
674
  return (*fp_taos_schemaless_insert_ttl_with_reqid_tbname_key)(taos, lines, numLines, protocol, precision, ttl, reqid,
269,644✔
675
                                                                tbnameKey);
676
}
677

678
tmq_conf_t *tmq_conf_new() {
26,696✔
679
  (void)taos_init();
26,696✔
680
  CHECK_PTR(fp_tmq_conf_new);
26,696✔
681
  return (*fp_tmq_conf_new)();
26,696✔
682
}
683

684
tmq_conf_res_t tmq_conf_set(tmq_conf_t *conf, const char *key, const char *value) {
170,248✔
685
  CHECK_INT(fp_tmq_conf_set);
170,248✔
686
  return (*fp_tmq_conf_set)(conf, key, value);
170,248✔
687
}
688

689
void tmq_conf_destroy(tmq_conf_t *conf) {
26,696✔
690
  CHECK_VOID(fp_tmq_conf_destroy);
26,696✔
691
  (*fp_tmq_conf_destroy)(conf);
26,696✔
692
}
693

694
void tmq_conf_set_auto_commit_cb(tmq_conf_t *conf, tmq_commit_cb *cb, void *param) {
341✔
695
  CHECK_VOID(fp_tmq_conf_set_auto_commit_cb);
341✔
696
  (*fp_tmq_conf_set_auto_commit_cb)(conf, cb, param);
341✔
697
}
698

699
tmq_list_t *tmq_list_new() {
32,232✔
700
  (void)taos_init();
32,232✔
701
  CHECK_PTR(fp_tmq_list_new);
32,232✔
702
  return (*fp_tmq_list_new)();
32,232✔
703
}
704

705
int32_t tmq_list_append(tmq_list_t *tlist, const char *val) {
27,675✔
706
  CHECK_INT(fp_tmq_list_append);
27,675✔
707
  return (*fp_tmq_list_append)(tlist, val);
27,675✔
708
}
709

710
void tmq_list_destroy(tmq_list_t *tlist) {
32,429✔
711
  CHECK_VOID(fp_tmq_list_destroy);
32,429✔
712
  (*fp_tmq_list_destroy)(tlist);
32,429✔
713
}
714

715
int32_t tmq_list_get_size(const tmq_list_t *tlist) {
1,754✔
716
  CHECK_INT(fp_tmq_list_get_size);
1,754✔
717
  return (*fp_tmq_list_get_size)(tlist);
1,754✔
718
}
719

720
char **tmq_list_to_c_array(const tmq_list_t *tlist) {
1,754✔
721
  CHECK_PTR(fp_tmq_list_to_c_array);
1,754✔
722
  return (*fp_tmq_list_to_c_array)(tlist);
1,754✔
723
}
724

725
tmq_t *tmq_consumer_new(tmq_conf_t *conf, char *errstr, int32_t errstrLen) {
26,448✔
726
  (void)taos_init();
26,448✔
727
  CHECK_PTR(fp_tmq_consumer_new);
26,696✔
728
  return (*fp_tmq_consumer_new)(conf, errstr, errstrLen);
26,448✔
729
}
730

731
int32_t tmq_subscribe(tmq_t *tmq, const tmq_list_t *topic_list) {
30,675✔
732
  CHECK_INT(fp_tmq_subscribe);
30,675✔
733
  return (*fp_tmq_subscribe)(tmq, topic_list);
30,675✔
734
}
735

736
int32_t tmq_unsubscribe(tmq_t *tmq) {
19,206✔
737
  CHECK_INT(fp_tmq_unsubscribe);
19,206✔
738
  return (*fp_tmq_unsubscribe)(tmq);
19,206✔
739
}
740

741
int32_t tmq_subscription(tmq_t *tmq, tmq_list_t **topics) {
1,754✔
742
  CHECK_INT(fp_tmq_subscription);
1,754✔
743
  return (*fp_tmq_subscription)(tmq, topics);
1,754✔
744
}
745

746
TAOS_RES *tmq_consumer_poll(tmq_t *tmq, int64_t timeout) {
463,634✔
747
  CHECK_PTR(fp_tmq_consumer_poll);
463,634✔
748
  return (*fp_tmq_consumer_poll)(tmq, timeout);
463,634✔
749
}
750

751
int32_t tmq_consumer_close(tmq_t *tmq) {
27,632✔
752
  CHECK_INT(fp_tmq_consumer_close);
27,632✔
753
  return (*fp_tmq_consumer_close)(tmq);
27,632✔
754
}
755

756
int32_t tmq_commit_sync(tmq_t *tmq, const TAOS_RES *msg) {
22,052✔
757
  CHECK_INT(fp_tmq_commit_sync);
22,052✔
758
  return (*fp_tmq_commit_sync)(tmq, msg);
22,052✔
759
}
760

761
void tmq_commit_async(tmq_t *tmq, const TAOS_RES *msg, tmq_commit_cb *cb, void *param) {
×
762
  CHECK_VOID(fp_tmq_commit_async);
×
763
  (*fp_tmq_commit_async)(tmq, msg, cb, param);
×
764
}
765

766
int32_t tmq_commit_offset_sync(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset) {
534✔
767
  CHECK_INT(fp_tmq_commit_offset_sync);
534✔
768
  return (*fp_tmq_commit_offset_sync)(tmq, pTopicName, vgId, offset);
534✔
769
}
770

771
void tmq_commit_offset_async(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset, tmq_commit_cb *cb,
×
772
                             void *param) {
773
  CHECK_VOID(fp_tmq_commit_offset_async);
×
774
  (*fp_tmq_commit_offset_async)(tmq, pTopicName, vgId, offset, cb, param);
×
775
}
776

777
int32_t tmq_get_topic_assignment(tmq_t *tmq, const char *pTopicName, tmq_topic_assignment **assignment,
2,591✔
778
                                 int32_t *numOfAssignment) {
779
  CHECK_INT(fp_tmq_get_topic_assignment);
2,591✔
780
  return (*fp_tmq_get_topic_assignment)(tmq, pTopicName, assignment, numOfAssignment);
2,591✔
781
}
782

783
void tmq_free_assignment(tmq_topic_assignment *pAssignment) {
1,286✔
784
  CHECK_VOID(fp_tmq_free_assignment);
1,286✔
785
  (*fp_tmq_free_assignment)(pAssignment);
1,286✔
786
}
787

788
int32_t tmq_offset_seek(tmq_t *tmq, const char *pTopicName, int32_t vgId, int64_t offset) {
2,887✔
789
  CHECK_INT(fp_tmq_offset_seek);
2,887✔
790
  return (*fp_tmq_offset_seek)(tmq, pTopicName, vgId, offset);
2,887✔
791
}
792

793
int64_t tmq_position(tmq_t *tmq, const char *pTopicName, int32_t vgId) {
396✔
794
  CHECK_INT(fp_tmq_position);
396✔
795
  return (*fp_tmq_position)(tmq, pTopicName, vgId);
396✔
796
}
797

798
int64_t tmq_committed(tmq_t *tmq, const char *pTopicName, int32_t vgId) {
462✔
799
  CHECK_INT(fp_tmq_committed);
462✔
800
  return (*fp_tmq_committed)(tmq, pTopicName, vgId);
462✔
801
}
802

803
TAOS *tmq_get_connect(tmq_t *tmq) {
×
804
  CHECK_PTR(fp_tmq_get_connect);
×
805
  return (*fp_tmq_get_connect)(tmq);
×
806
}
807

808
const char *tmq_get_table_name(TAOS_RES *res) {
78,268,109✔
809
  CHECK_PTR(fp_tmq_get_table_name);
78,268,109✔
810
  return (*fp_tmq_get_table_name)(res);
78,268,109✔
811
}
812

813
tmq_res_t tmq_get_res_type(TAOS_RES *res) {
332,645✔
814
  CHECK_INT(fp_tmq_get_res_type);
332,645✔
815
  return (*fp_tmq_get_res_type)(res);
332,645✔
816
}
817

818
const char *tmq_get_topic_name(TAOS_RES *res) {
62,720✔
819
  CHECK_PTR(fp_tmq_get_topic_name);
62,720✔
820
  return (*fp_tmq_get_topic_name)(res);
62,720✔
821
}
822

823
const char *tmq_get_db_name(TAOS_RES *res) {
59,355✔
824
  CHECK_PTR(fp_tmq_get_db_name);
59,355✔
825
  return (*fp_tmq_get_db_name)(res);
59,355✔
826
}
827

828
int32_t tmq_get_vgroup_id(TAOS_RES *res) {
62,720✔
829
  CHECK_INT(fp_tmq_get_vgroup_id);
62,720✔
830
  return (*fp_tmq_get_vgroup_id)(res);
62,720✔
831
}
832

833
int64_t tmq_get_vgroup_offset(TAOS_RES *res) {
198,776✔
834
  CHECK_INT(fp_tmq_get_vgroup_offset);
198,776✔
835
  return (*fp_tmq_get_vgroup_offset)(res);
198,776✔
836
}
837

838
const char *tmq_err2str(int32_t code) {
3,272✔
839
  CHECK_PTR(fp_tmq_err2str);
3,272✔
840
  return (*fp_tmq_err2str)(code);
3,272✔
841
}
842

843
int32_t tmq_get_raw(TAOS_RES *res, tmq_raw_data *raw) {
1,325✔
844
  CHECK_INT(fp_tmq_get_raw);
1,325✔
845
  return (*fp_tmq_get_raw)(res, raw);
1,325✔
846
}
847

848
int32_t tmq_write_raw(TAOS *taos, tmq_raw_data raw) {
×
849
  CHECK_INT(fp_tmq_write_raw);
×
850
  return (*fp_tmq_write_raw)(taos, raw);
×
851
}
852

853
int taos_write_raw_block(TAOS *taos, int numOfRows, char *pData, const char *tbname) {
×
854
  CHECK_INT(fp_taos_write_raw_block);
×
855
  return (*fp_taos_write_raw_block)(taos, numOfRows, pData, tbname);
×
856
}
857

858
int taos_write_raw_block_with_reqid(TAOS *taos, int numOfRows, char *pData, const char *tbname, int64_t reqid) {
×
859
  CHECK_INT(fp_taos_write_raw_block_with_reqid);
×
860
  return (*fp_taos_write_raw_block_with_reqid)(taos, numOfRows, pData, tbname, reqid);
×
861
}
862

863
int taos_write_raw_block_with_fields(TAOS *taos, int rows, char *pData, const char *tbname, TAOS_FIELD *fields,
×
864
                                     int numFields) {
865
  CHECK_INT(fp_taos_write_raw_block_with_fields);
×
866
  return (*fp_taos_write_raw_block_with_fields)(taos, rows, pData, tbname, fields, numFields);
×
867
}
868

869
int taos_write_raw_block_with_fields_with_reqid(TAOS *taos, int rows, char *pData, const char *tbname,
×
870
                                                TAOS_FIELD *fields, int numFields, int64_t reqid) {
871
  CHECK_INT(fp_taos_write_raw_block_with_fields_with_reqid);
×
872
  return (*fp_taos_write_raw_block_with_fields_with_reqid)(taos, rows, pData, tbname, fields, numFields, reqid);
×
873
}
874

875
void tmq_free_raw(tmq_raw_data raw) {
×
876
  CHECK_VOID(fp_tmq_free_raw);
×
877
  (*fp_tmq_free_raw)(raw);
×
878
}
879

880
char *tmq_get_json_meta(TAOS_RES *res) {
294✔
881
  CHECK_PTR(fp_tmq_get_json_meta);
294✔
882
  return (*fp_tmq_get_json_meta)(res);
294✔
883
}
884

885
void tmq_free_json_meta(char *jsonMeta) {
294✔
886
  CHECK_VOID(fp_tmq_free_json_meta);
294✔
887
  return (*fp_tmq_free_json_meta)(jsonMeta);
294✔
888
}
889

890
TSDB_SERVER_STATUS taos_check_server_status(const char *fqdn, int port, char *details, int maxlen) {
1,156✔
891
  CHECK_INT(fp_taos_check_server_status);
1,156✔
892
  return (*fp_taos_check_server_status)(fqdn, port, details, maxlen);
1,156✔
893
}
894

895
void taos_write_crashinfo(int signum, void *sigInfo, void *context) {
×
896
  (void)taos_init();
×
897
  CHECK_VOID(fp_taos_write_crashinfo);
×
898
  (*fp_taos_write_crashinfo)(signum, sigInfo, context);
×
899
}
900

901
char *getBuildInfo() {
×
902
  (void)taos_init();
×
903
  CHECK_PTR(fp_getBuildInfo);
×
904
  return (*fp_getBuildInfo)();
×
905
}
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