diff --git a/src/client/src/tscParseOpenTSDB.c b/src/client/src/tscParseOpenTSDB.c index 6735462f17013ed4813345964be62e318cdefe2f..a2a3f149ce2e13c3382bc5b0317859dc7457c734 100644 --- a/src/client/src/tscParseOpenTSDB.c +++ b/src/client/src/tscParseOpenTSDB.c @@ -759,14 +759,14 @@ int32_t parseValueFromJSON(cJSON *root, TAOS_SML_KV *pVal, SSmlLinesInfo* info) } case cJSON_String: { /* set default JSON type to binary/nchar according to - * user configured parameter tsSmlDefaultJSONStrType + * user configured parameter tsDefaultJSONStrType */ - if (strcasecmp(tsSmlDefaultJSONStrType, "binary") == 0) { + if (strcasecmp(tsDefaultJSONStrType, "binary") == 0) { pVal->type = TSDB_DATA_TYPE_BINARY; - } else if (strcasecmp(tsSmlDefaultJSONStrType, "nchar") == 0) { + } else if (strcasecmp(tsDefaultJSONStrType, "nchar") == 0) { pVal->type = TSDB_DATA_TYPE_NCHAR; } else { - tscError("OTD:0x%"PRIx64" Invalid default JSON string type set from config %s", info->id, tsSmlDefaultJSONStrType); + tscError("OTD:0x%"PRIx64" Invalid default JSON string type set from config %s", info->id, tsDefaultJSONStrType); return TSDB_CODE_TSC_INVALID_JSON_CONFIG; } //pVal->length = wcslen((wchar_t *)root->valuestring) * TSDB_NCHAR_SIZE; diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index e8d0937705f049bf3c1d4237eff4023a335ef611..beeb4e8b243e21e33f4162b07ec218c40e4029f9 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -228,7 +228,7 @@ extern char Compressor[]; extern int8_t tsDeadLockKillQuery; // schemaless -extern char tsSmlDefaultJSONStrType[]; +extern char tsDefaultJSONStrType[]; typedef struct { char dir[TSDB_FILENAME_LEN]; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 57a177b173e2b785064cb62668b7275c816e81fa..7d352a9dc1f0a9a97c7c1920f898fb286a01497f 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -282,8 +282,8 @@ char Compressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRESS // long query death-lock int8_t tsDeadLockKillQuery = 0; -// schemaless -char tsSmlDefaultJSONStrType[7] = "binary"; +// default JSON string type +char tsDefaultJSONStrType[7] = "binary"; int32_t (*monStartSystemFp)() = NULL; void (*monStopSystemFp)() = NULL; @@ -1640,14 +1640,14 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - // Schemaless config - cfg.option = "smlDefaultJSONStrType"; - cfg.ptr = tsSmlDefaultJSONStrType; + // default JSON string type option "binary"/"nchar" + cfg.option = "defaultJSONStrType"; + cfg.ptr = tsDefaultJSONStrType; cfg.valType = TAOS_CFG_VTYPE_STRING; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLIENT; cfg.minValue = 0; cfg.maxValue = 0; - cfg.ptrLength = tListLen(tsSmlDefaultJSONStrType); + cfg.ptrLength = tListLen(tsDefaultJSONStrType); cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg);