diff --git a/src/client/src/tscLocal.c b/src/client/src/tscLocal.c index 4da1ecd2a97bf54c5c89619ecbdff870afc0d67d..d2294773d743fe4df0879c920f2335b60e8b8b96 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", ")"); + } } } diff --git a/src/util/src/ttokenizer.c b/src/util/src/ttokenizer.c index 1f99605cc517d4b7a8cd7cbb0f06ece7ce6aab7a..8fca99291164a429867a090c98a61156daa40af2 100644 --- a/src/util/src/ttokenizer.c +++ b/src/util/src/ttokenizer.c @@ -570,12 +570,6 @@ uint32_t tGetToken(char* z, uint32_t* tokenId) { *tokenId = TK_ID; return i; } - case '{': { - for (i = 1; z[i] && z[i - 1] != '}'; i++) { - } - *tokenId = TK_STRING; - return i; - } case 'T': case 't': case 'F':