提交 15f54db8 编写于 作者: wmmhello's avatar wmmhello

TD-6129<feature> fix select jtag error

上级 c08f3c32
......@@ -1164,9 +1164,9 @@ int32_t filterAddGroupUnitFromNode(SFilterInfo *info, tExprNode* tree, SArray *g
if(pLeft->_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};
jsonKeyMd5(pLeft->_node.pRight->pVal->pz, pLeft->_node.pRight->pVal->nLen, keyMd5);
strncpy(schema->name, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN);
memcpy(schema->name, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN);
void* data = getJsonTagValue(info->pTable, schema->name, strlen(schema->name), &schema->colId);
void* data = getJsonTagValue(info->pTable, schema->name, TSDB_MAX_JSON_KEY_MD5_LEN, &schema->colId);
if(data == NULL) return TSDB_CODE_QRY_JSON_KEY_NOT_EXIST;
schema->type = *(char*)data; // if exist json tag-> operation get type so that can set data if (tree->_node.optr == TSDB_RELATION_IN_IN) the next and set value in filterInitValFieldData
assert(schema->type > TSDB_DATA_TYPE_NULL && schema->type < TSDB_DATA_TYPE_JSON);
......@@ -1180,7 +1180,7 @@ int32_t filterAddGroupUnitFromNode(SFilterInfo *info, tExprNode* tree, SArray *g
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};
jsonKeyMd5(tree->_node.pRight->pVal->pz, tree->_node.pRight->pVal->nLen, keyMd5);
strncpy(schema->name, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN);
memcpy(schema->name, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN);
}
SFilterFieldId left = {0}, right = {0};
......
......@@ -4081,7 +4081,7 @@ static FORCE_INLINE int32_t tsdbGetJsonTagDataFromId(void *param, int32_t id, ch
if (id == TSDB_TBNAME_COLUMN_INDEX) {
*data = TABLE_NAME(pTable);
} else {
void* jsonData = getJsonTagValue(pTable, name, strlen(name), NULL);
void* jsonData = getJsonTagValue(pTable, name, TSDB_MAX_JSON_KEY_MD5_LEN, NULL);
if (jsonData != NULL) jsonData += CHAR_BYTES; // jump type
*data = jsonData;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册