update tindex reader
This commit is contained in:
parent
c03e267619
commit
6e7df831ce
|
@ -386,16 +386,19 @@ static int tfileReadLoadFst(TFileReader* reader) {
|
||||||
static int tfileReadLoadTableIds(TFileReader* reader, int32_t offset, SArray* result) {
|
static int tfileReadLoadTableIds(TFileReader* reader, int32_t offset, SArray* result) {
|
||||||
int32_t nid;
|
int32_t nid;
|
||||||
WriterCtx* ctx = reader->ctx;
|
WriterCtx* ctx = reader->ctx;
|
||||||
int32_t nread = ctx->readFrom(ctx, (char*)&nid, sizeof(nid), offset);
|
|
||||||
|
int32_t nread = ctx->readFrom(ctx, (char*)&nid, sizeof(nid), offset);
|
||||||
assert(sizeof(nid) == nread);
|
assert(sizeof(nid) == nread);
|
||||||
|
|
||||||
char* buf = calloc(1, sizeof(uint64_t) * nid);
|
int32_t total = sizeof(uint64_t) * nid;
|
||||||
|
char* buf = calloc(1, total);
|
||||||
if (buf == NULL) { return -1; }
|
if (buf == NULL) { return -1; }
|
||||||
|
|
||||||
nread = ctx->read(ctx, buf, sizeof(uint64_t) * nid);
|
nread = ctx->read(ctx, buf, total);
|
||||||
uint64_t* ids = (uint64_t*)buf;
|
assert(total == nread);
|
||||||
|
|
||||||
for (int32_t i = 0; i < nid; i++) {
|
for (int32_t i = 0; i < nid; i++) {
|
||||||
taosArrayPush(result, ids + i);
|
taosArrayPush(result, (uint64_t*)buf + i);
|
||||||
}
|
}
|
||||||
free(buf);
|
free(buf);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue