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

taosdata / TDengine / #3798

31 Mar 2025 10:39AM UTC coverage: 9.424% (-20.9%) from 30.372%
#3798

push

travis-ci

happyguoxy
test:add test cases

21549 of 307601 branches covered (7.01%)

Branch coverage included in aggregate %.

36084 of 303967 relevant lines covered (11.87%)

58620.7 hits per line

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

0.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) {
×
38
  int32_t code = 0;
×
39
  int32_t lino = 0;
×
40

41
  if (!pTsdb) return code;
×
42

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

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

51
  pTsdb->mem = pMemTable;
×
52

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

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