From f84c727b695eb41d6e8a8cb7d93292bd1a8ccc0a Mon Sep 17 00:00:00 2001 From: Bomin Zhang Date: Tue, 23 Jun 2020 11:14:54 +0800 Subject: [PATCH 1/2] td-720: remove oct number support --- src/client/src/tscParseInsert.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index 4bfdca882c..b3c9d7981a 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -46,8 +46,16 @@ static int32_t tscToInteger(SSQLToken *pToken, int64_t *value, char **endPtr) { return TK_ILLEGAL; } + + int32_t radix = 10; + if (pToken->type == TK_HEX) { + radix = 16; + } else if (pToken->type == TK_BIN) { + radix = 2; + } + errno = 0; - *value = strtoll(pToken->z, endPtr, 0); + *value = strtoll(pToken->z, endPtr, radix); if (**endPtr == 'e' || **endPtr == 'E' || **endPtr == '.') { errno = 0; double v = round(strtod(pToken->z, endPtr)); From 10a1be900f1e503a002162b9afaf31ab4473c975 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 23 Jun 2020 11:36:43 +0800 Subject: [PATCH 2/2] [td-225] opt destroy function of skiplist --- src/util/src/tskiplist.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/util/src/tskiplist.c b/src/util/src/tskiplist.c index 3a474fe6c1..2394adc6f3 100644 --- a/src/util/src/tskiplist.c +++ b/src/util/src/tskiplist.c @@ -194,13 +194,12 @@ void *tSkipListDestroy(SSkipList *pSkipList) { pthread_rwlock_wrlock(pSkipList->lock); } - SSkipListNode *pNode = SL_GET_FORWARD_POINTER(pSkipList->pHead, 0); + if (pSkipList->keyInfo.freeNode) { + SSkipListNode *pNode = SL_GET_FORWARD_POINTER(pSkipList->pHead, 0); - while (pNode != pSkipList->pTail) { - SSkipListNode *pTemp = pNode; - pNode = SL_GET_FORWARD_POINTER(pNode, 0); - - if (pSkipList->keyInfo.freeNode) { + while (pNode != pSkipList->pTail) { + SSkipListNode *pTemp = pNode; + pNode = SL_GET_FORWARD_POINTER(pNode, 0); tfree(pTemp); } }