TD-545
This commit is contained in:
parent
b56bac84e8
commit
aab502f271
|
@ -74,14 +74,16 @@ void tsdbEncodeTable(STable *pTable, char *buf, int *contLen) {
|
||||||
STable *tsdbDecodeTable(void *cont, int contLen) {
|
STable *tsdbDecodeTable(void *cont, int contLen) {
|
||||||
STable *pTable = (STable *)calloc(1, sizeof(STable));
|
STable *pTable = (STable *)calloc(1, sizeof(STable));
|
||||||
if (pTable == NULL) return NULL;
|
if (pTable == NULL) return NULL;
|
||||||
pTable->schema = (STSchema **)malloc(sizeof(STSchema *) * TSDB_MAX_TABLE_SCHEMAS);
|
|
||||||
if (pTable->schema == NULL) {
|
|
||||||
free(pTable);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *ptr = cont;
|
void *ptr = cont;
|
||||||
T_READ_MEMBER(ptr, int8_t, pTable->type);
|
T_READ_MEMBER(ptr, int8_t, pTable->type);
|
||||||
|
if (pTable->type != TSDB_CHILD_TABLE) {
|
||||||
|
pTable->schema = (STSchema **)malloc(sizeof(STSchema *) * TSDB_MAX_TABLE_SCHEMAS);
|
||||||
|
if (pTable->schema == NULL) {
|
||||||
|
free(pTable);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
int len = *(int *)ptr;
|
int len = *(int *)ptr;
|
||||||
ptr = (char *)ptr + sizeof(int);
|
ptr = (char *)ptr + sizeof(int);
|
||||||
pTable->name = calloc(1, len + VARSTR_HEADER_SIZE + 1);
|
pTable->name = calloc(1, len + VARSTR_HEADER_SIZE + 1);
|
||||||
|
|
Loading…
Reference in New Issue