提交 db1143bd 编写于 作者: X xywang

[TS-1289]<fix>: fixed show create stable error if tag type is json

上级 9c3a130b
......@@ -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", ")");
}
}
}
......
......@@ -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':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册