Fix fetch table segmentation fault
This commit is contained in:
parent
192e33db38
commit
7ae3eebe06
|
@ -206,8 +206,11 @@ static int32_t tsdbCheckTableCfg(STableCfg *pCfg) {
|
|||
}
|
||||
|
||||
STable *tsdbGetTableByUid(STsdbMeta *pMeta, int64_t uid) {
|
||||
STable *pTable = *(STable **)taosGetDataFromHashTable(pMeta->tableMap, (char *)(&uid), sizeof(uid));
|
||||
return pTable;
|
||||
void *ptr = taosGetDataFromHashTable(pMeta->tableMap, (char *)(&uid), sizeof(uid));
|
||||
|
||||
if (ptr == NULL) return NULL;
|
||||
|
||||
return *(STable **)ptr;
|
||||
}
|
||||
|
||||
static int tsdbAddTableToMeta(STsdbMeta *pMeta, STable *pTable) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "tsdb.h"
|
||||
#include "tsdbMeta.h"
|
||||
|
||||
TEST(TsdbTest, DISABLED_createTable) {
|
||||
TEST(TsdbTest, createTable) {
|
||||
STsdbMeta *pMeta = tsdbCreateMeta(100);
|
||||
ASSERT_NE(pMeta, nullptr);
|
||||
|
||||
|
|
Loading…
Reference in New Issue