diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index 37482389f81bfba3734a36ac00752f612eae9b30..672d385cc5cb88c5227e0035934abcbf0b99a376 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -439,7 +439,7 @@ TAOS_FIELD *taos_fetch_fields(TAOS_RES *res) { if (pField->visible) { f[j] = pField->field; - if(f[j].type == TSDB_DATA_TYPE_JSON){ + if(f[j].type == TSDB_DATA_TYPE_JSON && pField->fieldJson.type != TSDB_DATA_TYPE_NULL){ f[j].type = pField->fieldJson.type; if(!IS_VAR_DATA_TYPE(f[j].type) && f[j].type != TSDB_DATA_TYPE_JSON){ f[j].bytes = pField->fieldJson.bytes; diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index a56367a98dd0a38628e9dca757dbaa087cd174d9..35c2c913d9b29a054b97eae8d3d7eb9bc1c8decc 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -2265,7 +2265,7 @@ SInternalField* tscFieldInfoAppend(SFieldInfo* pFieldInfo, TAOS_FIELD* pField) { assert(pFieldInfo != NULL); pFieldInfo->numOfOutput++; - struct SInternalField info = { .pExpr = NULL, .visible = true, .fieldJson={0} }; + struct SInternalField info = { .pExpr = NULL, .visible = true }; info.field = *pField; return taosArrayPush(pFieldInfo->internalField, &info); @@ -2273,7 +2273,7 @@ SInternalField* tscFieldInfoAppend(SFieldInfo* pFieldInfo, TAOS_FIELD* pField) { SInternalField* tscFieldInfoInsert(SFieldInfo* pFieldInfo, int32_t index, TAOS_FIELD* field) { pFieldInfo->numOfOutput++; - struct SInternalField info = { .pExpr = NULL, .visible = true, .fieldJson={0}}; + struct SInternalField info = { .pExpr = NULL, .visible = true }; info.field = *field; return taosArrayInsert(pFieldInfo->internalField, index, &info);