fix alter tag
This commit is contained in:
parent
ac169b8d90
commit
d2f57b4ad7
|
@ -793,9 +793,6 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
goto _err;
|
goto _err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iCol == 0) {
|
|
||||||
// TODO : need to update tag index
|
|
||||||
}
|
|
||||||
ctbEntry.version = version;
|
ctbEntry.version = version;
|
||||||
if (pTagSchema->nCols == 1 && pTagSchema->pSchema[0].type == TSDB_DATA_TYPE_JSON) {
|
if (pTagSchema->nCols == 1 && pTagSchema->pSchema[0].type == TSDB_DATA_TYPE_JSON) {
|
||||||
ctbEntry.ctbEntry.pTags = taosMemoryMalloc(pAlterTbReq->nTagVal);
|
ctbEntry.ctbEntry.pTags = taosMemoryMalloc(pAlterTbReq->nTagVal);
|
||||||
|
@ -849,6 +846,10 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
|
||||||
// save to uid.idx
|
// save to uid.idx
|
||||||
tdbTbUpsert(pMeta->pUidIdx, &ctbEntry.uid, sizeof(tb_uid_t), &version, sizeof(version), &pMeta->txn);
|
tdbTbUpsert(pMeta->pUidIdx, &ctbEntry.uid, sizeof(tb_uid_t), &version, sizeof(version), &pMeta->txn);
|
||||||
|
|
||||||
|
if (iCol == 0) {
|
||||||
|
metaUpdateTagIdx(pMeta, &ctbEntry);
|
||||||
|
}
|
||||||
|
|
||||||
tDecoderClear(&dc1);
|
tDecoderClear(&dc1);
|
||||||
tDecoderClear(&dc2);
|
tDecoderClear(&dc2);
|
||||||
if (ctbEntry.ctbEntry.pTags) taosMemoryFree((void *)ctbEntry.ctbEntry.pTags);
|
if (ctbEntry.ctbEntry.pTags) taosMemoryFree((void *)ctbEntry.ctbEntry.pTags);
|
||||||
|
|
|
@ -385,8 +385,9 @@ static int32_t sifDoIndex(SIFParam *left, SIFParam *right, int8_t operType, SIFP
|
||||||
.reverse = reverse,
|
.reverse = reverse,
|
||||||
.filterFunc = filterFunc};
|
.filterFunc = filterFunc};
|
||||||
|
|
||||||
char buf[128] = {0};
|
char buf[128] = {0};
|
||||||
float f = 0.0;
|
float f = 0.0;
|
||||||
|
double d = 0.0;
|
||||||
if (IS_VAR_DATA_TYPE(left->colValType)) {
|
if (IS_VAR_DATA_TYPE(left->colValType)) {
|
||||||
if (!IS_VAR_DATA_TYPE(right->colValType)) {
|
if (!IS_VAR_DATA_TYPE(right->colValType)) {
|
||||||
NUM_TO_STRING(right->colValType, right->condValue, sizeof(buf) - 2, buf + VARSTR_HEADER_SIZE);
|
NUM_TO_STRING(right->colValType, right->condValue, sizeof(buf) - 2, buf + VARSTR_HEADER_SIZE);
|
||||||
|
@ -405,6 +406,14 @@ static int32_t sifDoIndex(SIFParam *left, SIFParam *right, int8_t operType, SIFP
|
||||||
f = *(int32_t *)(right->condValue);
|
f = *(int32_t *)(right->condValue);
|
||||||
param.val = &f;
|
param.val = &f;
|
||||||
}
|
}
|
||||||
|
} else if (left->colValType == TSDB_DATA_TYPE_DOUBLE) {
|
||||||
|
if (right->colValType == TSDB_DATA_TYPE_DOUBLE) {
|
||||||
|
d = GET_DOUBLE_VAL(right->condValue);
|
||||||
|
param.val = &d;
|
||||||
|
} else if (right->colValType == TSDB_DATA_TYPE_BIGINT) {
|
||||||
|
d = *(int64_t *)(right->condValue);
|
||||||
|
param.val = &d;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = metaFilterTableIds(arg->metaEx, ¶m, output->result);
|
ret = metaFilterTableIds(arg->metaEx, ¶m, output->result);
|
||||||
|
|
Loading…
Reference in New Issue