提交 33d2019c 编写于 作者: wmmhello's avatar wmmhello

TD-6129<feature> move select json->'key' decode logic to client

上级 2da14cc0
......@@ -378,7 +378,7 @@ char* cloneCurrentDBName(SSqlObj* pSql);
int parseJsontoTagData(char* json, SKVRowBuilder* kvRowBuilder, char* errMsg, int16_t startColId);
char* parseTagDatatoJson(void *p);
void findTagValue(STable* data, char* key, int32_t keyLen, char* out, int* len);
void findTagValue(STable* data, char* key, int32_t keyLen, char** out, int* len);
void parseTagValue2Dst(char* result, char* dst);
int8_t jsonType2DbType(double data, int jsonType);
......
......@@ -6127,7 +6127,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
SUpdateTableTagValMsg* pUpdateMsg = (SUpdateTableTagValMsg*) pCmd->payload;
pUpdateMsg->head.vgId = htonl(pTableMeta->vgId);
pUpdateMsg->tid = htonl(pTableMeta->id.tid);
pUpdateMsg->tid = htonl(pTableMeta->id.tid)
pUpdateMsg->uid = htobe64(pTableMeta->id.uid);
pUpdateMsg->colId = htons(pTagsSchema->colId);
pUpdateMsg->type = pTagsSchema->type;
......
......@@ -5176,13 +5176,13 @@ char* cloneCurrentDBName(SSqlObj* pSql) {
return p;
}
void findTagValue(STable* data, char* key, int32_t keyLen, char* out, int* len){
void findTagValue(STable* data, char* key, int32_t keyLen, char** out, int* len){
void* result = getJsonTagValue(data, key, keyLen, NULL);
if (result == NULL){ // json key no result
return;
}
out = result;
*out = result;
char* realData = POINTER_SHIFT(result, CHAR_BYTES);
if(*(char*)result == TSDB_DATA_TYPE_NCHAR) {
*len = varDataTLen(realData) + CHAR_BYTES;
......
......@@ -7193,7 +7193,7 @@ static SSDataBlock* doTagScan(void* param, bool* newgroup) {
jsonKeyMd5(pExprInfo[j].base.param[0].pz, pExprInfo[j].base.param[0].nLen, keyMd5);
char* strStr = NULL;
int len = 0;
findTagValue(item->pTable, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN, strStr, &len);
findTagValue(item->pTable, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN, &strStr, &len);
*dst++ = SELECT_ELEMENT_JSON_TAG; // select tag->element
doSetTagValueToResultBuf(dst, strStr, type, len);
}else{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册