fix:error in tag filter optimization
This commit is contained in:
parent
37f6d1195c
commit
4eccd81e94
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue