fix:rm compare function for json and telnet in schemaless
This commit is contained in:
parent
bec6cdf784
commit
fba3421029
|
@ -229,7 +229,7 @@ SSmlTableInfo* smlBuildTableInfo(int numRows, const char* measure, int32_t me
|
|||
SSmlSTableMeta* smlBuildSTableMeta(bool isDataFormat);
|
||||
int32_t smlSetCTableName(SSmlTableInfo *oneTable);
|
||||
STableMeta* smlGetMeta(SSmlHandle *info, const void* measure, int32_t measureLen);
|
||||
int32_t is_same_child_table_telnet(const void *a, const void *b, size_t len);
|
||||
int32_t is_same_child_table_telnet(const void *a, const void *b);
|
||||
int64_t smlParseOpenTsdbTime(SSmlHandle *info, const char *data, int32_t len);
|
||||
int32_t smlClearForRerun(SSmlHandle *info);
|
||||
int32_t smlParseValue(SSmlKv *pVal, SSmlMsgBuf *msg);
|
||||
|
|
|
@ -1323,7 +1323,6 @@ int32_t smlClearForRerun(SSmlHandle *info) {
|
|||
static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char *rawLineEnd, int numLines) {
|
||||
int32_t code = TSDB_CODE_SUCCESS;
|
||||
if (info->protocol == TSDB_SML_JSON_PROTOCOL) {
|
||||
taosHashSetEqualFp(info->childTables, is_same_child_table_telnet);
|
||||
if (lines) {
|
||||
code = smlParseJSON(info, *lines);
|
||||
} else if (rawLine) {
|
||||
|
@ -1368,7 +1367,6 @@ static int32_t smlParseLine(SSmlHandle *info, char *lines[], char *rawLine, char
|
|||
code = smlParseInfluxString(info, tmp, tmp + len, info->lines + i);
|
||||
}
|
||||
} else if (info->protocol == TSDB_SML_TELNET_PROTOCOL) {
|
||||
taosHashSetEqualFp(info->childTables, is_same_child_table_telnet);
|
||||
if (info->dataFormat) {
|
||||
SSmlLineInfo element = {0};
|
||||
code = smlParseTelnetString(info, (char *)tmp, (char *)tmp + len, &element);
|
||||
|
|
|
@ -1010,7 +1010,7 @@ static int32_t smlParseJSONStringExt(SSmlHandle *info, cJSON *root, SSmlLineInfo
|
|||
bool needFree = info->dataFormat;
|
||||
elements->tags = cJSON_PrintUnformatted(tagsJson);
|
||||
elements->tagsLen = strlen(elements->tags);
|
||||
if(is_same_child_table_telnet(elements, &info->preLine, 0) != 0) {
|
||||
if(is_same_child_table_telnet(elements, &info->preLine) != 0) {
|
||||
ret = smlParseTagsFromJSON(info, tagsJson, elements);
|
||||
if (unlikely(ret)) {
|
||||
uError("OTD:0x%" PRIx64 " Unable to parse tags from JSON payload", info->id);
|
||||
|
@ -1180,7 +1180,7 @@ static int32_t smlParseJSONString(SSmlHandle *info, char **start, SSmlLineInfo *
|
|||
}
|
||||
|
||||
// Parse tags
|
||||
if(is_same_child_table_telnet(elements, &info->preLine, 0) != 0){
|
||||
if(is_same_child_table_telnet(elements, &info->preLine) != 0){
|
||||
char tmp = *(elements->tags + elements->tagsLen);
|
||||
*(elements->tags + elements->tagsLen) = 0;
|
||||
cJSON* tagsJson = cJSON_Parse(elements->tags);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "clientSml.h"
|
||||
|
||||
int32_t is_same_child_table_telnet(const void *a, const void *b, size_t len){
|
||||
int32_t is_same_child_table_telnet(const void *a, const void *b){
|
||||
SSmlLineInfo *t1 = (SSmlLineInfo *)a;
|
||||
SSmlLineInfo *t2 = (SSmlLineInfo *)b;
|
||||
// uError("is_same_child_table_telnet len:%d,%d %s,%s @@@ len:%d,%d %s,%s", t1->measureLen, t2->measureLen,
|
||||
|
@ -70,7 +70,7 @@ static void smlParseTelnetElement(char **sql, char *sqlEnd, char **data, int32_t
|
|||
}
|
||||
|
||||
static int32_t smlParseTelnetTags(SSmlHandle *info, char *data, char *sqlEnd, SSmlLineInfo *elements, SSmlMsgBuf *msg) {
|
||||
if(is_same_child_table_telnet(elements, &info->preLine, 0) == 0){
|
||||
if(is_same_child_table_telnet(elements, &info->preLine) == 0){
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue