From 1c24c3d04673b515a0999093aa4b51b6241b2d55 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sat, 3 Jul 2021 10:17:59 +0800 Subject: [PATCH] [td-225] fix compiler error. --- src/mnode/src/mnodeTable.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mnode/src/mnodeTable.c b/src/mnode/src/mnodeTable.c index 4c5ee032b7..b36fb3155c 100644 --- a/src/mnode/src/mnodeTable.c +++ b/src/mnode/src/mnodeTable.c @@ -1069,7 +1069,7 @@ static int32_t mnodeProcessCreateSuperTableMsg(SMnodeMsg *pMsg) { pStable->info.type = TSDB_SUPER_TABLE; pStable->createdTime = taosGetTimestampMs(); - uint64_t x = (us & ((1ul<<40) - 1)); // todo refactor + uint64_t x = (us & ((((uint64_t)1)<<40) - 1)); // todo refactor x = x << 24; pStable->uid = x + ((sdbGetVersion() & ((1ul << 16) - 1ul)) << 8) + (taosRand() & ((1ul << 8) - 1ul)); @@ -2080,9 +2080,11 @@ static int32_t mnodeDoCreateChildTable(SMnodeMsg *pMsg, int32_t tid) { pTable->superTable = pMsg->pSTable; } else { if (pTable->info.type == TSDB_SUPER_TABLE) { - int64_t us = taosGetTimestampUs(); - uint64_t x = (us&0x000000FFFFFFFFFF); - x = x<<24; + uint64_t us = (uint64_t) taosGetTimestampUs(); + + uint64_t x = (us & ((((uint64_t)1)<<40) - 1)); + x = x << 24; + pTable->uid = x + ((sdbGetVersion() & ((1ul << 16) - 1ul)) << 8) + (taosRand() & ((1ul << 8) - 1ul)); } else { pTable->uid = (((uint64_t)pTable->vgId) << 48) + ((((uint64_t)pTable->tid) & ((1ul << 24) - 1ul)) << 24) + -- GitLab