From 0a86ce884ee50e981a5e80a9ea12a8c144a23290 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Fri, 4 Jun 2021 13:19:29 +0800 Subject: [PATCH] [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() -- GitLab