提交 85aa9244 编写于 作者: wmmhello's avatar wmmhello

TD-6129<feature> fix select jtag error

上级 a91392a9
...@@ -5221,7 +5221,7 @@ char* parseTagDatatoJson(void *p){ ...@@ -5221,7 +5221,7 @@ char* parseTagDatatoJson(void *p){
int16_t nCols = kvRowNCols(p); int16_t nCols = kvRowNCols(p);
ASSERT(nCols%2 == 1); ASSERT(nCols%2 == 1);
char tagJsonKey[TSDB_MAX_TAGS_LEN] = {0}; char tagJsonKey[TSDB_MAX_JSON_KEY_LEN + 1] = {0};
for (int j = 0; j < nCols; ++j) { for (int j = 0; j < nCols; ++j) {
SColIdx * pColIdx = kvRowColIdxAt(p, j); SColIdx * pColIdx = kvRowColIdxAt(p, j);
void* val = (kvRowColVal(p, pColIdx)); void* val = (kvRowColVal(p, pColIdx));
...@@ -5230,13 +5230,10 @@ char* parseTagDatatoJson(void *p){ ...@@ -5230,13 +5230,10 @@ char* parseTagDatatoJson(void *p){
ASSERT(jsonVal == TSDB_DATA_BINARY_PLACEHOLDER); ASSERT(jsonVal == TSDB_DATA_BINARY_PLACEHOLDER);
continue; continue;
} }
if (j%2 != 0) { // json key if (j%2 != 0) { // json key encode by binary
memset(tagJsonKey, 0, TSDB_MAX_TAGS_LEN); ASSERT(varDataLen(val) <= TSDB_MAX_JSON_KEY_LEN);
int32_t length = taosUcs4ToMbs(varDataVal(val), varDataLen(val), tagJsonKey); memset(tagJsonKey, 0, sizeof(tagJsonKey));
if (length == 0) { memcpy(tagJsonKey, varDataVal(val), varDataLen(val));
tscError("charset:%s to %s. val:%s convert json key failed.", DEFAULT_UNICODE_ENCODEC, tsCharset, (char*)val);
goto end;
}
}else{ // json value }else{ // json value
char tagJsonValue[TSDB_MAX_TAGS_LEN] = {0}; char tagJsonValue[TSDB_MAX_TAGS_LEN] = {0};
char* realData = POINTER_SHIFT(val, CHAR_BYTES); char* realData = POINTER_SHIFT(val, CHAR_BYTES);
......
...@@ -229,8 +229,6 @@ extern int8_t tsDeadLockKillQuery; ...@@ -229,8 +229,6 @@ extern int8_t tsDeadLockKillQuery;
// schemaless // schemaless
extern char tsDefaultJSONStrType[]; extern char tsDefaultJSONStrType[];
#define JSON_TYPE_BINARY (strcasecmp(tsDefaultJSONStrType, "binary") == 0)
#define JSON_TYPE_NCHAR (strcasecmp(tsDefaultJSONStrType, "nchar") == 0)
typedef struct { typedef struct {
char dir[TSDB_FILENAME_LEN]; char dir[TSDB_FILENAME_LEN];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册