提交 7ae3eebe 编写于 作者: H hzcheng

Fix fetch table segmentation fault

上级 192e33db
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册