diff --git a/src/client/src/tscLocal.c b/src/client/src/tscLocal.c index 4da1ecd2a97bf54c5c89619ecbdff870afc0d67d..b6c8b3de3f9b1b0d84f9b1ea5eecc496cf58ba0c 100644 --- a/src/client/src/tscLocal.c +++ b/src/client/src/tscLocal.c @@ -375,6 +375,8 @@ static int32_t tscGetTableTagValue(SCreateBuilder *builder, char *result) { || fields[i].type == TSDB_DATA_TYPE_BINARY || fields[i].type == TSDB_DATA_TYPE_TIMESTAMP) && 0 == ret) { snprintf(result + strlen(result), TSDB_MAX_BINARY_LEN - strlen(result), "\"%s\",", buf); + } else if (fields[i].type == TSDB_DATA_TYPE_JSON) { + snprintf(result + strlen(result), TSDB_MAX_BINARY_LEN - strlen(result), "'%s,", buf); } else { snprintf(result + strlen(result), TSDB_MAX_BINARY_LEN - strlen(result), "%s,", buf); } @@ -382,7 +384,11 @@ static int32_t tscGetTableTagValue(SCreateBuilder *builder, char *result) { free(buf); if (i == num_fields - 1) { - sprintf(result + strlen(result) - 1, "%s", ")"); + if (fields[i].type == TSDB_DATA_TYPE_JSON) { + sprintf(result + strlen(result) - 1, "%s'", ")"); + } else { + sprintf(result + strlen(result) - 1, "%s", ")"); + } } }