diff --git a/source/dnode/vnode/src/meta/metaEntry.c b/source/dnode/vnode/src/meta/metaEntry.c index 49f9dfa85a..7ec73a6abb 100644 --- a/source/dnode/vnode/src/meta/metaEntry.c +++ b/source/dnode/vnode/src/meta/metaEntry.c @@ -71,7 +71,7 @@ int metaEncodeEntry(SEncoder *pCoder, const SMetaEntry *pME) { TAOS_CHECK_RETURN(tEncodeI8(pCoder, pME->type)); TAOS_CHECK_RETURN(tEncodeI64(pCoder, pME->uid)); - if (pME->type < 0) { + if (pME->type > 0) { if (pME->name == NULL) { return TSDB_CODE_INVALID_PARA; } @@ -121,7 +121,8 @@ int metaDecodeEntry(SDecoder *pCoder, SMetaEntry *pME) { TAOS_CHECK_RETURN(tDecodeI64(pCoder, &pME->version)); TAOS_CHECK_RETURN(tDecodeI8(pCoder, &pME->type)); TAOS_CHECK_RETURN(tDecodeI64(pCoder, &pME->uid)); - if (pME->type < 0) { + + if (pME->type > 0) { TAOS_CHECK_RETURN(tDecodeCStr(pCoder, &pME->name)); if (pME->type == TSDB_SUPER_TABLE) { diff --git a/source/dnode/vnode/src/meta/metaEntry2.c b/source/dnode/vnode/src/meta/metaEntry2.c index 46117f19d9..a369afaad1 100644 --- a/source/dnode/vnode/src/meta/metaEntry2.c +++ b/source/dnode/vnode/src/meta/metaEntry2.c @@ -98,6 +98,12 @@ static int32_t metaSchemaTableInsert(SMeta *pMeta, const SMetaEntry *pEntry) { return code; } + value = taosMemoryMalloc(valueSize); + if (NULL == value) { + metaErr(vgId, terrno); + return terrno; + } + tEncoderInit(&encoder, value, valueSize); code = tEncodeSSchemaWrapper(&encoder, pSchema); if (TSDB_CODE_SUCCESS != code) {