Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
王长生-AnH
TDengine
提交
90de932d
T
TDengine
项目概览
王长生-AnH
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
90de932d
编写于
6月 22, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/develop' into hotfix/crash
上级
8f1cee4a
49f625cd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
177 deletion
+19
-177
.travis.yml
.travis.yml
+0
-86
README.md
README.md
+1
-0
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+14
-12
src/os/linux/src/linuxPlatform.c
src/os/linux/src/linuxPlatform.c
+0
-77
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+2
-2
src/tsdb/src/tsdbMemTable.c
src/tsdb/src/tsdbMemTable.c
+2
-0
未找到文件。
.travis.yml
浏览文件 @
90de932d
...
...
@@ -135,92 +135,6 @@ matrix:
# https://scan.coverity.com/faq#frequency
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
dist
:
trusty
language
:
c
...
...
README.md
浏览文件 @
90de932d
[
![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)
[
![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)
...
...
src/client/src/tscParseInsert.c
浏览文件 @
90de932d
...
...
@@ -46,18 +46,20 @@ static int32_t tscToInteger(SSQLToken *pToken, int64_t *value, char **endPtr) {
return
TK_ILLEGAL
;
}
int32_t
radix
=
10
;
int32_t
radixList
[
3
]
=
{
16
,
8
,
2
};
// the integer number with different radix: hex, oct, bin
if
(
pToken
->
type
==
TK_HEX
||
pToken
->
type
==
TK_OCT
||
pToken
->
type
==
TK_BIN
)
{
radix
=
radixList
[
pToken
->
type
-
TK_HEX
];
}
errno
=
0
;
*
value
=
strtoll
(
pToken
->
z
,
endPtr
,
radix
);
*
value
=
strtoll
(
pToken
->
z
,
endPtr
,
0
);
if
(
**
endPtr
==
'e'
||
**
endPtr
==
'E'
||
**
endPtr
==
'.'
)
{
errno
=
0
;
double
v
=
round
(
strtod
(
pToken
->
z
,
endPtr
));
if
(
v
>
INT64_MAX
||
v
<=
INT64_MIN
)
{
errno
=
ERANGE
;
}
else
{
*
value
=
v
;
}
}
// 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
;
}
...
...
@@ -73,11 +75,11 @@ static int32_t tscToDouble(SSQLToken *pToken, double *value, char **endPtr) {
*
value
=
strtod
(
pToken
->
z
,
endPtr
);
// 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
;
}
else
{
return
pToken
->
type
;
}
return
pToken
->
type
;
}
int
tsParseTime
(
SSQLToken
*
pToken
,
int64_t
*
time
,
char
**
next
,
char
*
error
,
int16_t
timePrec
)
{
...
...
src/os/linux/src/linuxPlatform.c
浏览文件 @
90de932d
...
...
@@ -56,70 +56,8 @@ void taosMsleep(int mseconds) {
bool
taosCheckPthreadValid
(
pthread_t
thread
)
{
return
thread
!=
0
;
}
void
taosResetPthread
(
pthread_t
*
thread
)
{
*
thread
=
0
;
}
int64_t
taosGetPthreadId
()
{
return
(
int64_t
)
pthread_self
();
}
/*
* Function to get the private ip address of current machine. If get IP
* successfully, return 0, else, return -1. The return values is ip.
*
* Use:
* if (taosGetPrivateIp(ip) != 0) {
* perror("Fail to get private IP address\n");
* exit(EXIT_FAILURE);
* }
*/
int
taosGetPrivateIp
(
char
*
const
ip
)
{
bool
hasLoCard
=
false
;
struct
ifaddrs
*
ifaddr
,
*
ifa
;
int
family
,
s
;
char
host
[
NI_MAXHOST
];
if
(
getifaddrs
(
&
ifaddr
)
==
-
1
)
{
return
-
1
;
}
/* Walk through linked list, maintaining head pointer so we can free list later */
int
flag
=
0
;
for
(
ifa
=
ifaddr
;
ifa
!=
NULL
;
ifa
=
ifa
->
ifa_next
)
{
if
(
ifa
->
ifa_addr
==
NULL
)
continue
;
family
=
ifa
->
ifa_addr
->
sa_family
;
if
(
strcmp
(
"lo"
,
ifa
->
ifa_name
)
==
0
)
{
hasLoCard
=
true
;
continue
;
}
if
(
family
==
AF_INET
)
{
/* printf("%-8s", ifa->ifa_name); */
s
=
getnameinfo
(
ifa
->
ifa_addr
,
(
family
==
AF_INET
)
?
sizeof
(
struct
sockaddr_in
)
:
sizeof
(
struct
sockaddr_in6
),
host
,
NI_MAXHOST
,
NULL
,
0
,
NI_NUMERICHOST
);
if
(
s
!=
0
)
{
freeifaddrs
(
ifaddr
);
return
-
1
;
}
strcpy
(
ip
,
host
);
flag
=
1
;
break
;
}
}
freeifaddrs
(
ifaddr
);
if
(
flag
)
{
return
0
;
}
else
{
if
(
hasLoCard
)
{
uPrint
(
"no net card was found, use lo:127.0.0.1 as default"
);
strcpy
(
ip
,
"127.0.0.1"
);
return
0
;
}
return
-
1
;
}
}
int
taosSetNonblocking
(
int
sock
,
int
on
)
{
int
flags
=
0
;
if
((
flags
=
fcntl
(
sock
,
F_GETFL
,
0
))
<
0
)
{
...
...
@@ -294,21 +232,6 @@ ssize_t twrite(int fd, void *buf, size_t n) {
return
n
;
}
bool
taosSkipSocketCheck
()
{
struct
utsname
buf
;
if
(
uname
(
&
buf
))
{
uPrint
(
"can't fetch os info"
);
return
false
;
}
if
(
strstr
(
buf
.
release
,
"Microsoft"
)
!=
0
)
{
uPrint
(
"using WSLv1"
);
return
true
;
}
return
false
;
}
void
taosBlockSIGPIPE
()
{
sigset_t
signal_mask
;
sigemptyset
(
&
signal_mask
);
...
...
src/tsdb/src/tsdbMain.c
浏览文件 @
90de932d
...
...
@@ -213,10 +213,10 @@ uint32_t tsdbGetFileInfo(TSDB_REPO_T *repo, char *name, uint32_t *index, uint32_
SFileGroup
*
pFGroup
=
taosbsearch
(
&
fid
,
pFileH
->
pFGroup
,
pFileH
->
nFGroups
,
sizeof
(
SFileGroup
),
keyFGroupCompFunc
,
TD_GE
);
if
(
pFGroup
->
fileId
==
fid
)
{
strcpy
(
fname
,
pFGroup
->
files
[(
*
index
)
%
3
].
fname
);
fname
=
strdup
(
pFGroup
->
files
[(
*
index
)
%
3
].
fname
);
}
else
{
if
(
pFGroup
->
fileId
*
3
+
2
<
eindex
)
{
strcpy
(
fname
,
pFGroup
->
files
[
0
].
fname
);
fname
=
strdup
(
pFGroup
->
files
[
0
].
fname
);
*
index
=
pFGroup
->
fileId
*
3
;
}
else
{
tfree
(
sdup
);
...
...
src/tsdb/src/tsdbMemTable.c
浏览文件 @
90de932d
...
...
@@ -99,6 +99,7 @@ int tsdbInsertRowToMem(STsdbRepo *pRepo, SDataRow row, STable *pTable) {
if
(
tSkipListPut
(
pTableData
->
pData
,
pNode
)
==
NULL
)
{
tsdbFreeBytes
(
pRepo
,
(
void
*
)
pNode
,
bytes
);
}
else
{
if
(
TABLE_LASTKEY
(
pTable
)
<
key
)
TABLE_LASTKEY
(
pTable
)
=
key
;
if
(
pMemTable
->
keyFirst
>
key
)
pMemTable
->
keyFirst
=
key
;
if
(
pMemTable
->
keyLast
<
key
)
pMemTable
->
keyLast
=
key
;
pMemTable
->
numOfRows
++
;
...
...
@@ -586,6 +587,7 @@ static int tsdbCommitToFile(STsdbRepo *pRepo, int fid, SCommitIter *iters, SRWHe
goto
_err
;
}
tfree
(
dataDir
);
tsdbCloseHelperFile
(
pHelper
,
0
);
pthread_rwlock_wrlock
(
&
(
pFileH
->
fhlock
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录