Merge pull request #3087 from taosdata/feature/2.0tsdb

Feature/2.0tsdb
This commit is contained in:
Shengliang Guan 2020-08-16 19:55:51 +08:00 committed by GitHub
commit 95997086ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 13 deletions

View File

@ -246,22 +246,22 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_
}
}
strcpy(name, fname + prefixLen);
} else { // get the named file at the specified index. If not there, return 0
if (*index == TSDB_META_FILE_INDEX) { // get meta file
fname = malloc(prefixLen + strlen(name) + 2);
sprintf(fname, "%s/%s", prefix, name);
tsdbGetStoreInfo(fname, &magic, size);
} else { // get the named file at the specified index. If not there, return 0
fname = malloc(prefixLen + strlen(name) + 2);
sprintf(fname, "%s/%s", prefix, name);
if (access(fname, F_OK) != 0) {
taosFree(fname);
taosFree(sdup);
return magic;
} else {
fname = malloc(prefixLen + strlen(name) + 2);
sprintf(fname, "%s/%s", prefix, name);
tsdbGetFileInfoImpl(fname, &magic, size);
taosFree(fname);
taosFree(sdup);
return magic;
return 0;
}
if (*index == TSDB_META_FILE_INDEX) { // get meta file
tsdbGetStoreInfo(fname, &magic, size);
} else {
tsdbGetFileInfoImpl(fname, &magic, size);
}
taosFree(fname);
taosFree(sdup);
return magic;
}
if (stat(fname, &fState) < 0) {