提交 7ae0c926 编写于 作者: G Ganlin Zhao

[TD-6645/enhance]: change config parameter name smlDefaultJSONType

to defaultJSONType, as this param will also be used to set JSON tags
default string types.
上级 b578690d
...@@ -759,14 +759,14 @@ int32_t parseValueFromJSON(cJSON *root, TAOS_SML_KV *pVal, SSmlLinesInfo* info) ...@@ -759,14 +759,14 @@ int32_t parseValueFromJSON(cJSON *root, TAOS_SML_KV *pVal, SSmlLinesInfo* info)
} }
case cJSON_String: { case cJSON_String: {
/* set default JSON type to binary/nchar according to /* 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; pVal->type = TSDB_DATA_TYPE_BINARY;
} else if (strcasecmp(tsSmlDefaultJSONStrType, "nchar") == 0) { } else if (strcasecmp(tsDefaultJSONStrType, "nchar") == 0) {
pVal->type = TSDB_DATA_TYPE_NCHAR; pVal->type = TSDB_DATA_TYPE_NCHAR;
} else { } 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; return TSDB_CODE_TSC_INVALID_JSON_CONFIG;
} }
//pVal->length = wcslen((wchar_t *)root->valuestring) * TSDB_NCHAR_SIZE; //pVal->length = wcslen((wchar_t *)root->valuestring) * TSDB_NCHAR_SIZE;
......
...@@ -228,7 +228,7 @@ extern char Compressor[]; ...@@ -228,7 +228,7 @@ extern char Compressor[];
extern int8_t tsDeadLockKillQuery; extern int8_t tsDeadLockKillQuery;
// schemaless // schemaless
extern char tsSmlDefaultJSONStrType[]; extern char tsDefaultJSONStrType[];
typedef struct { typedef struct {
char dir[TSDB_FILENAME_LEN]; char dir[TSDB_FILENAME_LEN];
......
...@@ -282,8 +282,8 @@ char Compressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRESS ...@@ -282,8 +282,8 @@ char Compressor[32] = "ZSTD_COMPRESSOR"; // ZSTD_COMPRESSOR or GZIP_COMPRESS
// long query death-lock // long query death-lock
int8_t tsDeadLockKillQuery = 0; int8_t tsDeadLockKillQuery = 0;
// schemaless // default JSON string type
char tsSmlDefaultJSONStrType[7] = "binary"; char tsDefaultJSONStrType[7] = "binary";
int32_t (*monStartSystemFp)() = NULL; int32_t (*monStartSystemFp)() = NULL;
void (*monStopSystemFp)() = NULL; void (*monStopSystemFp)() = NULL;
...@@ -1640,14 +1640,14 @@ static void doInitGlobalConfig(void) { ...@@ -1640,14 +1640,14 @@ static void doInitGlobalConfig(void) {
cfg.unitType = TAOS_CFG_UTYPE_NONE; cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg); taosInitConfigOption(cfg);
// Schemaless config // default JSON string type option "binary"/"nchar"
cfg.option = "smlDefaultJSONStrType"; cfg.option = "defaultJSONStrType";
cfg.ptr = tsSmlDefaultJSONStrType; cfg.ptr = tsDefaultJSONStrType;
cfg.valType = TAOS_CFG_VTYPE_STRING; cfg.valType = TAOS_CFG_VTYPE_STRING;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLIENT; cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLIENT;
cfg.minValue = 0; cfg.minValue = 0;
cfg.maxValue = 0; cfg.maxValue = 0;
cfg.ptrLength = tListLen(tsSmlDefaultJSONStrType); cfg.ptrLength = tListLen(tsDefaultJSONStrType);
cfg.unitType = TAOS_CFG_UTYPE_NONE; cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosInitConfigOption(cfg); taosInitConfigOption(cfg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册