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

TD-6129<feature> fix select jtag error

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