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

taosdata / TDengine / #3565

25 Dec 2024 05:34AM UTC coverage: 51.098% (-11.1%) from 62.21%
#3565

push

travis-ci

web-flow
Merge pull request #29316 from taosdata/enh/3.0/TD-33266

enh(ut):Add wal & config UT.

111558 of 284773 branches covered (39.17%)

Branch coverage included in aggregate %.

1 of 2 new or added lines in 2 files covered. (50.0%)

39015 existing lines in 102 files now uncovered.

177882 of 281666 relevant lines covered (63.15%)

15090998.35 hits per line

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

32.0
/source/dnode/vnode/src/tsdb/tsdbCommit.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 "tsdb.h"
17

UNCOV
18
int32_t tRowInfoCmprFn(const void *p1, const void *p2) {
×
UNCOV
19
  SRowInfo *pInfo1 = (SRowInfo *)p1;
×
UNCOV
20
  SRowInfo *pInfo2 = (SRowInfo *)p2;
×
21

UNCOV
22
  if (pInfo1->suid < pInfo2->suid) {
×
UNCOV
23
    return -1;
×
UNCOV
24
  } else if (pInfo1->suid > pInfo2->suid) {
×
UNCOV
25
    return 1;
×
26
  }
27

UNCOV
28
  if (pInfo1->uid < pInfo2->uid) {
×
UNCOV
29
    return -1;
×
UNCOV
30
  } else if (pInfo1->uid > pInfo2->uid) {
×
UNCOV
31
    return 1;
×
32
  }
33

UNCOV
34
  return tsdbRowCompare(&pInfo1->row, &pInfo2->row);
×
35
}
36

37
int32_t tsdbBegin(STsdb *pTsdb) {
20✔
38
  int32_t code = 0;
20✔
39
  int32_t lino = 0;
20✔
40

41
  if (!pTsdb) return code;
20!
42

43
  SMemTable *pMemTable;
44
  TAOS_CHECK_GOTO(tsdbMemTableCreate(pTsdb, &pMemTable), &lino, _exit);
20!
45

46
  // lock
47
  if ((code = taosThreadMutexLock(&pTsdb->mutex))) {
20!
48
    TAOS_CHECK_GOTO(TAOS_SYSTEM_ERROR(code), &lino, _exit);
×
49
  }
50

51
  pTsdb->mem = pMemTable;
20✔
52

53
  // unlock
54
  if ((code = taosThreadMutexUnlock(&pTsdb->mutex))) {
20!
55
    TAOS_CHECK_GOTO(TAOS_SYSTEM_ERROR(code), &lino, _exit);
×
56
  }
57

58
_exit:
20✔
59
  if (code) {
20!
60
    tsdbError("vgId:%d, %s failed at %s:%d since %s", TD_VID(pTsdb->pVnode), __func__, __FILE__, lino, tstrerror(code));
×
61
  }
62
  return code;
20✔
63
}
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