Merge branch 'feature/2.0tsdb' of github.com:taosdata/TDengine into feature/2.0tsdb

This commit is contained in:
Hongze Cheng 2020-06-22 05:26:32 +00:00
commit 687f429936
4 changed files with 17 additions and 100 deletions

View File

@ -135,92 +135,6 @@ matrix:
# https://scan.coverity.com/faq#frequency # https://scan.coverity.com/faq#frequency
branch_pattern: coverity_scan branch_pattern: coverity_scan
- os: linux
dist: bionic
language: c
compiler: gcc
env: ENV_COVER=true
git:
- depth: 1
addons:
apt:
packages:
- build-essential
- cmake
- net-tools
- python-pip
- python-setuptools
- python3-pip
- python3-setuptools
- lcov
- psmisc
before_script:
- cd ${TRAVIS_BUILD_DIR}
- mkdir debug
- cd debug
script:
- cmake -DCOVER=true .. > /dev/null
- make > /dev/null
after_success:
- |-
case $TRAVIS_OS_NAME in
linux)
cd ${TRAVIS_BUILD_DIR}/debug
make install > /dev/null || travis_terminate $?
pip install numpy
pip install --user ${TRAVIS_BUILD_DIR}/src/connector/python/linux/python2/
pip3 install numpy
pip3 install --user ${TRAVIS_BUILD_DIR}/src/connector/python/linux/python3/
cd ${TRAVIS_BUILD_DIR}/tests
./test-all.sh smoke COVER
TEST_RESULT=$?
pkill taosd
sleep 1
cd ${TRAVIS_BUILD_DIR}
lcov -d . --capture --rc lcov_branch_coverage=1 -o coverage.info
lcov --remove coverage.info '*/tests/*' '*/test/*' '*/deps/*' '*/plugins/*' -o coverage.info
lcov -l --rc lcov_branch_coverage=1 coverage.info || travis_terminate $?
gem install coveralls-lcov
# Color setting
RED='\033[0;31m'
GREEN='\033[1;32m'
GREEN_DARK='\033[0;32m'
GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m'
coveralls-lcov coverage.info
if [ "$?" -eq "0" ]; then
echo -e "${GREEN} ## Uploaded to Coveralls.io! ## ${NC}"
else
echo -e "${RED} ## Coveralls.io not collect coverage report! ## ${NC} "
fi
bash <(curl -s https://codecov.io/bash) -y .codecov.yml -f coverage.info
if [ "$?" -eq "0" ]; then
echo -e "${GREEN} ## Uploaded to Codecov! ## ${NC} "
else
echo -e "${RED} ## Codecov did not collect coverage report! ## ${NC} "
fi
if [ "$TEST_RESULT" -ne "0" ]; then
travis_terminate $?
fi
;;
esac
- os: linux - os: linux
dist: trusty dist: trusty
language: c language: c

View File

@ -1,5 +1,6 @@
[![Build Status](https://travis-ci.org/taosdata/TDengine.svg?branch=master)](https://travis-ci.org/taosdata/TDengine) [![Build Status](https://travis-ci.org/taosdata/TDengine.svg?branch=master)](https://travis-ci.org/taosdata/TDengine)
[![Build status](https://ci.appveyor.com/api/projects/status/kf3pwh2or5afsgl9/branch/master?svg=true)](https://ci.appveyor.com/project/sangshuduo/tdengine-2n8ge/branch/master) [![Build status](https://ci.appveyor.com/api/projects/status/kf3pwh2or5afsgl9/branch/master?svg=true)](https://ci.appveyor.com/project/sangshuduo/tdengine-2n8ge/branch/master)
[![Coverage Status](https://coveralls.io/repos/github/taosdata/TDengine/badge.svg?branch=develop)](https://coveralls.io/github/taosdata/TDengine?branch=develop)
[![TDengine](TDenginelogo.png)](https://www.taosdata.com) [![TDengine](TDenginelogo.png)](https://www.taosdata.com)

View File

@ -46,18 +46,20 @@ static int32_t tscToInteger(SSQLToken *pToken, int64_t *value, char **endPtr) {
return TK_ILLEGAL; return TK_ILLEGAL;
} }
int32_t radix = 10; errno = 0;
*value = strtoll(pToken->z, endPtr, 0);
int32_t radixList[3] = {16, 8, 2}; // the integer number with different radix: hex, oct, bin if (**endPtr == 'e' || **endPtr == 'E' || **endPtr == '.') {
if (pToken->type == TK_HEX || pToken->type == TK_OCT || pToken->type == TK_BIN) { errno = 0;
radix = radixList[pToken->type - TK_HEX]; double v = round(strtod(pToken->z, endPtr));
if (v > INT64_MAX || v <= INT64_MIN) {
errno = ERANGE;
} else {
*value = v;
}
} }
errno = 0;
*value = strtoll(pToken->z, endPtr, radix);
// not a valid integer number, return error // not a valid integer number, return error
if ((pToken->type == TK_STRING || pToken->type == TK_ID) && ((*endPtr - pToken->z) != pToken->n)) { if (*endPtr - pToken->z != pToken->n) {
return TK_ILLEGAL; return TK_ILLEGAL;
} }
@ -73,11 +75,11 @@ static int32_t tscToDouble(SSQLToken *pToken, double *value, char **endPtr) {
*value = strtod(pToken->z, endPtr); *value = strtod(pToken->z, endPtr);
// not a valid integer number, return error // not a valid integer number, return error
if ((pToken->type == TK_STRING || pToken->type == TK_ID) && ((*endPtr - pToken->z) != pToken->n)) { if ((*endPtr - pToken->z) != pToken->n) {
return TK_ILLEGAL; return TK_ILLEGAL;
} else {
return pToken->type;
} }
return pToken->type;
} }
int tsParseTime(SSQLToken *pToken, int64_t *time, char **next, char *error, int16_t timePrec) { int tsParseTime(SSQLToken *pToken, int64_t *time, char **next, char *error, int16_t timePrec) {

View File

@ -213,10 +213,10 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_
SFileGroup *pFGroup = SFileGroup *pFGroup =
taosbsearch(&fid, pFileH->pFGroup, pFileH->nFGroups, sizeof(SFileGroup), keyFGroupCompFunc, TD_GE); taosbsearch(&fid, pFileH->pFGroup, pFileH->nFGroups, sizeof(SFileGroup), keyFGroupCompFunc, TD_GE);
if (pFGroup->fileId == fid) { if (pFGroup->fileId == fid) {
strcpy(fname, pFGroup->files[(*index) % 3].fname); fname = strdup(pFGroup->files[(*index) % 3].fname);
} else { } else {
if (pFGroup->fileId * 3 + 2 < eindex) { if (pFGroup->fileId * 3 + 2 < eindex) {
strcpy(fname, pFGroup->files[0].fname); fname = strdup(pFGroup->files[0].fname);
*index = pFGroup->fileId * 3; *index = pFGroup->fileId * 3;
} else { } else {
tfree(sdup); tfree(sdup);