提交 446c6fe2 编写于 作者: wmmhello's avatar wmmhello

change json output format

上级 eac34d25
......@@ -215,7 +215,7 @@ static int32_t tscProcessDescribeTable(SSqlObj *pSql) {
return tscSetValueToResObj(pSql, rowLen);
}
static int32_t tscGetNthFieldResult(TAOS_ROW row, TAOS_FIELD* fields, int *lengths, int idx, char *result) {
const char *val = (const char*)row[idx];
char *val = (char*)row[idx];
if (val == NULL) {
sprintf(result, "%s", TSDB_DATA_NULL_STR);
return -1;
......@@ -223,6 +223,16 @@ static int32_t tscGetNthFieldResult(TAOS_ROW row, TAOS_FIELD* fields, int *lengt
uint8_t type = fields[idx].type;
int32_t length = lengths[idx];
if (type == TSDB_DATA_TYPE_JSON){
char* p = result;
type = *p;
val += CHAR_BYTES;
if(type == TSDB_DATA_TYPE_NCHAR) {
length = varDataLen(val);
val = varDataVal(val);
}
}
switch (type) {
case TSDB_DATA_TYPE_BOOL:
sprintf(result, "%s", ((((int32_t)(*((char *)val))) == 1) ? "true" : "false"));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册