From 07f80d4b4d79543b6a77a6ee19edf7cdcfa6c0bf Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 8 Feb 2022 14:29:41 +0800 Subject: [PATCH] [TD-11220](query): time related functions --- src/common/src/texpr.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/src/texpr.c b/src/common/src/texpr.c index 96bc03fd08..8f7056cc7d 100644 --- a/src/common/src/texpr.c +++ b/src/common/src/texpr.c @@ -2029,9 +2029,9 @@ void vectorTimeFunc(int16_t functionId, tExprOperandInfo *pInputs, int32_t numIn if (tsDigits == TSDB_TIME_PRECISION_MILLI_DIGITS) { timeVal = timeVal; } else if (tsDigits == TSDB_TIME_PRECISION_MICRO_DIGITS) { - timeVal = timeVal / (1000 * 1000) * (1000 * 1000); + timeVal = timeVal / (1000000) * (1000000); } else if (tsDigits == TSDB_TIME_PRECISION_NANO_DIGITS) { - timeVal = timeVal / (1000 * 1000 * 1000) * (1000 * 1000 * 1000); + timeVal = timeVal / (1000000000) * (1000000000); } else if (tsDigits <= TSDB_TIME_PRECISION_SEC_DIGITS){ timeVal = timeVal * factor; } else { @@ -2043,9 +2043,9 @@ void vectorTimeFunc(int16_t functionId, tExprOperandInfo *pInputs, int32_t numIn if (tsDigits == TSDB_TIME_PRECISION_MILLI_DIGITS) { timeVal = timeVal / 1000 * 1000; } else if (tsDigits == TSDB_TIME_PRECISION_MICRO_DIGITS) { - timeVal = timeVal / (1000 * 1000) * (1000 * 1000); + timeVal = timeVal / (1000000) * (1000000); } else if (tsDigits == TSDB_TIME_PRECISION_NANO_DIGITS) { - timeVal = timeVal / (1000 * 1000 * 1000) * (1000 * 1000 * 1000); + timeVal = timeVal / (1000000000) * (1000000000); } else if (tsDigits <= TSDB_TIME_PRECISION_SEC_DIGITS) { timeVal = timeVal * factor; } else { @@ -2057,9 +2057,9 @@ void vectorTimeFunc(int16_t functionId, tExprOperandInfo *pInputs, int32_t numIn if (tsDigits == TSDB_TIME_PRECISION_MILLI_DIGITS) { timeVal = timeVal / 1000 / 60 * 60 * 1000; } else if (tsDigits == TSDB_TIME_PRECISION_MICRO_DIGITS) { - timeVal = timeVal / (1000 * 1000) / 60 * 60 * (1000 * 1000); + timeVal = timeVal / (1000000) / 60 * 60 * (1000000); } else if (tsDigits == TSDB_TIME_PRECISION_NANO_DIGITS) { - timeVal = timeVal / (1000 * 1000 * 1000) / 60 * 60 * (1000 * 1000 * 1000); + timeVal = timeVal / (1000000000) / 60 * 60 * (1000000000); } else if (tsDigits <= TSDB_TIME_PRECISION_SEC_DIGITS) { timeVal = timeVal * factor / factor / 60 * 60 * factor; } else { @@ -2071,9 +2071,9 @@ void vectorTimeFunc(int16_t functionId, tExprOperandInfo *pInputs, int32_t numIn if (tsDigits == TSDB_TIME_PRECISION_MILLI_DIGITS) { timeVal = timeVal / 1000 / 3600 * 3600 * 1000; } else if (tsDigits == TSDB_TIME_PRECISION_MICRO_DIGITS) { - timeVal = timeVal / (1000 * 1000) / 3600 * 3600 * (1000 * 1000); + timeVal = timeVal / (1000000) / 3600 * 3600 * (1000000); } else if (tsDigits == TSDB_TIME_PRECISION_NANO_DIGITS) { - timeVal = timeVal / (1000 * 1000 * 1000) / 3600 * 3600 * (1000 * 1000 * 1000); + timeVal = timeVal / (1000000000) / 3600 * 3600 * (1000000000); } else if (tsDigits <= TSDB_TIME_PRECISION_SEC_DIGITS) { timeVal = timeVal * factor / factor / 3600 * 3600 * factor; } else { @@ -2085,9 +2085,9 @@ void vectorTimeFunc(int16_t functionId, tExprOperandInfo *pInputs, int32_t numIn if (tsDigits == TSDB_TIME_PRECISION_MILLI_DIGITS) { timeVal = timeVal / 1000 / 86400 * 86400 * 1000; } else if (tsDigits == TSDB_TIME_PRECISION_MICRO_DIGITS) { - timeVal = timeVal / (1000 * 1000) / 86400 * 86400 * (1000 * 1000); + timeVal = timeVal / (1000000) / 86400 * 86400 * (1000000); } else if (tsDigits == TSDB_TIME_PRECISION_NANO_DIGITS) { - timeVal = timeVal / (1000 * 1000 * 1000) / 86400 * 86400 * (1000 * 1000 * 1000); + timeVal = timeVal / (1000000000) / 86400 * 86400 * (1000000000); } else if (tsDigits <= TSDB_TIME_PRECISION_SEC_DIGITS) { timeVal = timeVal * factor / factor / 86400* 86400 * factor; } else { -- GitLab