From 0b33fdbec1c10b7380a46f7c88123cd9cb06e6e8 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 3 Jun 2021 18:15:36 +0800 Subject: [PATCH 1/3] [TD-4412]: add new configuration parameter for db option cachelast --- src/common/src/tglobal.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index ed91695569..786c612d61 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -887,6 +887,16 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); + cfg.option = "cachelast"; + cfg.ptr = &tsCacheLastRow; + cfg.valType = TAOS_CFG_VTYPE_INT8; + cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; + cfg.minValue = TSDB_MIN_DB_CACHE_LAST_ROW; + cfg.maxValue = TSDB_MAX_DB_CACHE_LAST_ROW; + cfg.ptrLength = 0; + cfg.unitType = TAOS_CFG_UTYPE_NONE; + taosInitConfigOption(cfg); + cfg.option = "mqttHostName"; cfg.ptr = tsMqttHostName; cfg.valType = TAOS_CFG_VTYPE_STRING; From e4c10a3e2465704fc438725487820f152097b62d Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Fri, 4 Jun 2021 10:24:56 +0800 Subject: [PATCH 2/3] test/offlineThreshold: fix index in show variables; --- tests/pytest/functions/showOfflineThresholdIs864000.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pytest/functions/showOfflineThresholdIs864000.py b/tests/pytest/functions/showOfflineThresholdIs864000.py index 6cce869bf2..6734df1fac 100644 --- a/tests/pytest/functions/showOfflineThresholdIs864000.py +++ b/tests/pytest/functions/showOfflineThresholdIs864000.py @@ -25,7 +25,7 @@ class TDTestCase: def run(self): tdSql.query("show variables") - tdSql.checkData(51, 1, 864000) + tdSql.checkData(52, 1, 864000) def stop(self): tdSql.close() @@ -33,4 +33,4 @@ class TDTestCase: tdCases.addWindows(__file__, TDTestCase()) -tdCases.addLinux(__file__, TDTestCase()) \ No newline at end of file +tdCases.addLinux(__file__, TDTestCase()) From 0a86ce884ee50e981a5e80a9ea12a8c144a23290 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Fri, 4 Jun 2021 13:19:29 +0800 Subject: [PATCH 3/3] [TD-4412]: add new configuration parameter for db option precision --- src/common/src/tglobal.c | 10 ++++++++++ tests/pytest/functions/showOfflineThresholdIs864000.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index 786c612d61..381d2804c1 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -817,6 +817,16 @@ static void doInitGlobalConfig(void) { cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); + cfg.option = "precision"; + cfg.ptr = &tsTimePrecision; + cfg.valType = TAOS_CFG_VTYPE_INT8; + cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_SHOW; + cfg.minValue = TSDB_MIN_PRECISION; + cfg.maxValue = TSDB_MAX_PRECISION; + cfg.ptrLength = 0; + cfg.unitType = TAOS_CFG_UTYPE_NONE; + taosInitConfigOption(cfg); + cfg.option = "comp"; cfg.ptr = &tsCompression; cfg.valType = TAOS_CFG_VTYPE_INT8; diff --git a/tests/pytest/functions/showOfflineThresholdIs864000.py b/tests/pytest/functions/showOfflineThresholdIs864000.py index 6734df1fac..a7a1c2bf3f 100644 --- a/tests/pytest/functions/showOfflineThresholdIs864000.py +++ b/tests/pytest/functions/showOfflineThresholdIs864000.py @@ -25,7 +25,7 @@ class TDTestCase: def run(self): tdSql.query("show variables") - tdSql.checkData(52, 1, 864000) + tdSql.checkData(53, 1, 864000) def stop(self): tdSql.close()