more alter table
This commit is contained in:
parent
6454a205a8
commit
9040eabe45
|
@ -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
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// tDecoderClear(&dc);
|
if (pColumn == NULL) {
|
||||||
|
terrno = TSDB_CODE_VND_TABLE_COL_NOT_EXISTS;
|
||||||
|
goto _err;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// TODO:
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
Loading…
Reference in New Issue