提交 80047eab 编写于 作者: wmmhello's avatar wmmhello

fix:add json test case

上级 82a659c3
......@@ -330,7 +330,7 @@ int parseJsontoTagData(const char* json, SKVRowBuilder* kvRowBuilder, SMsgBuf* p
// set json NULL data
uint8_t jsonNULL = TSDB_DATA_TYPE_NULL;
int jsonIndex = startColId + 1;
if (!json || strcasecmp(json, TSDB_DATA_NULL_STR_L) == 0) {
if (!json || strtrim((char*)json) == 0 ||strcasecmp(json, TSDB_DATA_NULL_STR_L) == 0) {
tdAddColToKVRow(kvRowBuilder, jsonIndex, &jsonNULL, CHAR_BYTES);
return TSDB_CODE_SUCCESS;
}
......
......@@ -52,7 +52,7 @@ size_t strtrim(char *z) {
int32_t j = 0;
int32_t delta = 0;
while (z[j] == ' ') {
while (isspace(z[j])) {
++j;
}
......@@ -65,9 +65,9 @@ size_t strtrim(char *z) {
int32_t stop = 0;
while (z[j] != 0) {
if (z[j] == ' ' && stop == 0) {
if (isspace(z[j]) && stop == 0) {
stop = j;
} else if (z[j] != ' ' && stop != 0) {
} else if (!isspace(z[j]) && stop != 0) {
stop = 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册