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

taosdata / TDengine / #3796

31 Mar 2025 10:39AM UTC coverage: 30.372% (-7.1%) from 37.443%
#3796

push

travis-ci

happyguoxy
test:add test cases

69287 of 309062 branches covered (22.42%)

Branch coverage included in aggregate %.

118044 of 307720 relevant lines covered (38.36%)

278592.15 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

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

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

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

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

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

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

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

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

51
  pTsdb->mem = pMemTable;
24✔
52

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

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