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

taosdata / TDengine / #3653

14 Mar 2025 08:10AM UTC coverage: 22.565% (-41.0%) from 63.596%
#3653

push

travis-ci

web-flow
feat(keep): support keep on super table level. (#30097)

* Feat: support use keep while create super table.

* Test(keep): add test for create super table with keep option.

* Feat(keep): Add tmsg for create keep.

* Feat(keep): support alter table option keep.

* Fix(keep): Add baisc test for alter table option.

* Fix(keep): memory leek.

* Feat(keep): add keep to metaEntry&metaCache and fix earliestTs with stn keep.

* Test(keep): add some cases for select with stb keep.

* Fix: fix ci core while alter stb.

* Feat(keep): delete expired data in super table level.

* Feat: remove get stb keep while query.

* Fix : build error.

* Revert "Fix : build error."

This reverts commit 0ed66e4e8.

* Revert "Feat(keep): delete expired data in super table level."

This reverts commit 36330f6b4.

* Fix : build errors.

* Feat : support restart taosd.

* Fix : alter table comment problems.

* Test : add tests for super table keep.

* Fix: change sdb stb reserve size.

* Test: add more tests.

* Feat: Disable normal tables and sub tables from setting the keep parameter

* Fix: add more checks to avoid unknown address.

* Docs: Add docs for stable keep.

* Fix: some review changes.

* Fix: review errors.

49248 of 302527 branches covered (16.28%)

Branch coverage included in aggregate %.

53 of 99 new or added lines in 12 files covered. (53.54%)

155872 existing lines in 443 files now uncovered.

87359 of 302857 relevant lines covered (28.84%)

570004.22 hits per line

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

35.44
/source/dnode/vnode/src/meta/metaEntry.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 "meta.h"
17

18
int meteEncodeColCmprEntry(SEncoder *pCoder, const SMetaEntry *pME) {
68✔
19
  const SColCmprWrapper *pw = &pME->colCmpr;
68✔
20
  TAOS_CHECK_RETURN(tEncodeI32v(pCoder, pw->nCols));
136!
21
  TAOS_CHECK_RETURN(tEncodeI32v(pCoder, pw->version));
136!
22
  uDebug("encode cols:%d", pw->nCols);
68!
23

24
  for (int32_t i = 0; i < pw->nCols; i++) {
216✔
25
    SColCmpr *p = &pw->pColCmpr[i];
148✔
26
    TAOS_CHECK_RETURN(tEncodeI16v(pCoder, p->id));
296!
27
    TAOS_CHECK_RETURN(tEncodeU32(pCoder, p->alg));
296!
28
  }
29
  return 0;
68✔
30
}
31
int meteDecodeColCmprEntry(SDecoder *pDecoder, SMetaEntry *pME) {
52✔
32
  SColCmprWrapper *pWrapper = &pME->colCmpr;
52✔
33
  TAOS_CHECK_RETURN(tDecodeI32v(pDecoder, &pWrapper->nCols));
104!
34
  if (pWrapper->nCols == 0) {
52!
35
    return 0;
×
36
  }
37

38
  TAOS_CHECK_RETURN(tDecodeI32v(pDecoder, &pWrapper->version));
104!
39
  uDebug("dencode cols:%d", pWrapper->nCols);
52!
40
  pWrapper->pColCmpr = (SColCmpr *)tDecoderMalloc(pDecoder, pWrapper->nCols * sizeof(SColCmpr));
52!
41
  if (pWrapper->pColCmpr == NULL) {
52!
42
    return terrno;
×
43
  }
44

45
  for (int i = 0; i < pWrapper->nCols; i++) {
170✔
46
    SColCmpr *p = &pWrapper->pColCmpr[i];
118✔
47
    TAOS_CHECK_RETURN(tDecodeI16v(pDecoder, &p->id));
236!
48
    TAOS_CHECK_RETURN(tDecodeU32(pDecoder, &p->alg));
236!
49
  }
50
  return 0;
52✔
51
}
52
static FORCE_INLINE int32_t metatInitDefaultSColCmprWrapper(SDecoder *pDecoder, SColCmprWrapper *pCmpr,
53
                                                            SSchemaWrapper *pSchema) {
54
  pCmpr->nCols = pSchema->nCols;
×
UNCOV
55
  if ((pCmpr->pColCmpr = (SColCmpr *)tDecoderMalloc(pDecoder, pCmpr->nCols * sizeof(SColCmpr))) == NULL) {
×
56
    return terrno;
×
57
  }
58

UNCOV
59
  for (int32_t i = 0; i < pCmpr->nCols; i++) {
×
UNCOV
60
    SColCmpr *pColCmpr = &pCmpr->pColCmpr[i];
×
UNCOV
61
    SSchema  *pColSchema = &pSchema->pSchema[i];
×
UNCOV
62
    pColCmpr->id = pColSchema->colId;
×
UNCOV
63
    pColCmpr->alg = createDefaultColCmprByType(pColSchema->type);
×
64
  }
UNCOV
65
  return 0;
×
66
}
67

68
static int32_t metaCloneColCmpr(const SColCmprWrapper *pSrc, SColCmprWrapper *pDst) {
36✔
69
  if (pSrc->nCols > 0) {
36!
70
    pDst->nCols = pSrc->nCols;
36✔
71
    pDst->version = pSrc->version;
36✔
72
    pDst->pColCmpr = (SColCmpr *)taosMemoryCalloc(pSrc->nCols, sizeof(SColCmpr));
36!
73
    if (NULL == pDst->pColCmpr) {
36!
74
      return terrno;
×
75
    }
76
    memcpy(pDst->pColCmpr, pSrc->pColCmpr, pSrc->nCols * sizeof(SColCmpr));
36✔
77
  }
78
  return 0;
36✔
79
}
80

81
static void metaCloneColCmprFree(SColCmprWrapper *pCmpr) {
36✔
82
  if (pCmpr) {
36!
83
    taosMemoryFreeClear(pCmpr->pColCmpr);
36!
84
  }
85
}
36✔
86

87
int metaEncodeEntry(SEncoder *pCoder, const SMetaEntry *pME) {
76✔
88
  TAOS_CHECK_RETURN(tStartEncode(pCoder));
76!
89
  TAOS_CHECK_RETURN(tEncodeI64(pCoder, pME->version));
152!
90
  TAOS_CHECK_RETURN(tEncodeI8(pCoder, pME->type));
152!
91
  TAOS_CHECK_RETURN(tEncodeI64(pCoder, pME->uid));
152!
92

93
  if (pME->type > 0) {
76✔
94
    if (pME->name == NULL) {
68!
95
      return TSDB_CODE_INVALID_PARA;
×
96
    }
97

98
    TAOS_CHECK_RETURN(tEncodeCStr(pCoder, pME->name));
136!
99

100
    if (pME->type == TSDB_SUPER_TABLE) {
68!
101
      TAOS_CHECK_RETURN(tEncodeI8(pCoder, pME->flags));
136!
102
      TAOS_CHECK_RETURN(tEncodeSSchemaWrapper(pCoder, &pME->stbEntry.schemaRow));
136!
103
      TAOS_CHECK_RETURN(tEncodeSSchemaWrapper(pCoder, &pME->stbEntry.schemaTag));
136!
104
      if (TABLE_IS_ROLLUP(pME->flags)) {
68!
UNCOV
105
        TAOS_CHECK_RETURN(tEncodeSRSmaParam(pCoder, &pME->stbEntry.rsmaParam));
×
106
      }
UNCOV
107
    } else if (pME->type == TSDB_CHILD_TABLE) {
×
UNCOV
108
      TAOS_CHECK_RETURN(tEncodeI64(pCoder, pME->ctbEntry.btime));
×
UNCOV
109
      TAOS_CHECK_RETURN(tEncodeI32(pCoder, pME->ctbEntry.ttlDays));
×
UNCOV
110
      TAOS_CHECK_RETURN(tEncodeI32v(pCoder, pME->ctbEntry.commentLen));
×
UNCOV
111
      if (pME->ctbEntry.commentLen > 0) {
×
UNCOV
112
        TAOS_CHECK_RETURN(tEncodeCStr(pCoder, pME->ctbEntry.comment));
×
113
      }
UNCOV
114
      TAOS_CHECK_RETURN(tEncodeI64(pCoder, pME->ctbEntry.suid));
×
UNCOV
115
      TAOS_CHECK_RETURN(tEncodeTag(pCoder, (const STag *)pME->ctbEntry.pTags));
×
UNCOV
116
    } else if (pME->type == TSDB_NORMAL_TABLE) {
×
UNCOV
117
      TAOS_CHECK_RETURN(tEncodeI64(pCoder, pME->ntbEntry.btime));
×
UNCOV
118
      TAOS_CHECK_RETURN(tEncodeI32(pCoder, pME->ntbEntry.ttlDays));
×
UNCOV
119
      TAOS_CHECK_RETURN(tEncodeI32v(pCoder, pME->ntbEntry.commentLen));
×
UNCOV
120
      if (pME->ntbEntry.commentLen > 0) {
×
UNCOV
121
        TAOS_CHECK_RETURN(tEncodeCStr(pCoder, pME->ntbEntry.comment));
×
122
      }
UNCOV
123
      TAOS_CHECK_RETURN(tEncodeI32v(pCoder, pME->ntbEntry.ncid));
×
UNCOV
124
      TAOS_CHECK_RETURN(tEncodeSSchemaWrapper(pCoder, &pME->ntbEntry.schemaRow));
×
UNCOV
125
    } else if (pME->type == TSDB_TSMA_TABLE) {
×
UNCOV
126
      TAOS_CHECK_RETURN(tEncodeTSma(pCoder, pME->smaEntry.tsma));
×
127
    } else {
UNCOV
128
      metaError("meta/entry: invalide table type: %" PRId8 " encode failed.", pME->type);
×
129
      return TSDB_CODE_INVALID_PARA;
×
130
    }
131
    TAOS_CHECK_RETURN(meteEncodeColCmprEntry(pCoder, pME));
68!
132
  }
133
  if (pME->type == TSDB_SUPER_TABLE) {
76✔
134
    TAOS_CHECK_RETURN(tEncodeI64(pCoder, pME->stbEntry.keep));
136!
135
  }
136

137
  tEndEncode(pCoder);
76✔
138
  return 0;
76✔
139
}
140

141
int metaDecodeEntryImpl(SDecoder *pCoder, SMetaEntry *pME, bool headerOnly) {
52✔
142
  TAOS_CHECK_RETURN(tStartDecode(pCoder));
52!
143
  TAOS_CHECK_RETURN(tDecodeI64(pCoder, &pME->version));
104!
144
  TAOS_CHECK_RETURN(tDecodeI8(pCoder, &pME->type));
104!
145
  TAOS_CHECK_RETURN(tDecodeI64(pCoder, &pME->uid));
104!
146

147
  if (headerOnly) {
52!
UNCOV
148
    tEndDecode(pCoder);
×
UNCOV
149
    return 0;
×
150
  }
151

152
  if (pME->type > 0) {
52!
153
    TAOS_CHECK_RETURN(tDecodeCStr(pCoder, &pME->name));
104!
154

155
    if (pME->type == TSDB_SUPER_TABLE) {
52!
156
      TAOS_CHECK_RETURN(tDecodeI8(pCoder, &pME->flags));
104!
157
      TAOS_CHECK_RETURN(tDecodeSSchemaWrapperEx(pCoder, &pME->stbEntry.schemaRow));
104!
158
      TAOS_CHECK_RETURN(tDecodeSSchemaWrapperEx(pCoder, &pME->stbEntry.schemaTag));
104!
159
      if (TABLE_IS_ROLLUP(pME->flags)) {
52!
UNCOV
160
        TAOS_CHECK_RETURN(tDecodeSRSmaParam(pCoder, &pME->stbEntry.rsmaParam));
×
161
      }
UNCOV
162
    } else if (pME->type == TSDB_CHILD_TABLE) {
×
UNCOV
163
      TAOS_CHECK_RETURN(tDecodeI64(pCoder, &pME->ctbEntry.btime));
×
UNCOV
164
      TAOS_CHECK_RETURN(tDecodeI32(pCoder, &pME->ctbEntry.ttlDays));
×
UNCOV
165
      TAOS_CHECK_RETURN(tDecodeI32v(pCoder, &pME->ctbEntry.commentLen));
×
UNCOV
166
      if (pME->ctbEntry.commentLen > 0) {
×
UNCOV
167
        TAOS_CHECK_RETURN(tDecodeCStr(pCoder, &pME->ctbEntry.comment));
×
168
      }
UNCOV
169
      TAOS_CHECK_RETURN(tDecodeI64(pCoder, &pME->ctbEntry.suid));
×
UNCOV
170
      TAOS_CHECK_RETURN(tDecodeTag(pCoder, (STag **)&pME->ctbEntry.pTags));
×
UNCOV
171
    } else if (pME->type == TSDB_NORMAL_TABLE) {
×
UNCOV
172
      TAOS_CHECK_RETURN(tDecodeI64(pCoder, &pME->ntbEntry.btime));
×
UNCOV
173
      TAOS_CHECK_RETURN(tDecodeI32(pCoder, &pME->ntbEntry.ttlDays));
×
UNCOV
174
      TAOS_CHECK_RETURN(tDecodeI32v(pCoder, &pME->ntbEntry.commentLen));
×
UNCOV
175
      if (pME->ntbEntry.commentLen > 0) {
×
UNCOV
176
        TAOS_CHECK_RETURN(tDecodeCStr(pCoder, &pME->ntbEntry.comment));
×
177
      }
UNCOV
178
      TAOS_CHECK_RETURN(tDecodeI32v(pCoder, &pME->ntbEntry.ncid));
×
UNCOV
179
      TAOS_CHECK_RETURN(tDecodeSSchemaWrapperEx(pCoder, &pME->ntbEntry.schemaRow));
×
180
    } else if (pME->type == TSDB_TSMA_TABLE) {
×
UNCOV
181
      pME->smaEntry.tsma = tDecoderMalloc(pCoder, sizeof(STSma));
×
UNCOV
182
      if (!pME->smaEntry.tsma) {
×
183
        return terrno;
×
184
      }
UNCOV
185
      TAOS_CHECK_RETURN(tDecodeTSma(pCoder, pME->smaEntry.tsma, true));
×
186
    } else {
187
      metaError("meta/entry: invalide table type: %" PRId8 " decode failed.", pME->type);
×
188
      return TSDB_CODE_INVALID_PARA;
×
189
    }
190
    if (pME->type == TSDB_SUPER_TABLE) {
52!
191
      if (TABLE_IS_COL_COMPRESSED(pME->flags)) {
52!
192
        TAOS_CHECK_RETURN(meteDecodeColCmprEntry(pCoder, pME));
52!
193

194
        if (pME->colCmpr.nCols == 0) {
52!
195
          TAOS_CHECK_RETURN(metatInitDefaultSColCmprWrapper(pCoder, &pME->colCmpr, &pME->stbEntry.schemaRow));
×
196
        }
197
      } else {
198
        TAOS_CHECK_RETURN(metatInitDefaultSColCmprWrapper(pCoder, &pME->colCmpr, &pME->stbEntry.schemaRow));
×
UNCOV
199
        TABLE_SET_COL_COMPRESSED(pME->flags);
×
200
      }
UNCOV
201
    } else if (pME->type == TSDB_NORMAL_TABLE) {
×
UNCOV
202
      if (!tDecodeIsEnd(pCoder)) {
×
UNCOV
203
        uDebug("set type: %d, tableName:%s", pME->type, pME->name);
×
UNCOV
204
        TAOS_CHECK_RETURN(meteDecodeColCmprEntry(pCoder, pME));
×
UNCOV
205
        if (pME->colCmpr.nCols == 0) {
×
206
          TAOS_CHECK_RETURN(metatInitDefaultSColCmprWrapper(pCoder, &pME->colCmpr, &pME->ntbEntry.schemaRow));
×
207
        }
208
      } else {
209
        uDebug("set default type: %d, tableName:%s", pME->type, pME->name);
×
210
        TAOS_CHECK_RETURN(metatInitDefaultSColCmprWrapper(pCoder, &pME->colCmpr, &pME->ntbEntry.schemaRow));
×
211
      }
UNCOV
212
      TABLE_SET_COL_COMPRESSED(pME->flags);
×
213
    }
214
  }
215
  if (pME->type == TSDB_SUPER_TABLE) {
52!
216
    if (!tDecodeIsEnd(pCoder)) {
52!
217
      TAOS_CHECK_RETURN(tDecodeI64(pCoder, &pME->stbEntry.keep));
104!
218
    }
219
  }
220

221
  tEndDecode(pCoder);
52✔
222
  return 0;
52✔
223
}
224

225
int metaDecodeEntry(SDecoder *pCoder, SMetaEntry *pME) { return metaDecodeEntryImpl(pCoder, pME, false); }
52✔
226

227
static int32_t metaCloneSchema(const SSchemaWrapper *pSrc, SSchemaWrapper *pDst) {
72✔
228
  if (pSrc == NULL || pDst == NULL) {
72!
229
    return TSDB_CODE_INVALID_PARA;
×
230
  }
231

232
  pDst->nCols = pSrc->nCols;
72✔
233
  pDst->version = pSrc->version;
72✔
234
  pDst->pSchema = (SSchema *)taosMemoryMalloc(pSrc->nCols * sizeof(SSchema));
72!
235
  if (pDst->pSchema == NULL) {
72!
236
    return terrno;
×
237
  }
238
  memcpy(pDst->pSchema, pSrc->pSchema, pSrc->nCols * sizeof(SSchema));
72✔
239
  return TSDB_CODE_SUCCESS;
72✔
240
}
241

242
static void metaCloneSchemaFree(SSchemaWrapper *pSchema) {
72✔
243
  if (pSchema) {
72!
244
    taosMemoryFreeClear(pSchema->pSchema);
72!
245
  }
246
}
72✔
247

248
void metaCloneEntryFree(SMetaEntry **ppEntry) {
36✔
249
  if (ppEntry == NULL || *ppEntry == NULL) {
36!
250
    return;
×
251
  }
252

253
  taosMemoryFreeClear((*ppEntry)->name);
36!
254

255
  if ((*ppEntry)->type < 0) {
36!
256
    taosMemoryFreeClear(*ppEntry);
×
257
    return;
×
258
  }
259

260
  if (TSDB_SUPER_TABLE == (*ppEntry)->type) {
36!
261
    metaCloneSchemaFree(&(*ppEntry)->stbEntry.schemaRow);
36✔
262
    metaCloneSchemaFree(&(*ppEntry)->stbEntry.schemaTag);
36✔
UNCOV
263
  } else if (TSDB_CHILD_TABLE == (*ppEntry)->type) {
×
UNCOV
264
    taosMemoryFreeClear((*ppEntry)->ctbEntry.comment);
×
UNCOV
265
    taosMemoryFreeClear((*ppEntry)->ctbEntry.pTags);
×
UNCOV
266
  } else if (TSDB_NORMAL_TABLE == (*ppEntry)->type) {
×
UNCOV
267
    metaCloneSchemaFree(&(*ppEntry)->ntbEntry.schemaRow);
×
UNCOV
268
    taosMemoryFreeClear((*ppEntry)->ntbEntry.comment);
×
269
  } else {
270
    return;
×
271
  }
272
  metaCloneColCmprFree(&(*ppEntry)->colCmpr);
36✔
273

274
  taosMemoryFreeClear(*ppEntry);
36!
275
  return;
36✔
276
}
277

278
int32_t metaCloneEntry(const SMetaEntry *pEntry, SMetaEntry **ppEntry) {
36✔
279
  int32_t code = TSDB_CODE_SUCCESS;
36✔
280

281
  if (NULL == pEntry || NULL == ppEntry) {
36!
282
    return TSDB_CODE_INVALID_PARA;
×
283
  }
284

285
  *ppEntry = (SMetaEntry *)taosMemoryCalloc(1, sizeof(SMetaEntry));
36!
286
  if (NULL == *ppEntry) {
36!
287
    return terrno;
×
288
  }
289

290
  (*ppEntry)->version = pEntry->version;
36✔
291
  (*ppEntry)->type = pEntry->type;
36✔
292
  (*ppEntry)->uid = pEntry->uid;
36✔
293

294
  if (pEntry->type < 0) {
36!
295
    return TSDB_CODE_SUCCESS;
×
296
  }
297

298
  if (pEntry->name) {
36!
299
    (*ppEntry)->name = tstrdup(pEntry->name);
36✔
300
    if (NULL == (*ppEntry)->name) {
36!
301
      code = terrno;
×
302
      metaCloneEntryFree(ppEntry);
×
303
      return code;
×
304
    }
305
  }
306

307
  if (pEntry->type == TSDB_SUPER_TABLE) {
36!
308
    (*ppEntry)->flags = pEntry->flags;
36✔
309

310
    code = metaCloneSchema(&pEntry->stbEntry.schemaRow, &(*ppEntry)->stbEntry.schemaRow);
36✔
311
    if (code) {
36!
312
      metaCloneEntryFree(ppEntry);
×
313
      return code;
×
314
    }
315

316
    code = metaCloneSchema(&pEntry->stbEntry.schemaTag, &(*ppEntry)->stbEntry.schemaTag);
36✔
317
    if (code) {
36!
318
      metaCloneEntryFree(ppEntry);
×
319
      return code;
×
320
    }
321
    (*ppEntry)->stbEntry.keep = pEntry->stbEntry.keep;
36✔
UNCOV
322
  } else if (pEntry->type == TSDB_CHILD_TABLE) {
×
UNCOV
323
    (*ppEntry)->ctbEntry.btime = pEntry->ctbEntry.btime;
×
UNCOV
324
    (*ppEntry)->ctbEntry.ttlDays = pEntry->ctbEntry.ttlDays;
×
UNCOV
325
    (*ppEntry)->ctbEntry.suid = pEntry->ctbEntry.suid;
×
326

327
    // comment
UNCOV
328
    (*ppEntry)->ctbEntry.commentLen = pEntry->ctbEntry.commentLen;
×
UNCOV
329
    if (pEntry->ctbEntry.commentLen > 0) {
×
UNCOV
330
      (*ppEntry)->ctbEntry.comment = taosMemoryMalloc(pEntry->ctbEntry.commentLen + 1);
×
UNCOV
331
      if (NULL == (*ppEntry)->ctbEntry.comment) {
×
332
        code = terrno;
×
333
        metaCloneEntryFree(ppEntry);
×
334
        return code;
×
335
      }
UNCOV
336
      memcpy((*ppEntry)->ctbEntry.comment, pEntry->ctbEntry.comment, pEntry->ctbEntry.commentLen + 1);
×
337
    }
338

339
    // tags
UNCOV
340
    STag *pTags = (STag *)pEntry->ctbEntry.pTags;
×
UNCOV
341
    (*ppEntry)->ctbEntry.pTags = taosMemoryCalloc(1, pTags->len);
×
UNCOV
342
    if (NULL == (*ppEntry)->ctbEntry.pTags) {
×
343
      code = terrno;
×
344
      metaCloneEntryFree(ppEntry);
×
345
      return code;
×
346
    }
UNCOV
347
    memcpy((*ppEntry)->ctbEntry.pTags, pEntry->ctbEntry.pTags, pTags->len);
×
UNCOV
348
  } else if (pEntry->type == TSDB_NORMAL_TABLE) {
×
UNCOV
349
    (*ppEntry)->ntbEntry.btime = pEntry->ntbEntry.btime;
×
UNCOV
350
    (*ppEntry)->ntbEntry.ttlDays = pEntry->ntbEntry.ttlDays;
×
UNCOV
351
    (*ppEntry)->ntbEntry.ncid = pEntry->ntbEntry.ncid;
×
352

353
    // schema
UNCOV
354
    code = metaCloneSchema(&pEntry->ntbEntry.schemaRow, &(*ppEntry)->ntbEntry.schemaRow);
×
UNCOV
355
    if (code) {
×
356
      metaCloneEntryFree(ppEntry);
×
357
      return code;
×
358
    }
359

360
    // comment
UNCOV
361
    (*ppEntry)->ntbEntry.commentLen = pEntry->ntbEntry.commentLen;
×
UNCOV
362
    if (pEntry->ntbEntry.commentLen > 0) {
×
UNCOV
363
      (*ppEntry)->ntbEntry.comment = taosMemoryMalloc(pEntry->ntbEntry.commentLen + 1);
×
UNCOV
364
      if (NULL == (*ppEntry)->ntbEntry.comment) {
×
365
        code = terrno;
×
366
        metaCloneEntryFree(ppEntry);
×
367
        return code;
×
368
      }
UNCOV
369
      memcpy((*ppEntry)->ntbEntry.comment, pEntry->ntbEntry.comment, pEntry->ntbEntry.commentLen + 1);
×
370
    }
371
  } else {
372
    return TSDB_CODE_INVALID_PARA;
×
373
  }
374

375
  code = metaCloneColCmpr(&pEntry->colCmpr, &(*ppEntry)->colCmpr);
36✔
376
  if (code) {
36!
UNCOV
377
    metaCloneEntryFree(ppEntry);
×
378
    return code;
×
379
  }
380

381
  return code;
36✔
382
}
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