提交 4b19a943 编写于 作者: wmmhello's avatar wmmhello

fix group by json tag format [change json type with qid return logic]

上级 8f0788e9
...@@ -439,7 +439,7 @@ TAOS_FIELD *taos_fetch_fields(TAOS_RES *res) { ...@@ -439,7 +439,7 @@ TAOS_FIELD *taos_fetch_fields(TAOS_RES *res) {
if (pField->visible) { if (pField->visible) {
f[j] = pField->field; 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; f[j].type = pField->fieldJson.type;
if(!IS_VAR_DATA_TYPE(f[j].type) && f[j].type != TSDB_DATA_TYPE_JSON){ if(!IS_VAR_DATA_TYPE(f[j].type) && f[j].type != TSDB_DATA_TYPE_JSON){
f[j].bytes = pField->fieldJson.bytes; f[j].bytes = pField->fieldJson.bytes;
......
...@@ -2265,7 +2265,7 @@ SInternalField* tscFieldInfoAppend(SFieldInfo* pFieldInfo, TAOS_FIELD* pField) { ...@@ -2265,7 +2265,7 @@ SInternalField* tscFieldInfoAppend(SFieldInfo* pFieldInfo, TAOS_FIELD* pField) {
assert(pFieldInfo != NULL); assert(pFieldInfo != NULL);
pFieldInfo->numOfOutput++; pFieldInfo->numOfOutput++;
struct SInternalField info = { .pExpr = NULL, .visible = true, .fieldJson={0} }; struct SInternalField info = { .pExpr = NULL, .visible = true };
info.field = *pField; info.field = *pField;
return taosArrayPush(pFieldInfo->internalField, &info); return taosArrayPush(pFieldInfo->internalField, &info);
...@@ -2273,7 +2273,7 @@ SInternalField* tscFieldInfoAppend(SFieldInfo* pFieldInfo, TAOS_FIELD* pField) { ...@@ -2273,7 +2273,7 @@ SInternalField* tscFieldInfoAppend(SFieldInfo* pFieldInfo, TAOS_FIELD* pField) {
SInternalField* tscFieldInfoInsert(SFieldInfo* pFieldInfo, int32_t index, TAOS_FIELD* field) { SInternalField* tscFieldInfoInsert(SFieldInfo* pFieldInfo, int32_t index, TAOS_FIELD* field) {
pFieldInfo->numOfOutput++; pFieldInfo->numOfOutput++;
struct SInternalField info = { .pExpr = NULL, .visible = true, .fieldJson={0}}; struct SInternalField info = { .pExpr = NULL, .visible = true };
info.field = *field; info.field = *field;
return taosArrayInsert(pFieldInfo->internalField, index, &info); return taosArrayInsert(pFieldInfo->internalField, index, &info);
......
...@@ -194,7 +194,7 @@ class TDTestCase: ...@@ -194,7 +194,7 @@ class TDTestCase:
tdSql.checkData(0, 0, "{\"k1\":\"\",\"k2\":true,\"k3\":false,\"k4\":55}") tdSql.checkData(0, 0, "{\"k1\":\"\",\"k2\":true,\"k3\":false,\"k4\":55}")
tdSql.query("select jtag->'k2' from db_json_tag_test.jsons1_10") tdSql.query("select jtag->'k2' from db_json_tag_test.jsons1_10")
tdSql.checkData(0, 0, "true") tdSql.checkData(0, 0, True)
tdSql.query("select jtag from db_json_tag_test.jsons1 where jtag->'k1'=''") tdSql.query("select jtag from db_json_tag_test.jsons1 where jtag->'k1'=''")
tdSql.checkRows(1) tdSql.checkRows(1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册