提交 d2f57b4a 编写于 作者: dengyihao's avatar dengyihao

fix alter tag

上级 ac169b8d
......@@ -793,9 +793,6 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
goto _err;
}
if (iCol == 0) {
// TODO : need to update tag index
}
ctbEntry.version = version;
if (pTagSchema->nCols == 1 && pTagSchema->pSchema[0].type == TSDB_DATA_TYPE_JSON) {
ctbEntry.ctbEntry.pTags = taosMemoryMalloc(pAlterTbReq->nTagVal);
......@@ -849,6 +846,10 @@ static int metaUpdateTableTagVal(SMeta *pMeta, int64_t version, SVAlterTbReq *pA
// save to uid.idx
tdbTbUpsert(pMeta->pUidIdx, &ctbEntry.uid, sizeof(tb_uid_t), &version, sizeof(version), &pMeta->txn);
if (iCol == 0) {
metaUpdateTagIdx(pMeta, &ctbEntry);
}
tDecoderClear(&dc1);
tDecoderClear(&dc2);
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,
.filterFunc = filterFunc};
char buf[128] = {0};
float f = 0.0;
char buf[128] = {0};
float f = 0.0;
double d = 0.0;
if (IS_VAR_DATA_TYPE(left->colValType)) {
if (!IS_VAR_DATA_TYPE(right->colValType)) {
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);
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, &param, output->result);
......
......@@ -452,4 +452,4 @@ if $rows != 2 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册