提交 9aeeab9e 编写于 作者: wmmhello's avatar wmmhello

TD-6129<feature> support null true false for json tag

上级 da60fb5e
...@@ -1184,28 +1184,30 @@ int32_t filterAddGroupUnitFromNode(SFilterInfo *info, tExprNode* tree, SArray *g ...@@ -1184,28 +1184,30 @@ int32_t filterAddGroupUnitFromNode(SFilterInfo *info, tExprNode* tree, SArray *g
free(v); free(v);
} }
} }
}else if(tree->_node.optr == TSDB_RELATION_QUESTION){ }
if(tree->_node.optr == TSDB_RELATION_QUESTION){
SSchema* schema = pLeft->pSchema; SSchema* schema = pLeft->pSchema;
if(tree->_node.pRight->pVal->nLen > TSDB_MAX_JSON_KEY_LEN) return TSDB_CODE_TSC_INVALID_COLUMN_LENGTH; if(tree->_node.pRight->pVal->nLen > TSDB_MAX_JSON_KEY_LEN) return TSDB_CODE_TSC_INVALID_COLUMN_LENGTH;
char keyMd5[TSDB_MAX_JSON_KEY_MD5_LEN] = {0}; char keyMd5[TSDB_MAX_JSON_KEY_MD5_LEN] = {0};
jsonKeyMd5(tree->_node.pRight->pVal->pz, tree->_node.pRight->pVal->nLen, keyMd5); jsonKeyMd5(tree->_node.pRight->pVal->pz, tree->_node.pRight->pVal->nLen, keyMd5);
memcpy(schema->name, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN); memcpy(schema->name, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN);
} }
SSchema* schema = pLeft->pSchema; SSchema* schema = pLeft->pSchema;
if(schema->type == TSDB_DATA_TYPE_JSON) { if(tree->_node.optr == TSDB_RELATION_ISNULL || tree->_node.optr == TSDB_RELATION_NOTNULL){
if(tree->_node.optr == TSDB_RELATION_ISNULL || tree->_node.optr == TSDB_RELATION_NOTNULL){ if(pLeft->pSchema->type == TSDB_DATA_TYPE_JSON) {
char keyMd5[TSDB_MAX_JSON_KEY_MD5_LEN] = {0}; char keyMd5[TSDB_MAX_JSON_KEY_MD5_LEN] = {0};
uint8_t nullData = TSDB_DATA_JSON_NULL; uint8_t nullData = TSDB_DATA_JSON_NULL;
jsonKeyMd5(&nullData, 1, keyMd5); jsonKeyMd5(&nullData, 1, keyMd5);
memcpy(schema->name, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN); memcpy(schema->name, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN);
}else if(tree->_node.optr == TSDB_RELATION_MATCH || tree->_node.optr == TSDB_RELATION_NMATCH || tree->_node.optr == TSDB_RELATION_LIKE){ }
if(!IS_VAR_DATA_TYPE(schema->type)){ }else if(tree->_node.optr == TSDB_RELATION_MATCH || tree->_node.optr == TSDB_RELATION_NMATCH || tree->_node.optr == TSDB_RELATION_LIKE){
return TSDB_CODE_QRY_JSON_INVALID_EXP; if(!IS_VAR_DATA_TYPE(schema->type)){
} return TSDB_CODE_QRY_JSON_INVALID_EXP;
} }
} }
SFilterFieldId left = {0}, right = {0}; SFilterFieldId left = {0}, right = {0};
filterAddFieldFromNode(info, pLeft, &left); filterAddFieldFromNode(info, pLeft, &left);
tVariant* var = tree->_node.pRight->pVal; tVariant* var = tree->_node.pRight->pVal;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册