提交 4eccd81e 编写于 作者: wmmhello's avatar wmmhello

fix:error in tag filter optimization

上级 37f6d119
......@@ -433,8 +433,10 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray
tagVal.cid = pColInfo->info.colId;
const char* p = metaGetTableTagVal(tag, pColInfo->info.type, &tagVal);
if (p == NULL){
if (p == NULL || (pColInfo->info.type == TSDB_DATA_TYPE_JSON && ((STag*)p)->nTag == 0)){
colDataAppend(pColInfo, i, p, true);
} else if (pColInfo->info.type == TSDB_DATA_TYPE_JSON) {
colDataAppend(pColInfo, i, p, false);
} else if (IS_VAR_DATA_TYPE(pColInfo->info.type)) {
char *tmp = taosMemoryMalloc(tagVal.nData + VARSTR_HEADER_SIZE);
varDataSetLen(tmp, tagVal.nData);
......
......@@ -216,7 +216,7 @@ class TDTestCase:
# test where with json tag
tdSql.query("select * from jsons1_1 where jtag is not null")
tdSql.query("select * from jsons1 where jtag='{\"tag1\":11,\"tag2\":\"\"}'")
tdSql.error("select * from jsons1 where jtag='{\"tag1\":11,\"tag2\":\"\"}'")
tdSql.error("select * from jsons1 where jtag->'tag1'={}")
# test json error
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册