提交 9040eabe 编写于 作者: H Hongze Cheng

more alter table

上级 6454a205
...@@ -572,30 +572,45 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA ...@@ -572,30 +572,45 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
tDecoderClear(&dc); tDecoderClear(&dc);
/* get stbEntry*/ /* get stbEntry*/
tdbDbGet(pMeta->pUidIdx, &ctbEntry.ctbEntry.suid, sizeof(tb_uid_t), &pVal, &nVal);
tdbDbGet(pMeta->pTbDb, &((STbDbKey){.uid = ctbEntry.ctbEntry.suid, .version = *(int64_t *)pVal}), sizeof(STbDbKey),
(void **)&stbEntry.pBuf, &nVal);
tdbFree(pVal);
tDecoderInit(&dc, stbEntry.pBuf, nVal);
metaDecodeEntry(&dc, &stbEntry);
tDecoderClear(&dc);
{ SSchemaWrapper *pTagSchema = &stbEntry.stbEntry.schemaTag;
// get table entry SColumn *pColumn = NULL;
// SDecoder dc = {0}; int32_t iCol = 0;
// tDecoderInit(&dc, pData, nData); for (;;) {
// metaDecodeEntry(&dc, &ctbEntry); pColumn = NULL;
// if (ctbEntry.type != TSDB_CHILD_TABLE) { if (iCol >= pTagSchema->nCols) break;
// terrno = TSDB_CODE_VND_INVALID_TABLE_ACTION; pColumn = &pTagSchema->pSchema[iCol];
// goto _err;
// }
// // do actual job if (strcmp(pColumn->name, pAlterTbReq->tagName) == 0) break;
// { iCol++;
// // TODO }
// }
if (pColumn == NULL) {
terrno = TSDB_CODE_VND_TABLE_COL_NOT_EXISTS;
goto _err;
}
{
// TODO:
} }
// tDecoderClear(&dc); if (ctbEntry.pBuf) taosMemoryFree(ctbEntry.pBuf);
if (stbEntry.pBuf) tdbFree(stbEntry.pBuf);
tdbDbcClose(pTbDbc); tdbDbcClose(pTbDbc);
tdbDbcClose(pUidIdxc); tdbDbcClose(pUidIdxc);
return 0; return 0;
_err: _err:
if (ctbEntry.pBuf) taosMemoryFree(ctbEntry.pBuf);
if (stbEntry.pBuf) tdbFree(stbEntry.pBuf);
tdbDbcClose(pTbDbc); tdbDbcClose(pTbDbc);
tdbDbcClose(pUidIdxc); tdbDbcClose(pUidIdxc);
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册