Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
ea723900
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
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看板
未验证
提交
ea723900
编写于
9月 17, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
9月 17, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3545 from taosdata/hotfix/test
[TD-1472]
上级
1487bc58
46516d98
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
43 addition
and
33 deletion
+43
-33
alert/cmd/alert/install_driver.sh
alert/cmd/alert/install_driver.sh
+16
-19
alert/cmd/alert/main.go
alert/cmd/alert/main.go
+2
-2
alert/release.sh
alert/release.sh
+20
-7
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+2
-2
src/client/src/tscFunctionImpl.c
src/client/src/tscFunctionImpl.c
+2
-2
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+1
-1
未找到文件。
alert/cmd/alert/install_driver.sh
100644 → 100755
浏览文件 @
ea723900
...
@@ -9,9 +9,7 @@ set -e
...
@@ -9,9 +9,7 @@ set -e
script_dir
=
$(
dirname
$(
readlink
-f
"
$0
"
))
script_dir
=
$(
dirname
$(
readlink
-f
"
$0
"
))
# Dynamic directory
# Dynamic directory
lib_link_dir
=
"/usr/lib"
lib_link_dir
=
"/usr/lib"
lib64_link_dir
=
"/usr/lib64"
#install main path
install_main_dir
=
"/usr/local/taos"
# Color setting
# Color setting
RED
=
'\033[0;31m'
RED
=
'\033[0;31m'
...
@@ -25,24 +23,23 @@ if command -v sudo > /dev/null; then
...
@@ -25,24 +23,23 @@ if command -v sudo > /dev/null; then
csudo
=
"sudo"
csudo
=
"sudo"
fi
fi
function
clean_driver
()
{
${
csudo
}
rm
-f
/usr/lib/libtaos.so
||
:
}
function
install_driver
()
{
function
install_driver
()
{
echo
if
[[
-d
${
lib_link_dir
}
&&
!
-e
${
lib_link_dir
}
/libtaos.so
]]
;
then
echo
-e
"
${
GREEN
}
Start to install TDengine client driver ...
${
NC
}
"
echo
-e
"
${
GREEN
}
Start to install TDengine client driver ...
${
NC
}
"
${
csudo
}
ln
-s
${
script_dir
}
/driver/libtaos.
*
${
lib_link_dir
}
/libtaos.so.1
||
:
${
csudo
}
ln
-s
${
lib_link_dir
}
/libtaos.so.1
${
lib_link_dir
}
/libtaos.so
||
:
#create install main dir and all sub dir
if
[[
-d
${
lib64_link_dir
}
&&
!
-e
${
lib64_link_dir
}
/libtaos.so
]]
;
then
${
csudo
}
mkdir
-p
${
install_main_dir
}
${
csudo
}
ln
-s
${
script_dir
}
/driver/libtaos.
*
${
lib64_link_dir
}
/libtaos.so.1
||
:
${
csudo
}
mkdir
-p
${
install_main_dir
}
/driver
${
csudo
}
ln
-s
${
lib64_link_dir
}
/libtaos.so.1
${
lib64_link_dir
}
/libtaos.so
||
:
fi
${
csudo
}
rm
-f
${
lib_link_dir
}
/libtaos.
*
||
:
${
csudo
}
cp
-rf
${
script_dir
}
/driver/
*
${
install_main_dir
}
/driver
&&
${
csudo
}
chmod
777
${
install_main_dir
}
/driver/
*
${
csudo
}
ln
-s
${
install_main_dir
}
/driver/libtaos.
*
${
lib_link_dir
}
/libtaos.so.1
${
csudo
}
ln
-s
${
lib_link_dir
}
/libtaos.so.1
${
lib_link_dir
}
/libtaos.so
echo
echo
echo
-e
"
\0
33[44;32;1mTDengine client driver is successfully installed!
${
NC
}
"
echo
-e
"
${
GREEN
}
TDengine client driver is successfully installed!
${
NC
}
"
else
echo
-e
"
${
GREEN
}
TDengine client driver already exists, Please confirm whether the alert version matches the client driver version!
${
NC
}
"
fi
}
}
install_driver
install_driver
alert/cmd/alert/main.go
浏览文件 @
ea723900
...
@@ -119,7 +119,7 @@ WantedBy=multi-user.target
...
@@ -119,7 +119,7 @@ WantedBy=multi-user.target
return
nil
return
nil
}
}
const
version
=
"TDengine alert v2.0.0.1
"
var
version
=
"2.0.0.1s
"
func
main
()
{
func
main
()
{
var
(
var
(
...
@@ -133,7 +133,7 @@ func main() {
...
@@ -133,7 +133,7 @@ func main() {
flag
.
Parse
()
flag
.
Parse
()
if
showVersion
{
if
showVersion
{
fmt
.
Println
(
version
)
fmt
.
Println
(
"TDengine alert v"
+
version
)
return
return
}
}
...
...
alert/release.sh
浏览文件 @
ea723900
...
@@ -6,9 +6,9 @@ set -e
...
@@ -6,9 +6,9 @@ set -e
# set parameters by default value
# set parameters by default value
cpuType
=
amd64
# [armv6l | arm64 | amd64 | 386]
cpuType
=
amd64
# [armv6l | arm64 | amd64 | 386]
osType
=
linux
# [linux | darwin | windows]
osType
=
linux
# [linux | darwin | windows]
version
=
""
declare
-A
archMap
=([
"armv6l"
]=
"arm"
[
"arm64"
]=
"arm64"
[
"amd64"
]=
"x64"
[
"386"
]=
"x86"
)
declare
-A
archMap
=([
"armv6l"
]=
"arm"
[
"arm64"
]=
"arm64"
[
"amd64"
]=
"x64"
[
"386"
]=
"x86"
)
while
getopts
"h:c:o:"
arg
while
getopts
"h:c:o:
n:
"
arg
do
do
case
$arg
in
case
$arg
in
c
)
c
)
...
@@ -19,6 +19,10 @@ do
...
@@ -19,6 +19,10 @@ do
#echo "osType=$OPTARG"
#echo "osType=$OPTARG"
osType
=
$(
echo
$OPTARG
)
osType
=
$(
echo
$OPTARG
)
;;
;;
n
)
#echo "version=$OPTARG"
version
=
$(
echo
$OPTARG
)
;;
h
)
h
)
echo
"Usage:
`
basename
$0
`
-c [armv6l | arm64 | amd64 | 386] -o [linux | darwin | windows]"
echo
"Usage:
`
basename
$0
`
-c [armv6l | arm64 | amd64 | 386] -o [linux | darwin | windows]"
exit
0
exit
0
...
@@ -30,18 +34,27 @@ do
...
@@ -30,18 +34,27 @@ do
esac
esac
done
done
if
[
"
$version
"
==
""
]
;
then
echo
"Please input the correct version!"
exit
1
fi
startdir
=
$(
pwd
)
startdir
=
$(
pwd
)
scriptdir
=
$(
dirname
$(
readlink
-f
$0
))
scriptdir
=
$(
dirname
$(
readlink
-f
$0
))
cd
${
scriptdir
}
/cmd/alert
cd
${
scriptdir
}
/cmd/alert
version
=
$(
grep
'const version ='
main.go |
awk
'{print $NF}'
)
version
=
${
version
%\
"}
version=
${
version
:1
}
echo
"cpuType=
${
cpuType
}
"
echo
"cpuType=
${
cpuType
}
"
echo
"osType=
${
osType
}
"
echo
"osType=
${
osType
}
"
echo
"version=
${
version
}
"
echo
"version=
${
version
}
"
GOOS=
${
osType
}
GOARCH=
${
cpuType
}
go build
GOOS
=
${
osType
}
GOARCH
=
${
cpuType
}
go build
-ldflags
'-X main.version='
${
version
}
mkdir
-p
TDengine-alert/driver
cp
alert alert.cfg install_driver.sh ./TDengine-alert/.
cp
../../../debug/build/lib/libtaos.so.
${
version
}
./TDengine-alert/driver/.
chmod
777 ./TDengine-alert/install_driver.sh
tar
-I
'gzip -9'
-cf
${
startdir
}
/TDengine-alert-
${
version
}
-
${
osType
^
}
-
${
archMap
[
${
cpuType
}
]
}
.tar.gz TDengine-alert/
rm
-rf
./TDengine-alert
tar -I 'gzip -9' -cf
${
startdir
}
/TDengine-alert-
${
version
}
-
${
osType
^
}
-
${
archMap
[
${
cpuType
}
]
}
.tar.gz alert alert.cfg install_driver.sh driver/
src/client/inc/tsclient.h
浏览文件 @
ea723900
...
@@ -334,7 +334,7 @@ typedef struct STscObj {
...
@@ -334,7 +334,7 @@ typedef struct STscObj {
struct
SSqlStream
*
streamList
;
struct
SSqlStream
*
streamList
;
void
*
pDnodeConn
;
void
*
pDnodeConn
;
pthread_mutex_t
mutex
;
pthread_mutex_t
mutex
;
T_REF_DECLARE
()
;
T_REF_DECLARE
()
}
STscObj
;
}
STscObj
;
typedef
struct
SSqlObj
{
typedef
struct
SSqlObj
{
...
@@ -470,7 +470,7 @@ static FORCE_INLINE void tscGetResultColumnChr(SSqlRes* pRes, SFieldInfo* pField
...
@@ -470,7 +470,7 @@ static FORCE_INLINE void tscGetResultColumnChr(SSqlRes* pRes, SFieldInfo* pField
int32_t
type
=
pInfo
->
pSqlExpr
->
resType
;
int32_t
type
=
pInfo
->
pSqlExpr
->
resType
;
int32_t
bytes
=
pInfo
->
pSqlExpr
->
resBytes
;
int32_t
bytes
=
pInfo
->
pSqlExpr
->
resBytes
;
char
*
pData
=
pRes
->
data
+
pInfo
->
pSqlExpr
->
offset
*
pRes
->
numOfRows
+
bytes
*
pRes
->
row
;
char
*
pData
=
pRes
->
data
+
(
int32_t
)(
pInfo
->
pSqlExpr
->
offset
*
pRes
->
numOfRows
+
bytes
*
pRes
->
row
)
;
// user defined constant value output columns
// user defined constant value output columns
if
(
TSDB_COL_IS_UD_COL
(
pInfo
->
pSqlExpr
->
colInfo
.
flag
))
{
if
(
TSDB_COL_IS_UD_COL
(
pInfo
->
pSqlExpr
->
colInfo
.
flag
))
{
...
...
src/client/src/tscFunctionImpl.c
浏览文件 @
ea723900
...
@@ -2453,11 +2453,11 @@ static void percentile_function(SQLFunctionCtx *pCtx) {
...
@@ -2453,11 +2453,11 @@ static void percentile_function(SQLFunctionCtx *pCtx) {
if
(
pInfo
->
stage
==
0
)
{
if
(
pInfo
->
stage
==
0
)
{
if
(
pCtx
->
preAggVals
.
isSet
)
{
if
(
pCtx
->
preAggVals
.
isSet
)
{
if
(
pInfo
->
minval
>
pCtx
->
preAggVals
.
statis
.
min
)
{
if
(
pInfo
->
minval
>
pCtx
->
preAggVals
.
statis
.
min
)
{
pInfo
->
minval
=
pCtx
->
preAggVals
.
statis
.
min
;
pInfo
->
minval
=
(
double
)
pCtx
->
preAggVals
.
statis
.
min
;
}
}
if
(
pInfo
->
maxval
<
pCtx
->
preAggVals
.
statis
.
max
)
{
if
(
pInfo
->
maxval
<
pCtx
->
preAggVals
.
statis
.
max
)
{
pInfo
->
maxval
=
pCtx
->
preAggVals
.
statis
.
max
;
pInfo
->
maxval
=
(
double
)
pCtx
->
preAggVals
.
statis
.
max
;
}
}
pInfo
->
numOfElems
+=
(
pCtx
->
size
-
pCtx
->
preAggVals
.
statis
.
numOfNull
);
pInfo
->
numOfElems
+=
(
pCtx
->
size
-
pCtx
->
preAggVals
.
statis
.
numOfNull
);
...
...
src/client/src/tscSubquery.c
浏览文件 @
ea723900
...
@@ -1950,7 +1950,7 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
...
@@ -1950,7 +1950,7 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) {
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlRes
*
pRes
=
&
pSql
->
res
;
SSqlRes
*
pRes
=
&
pSql
->
res
;
pSql
->
numOfSubs
=
taosArrayGetSize
(
pCmd
->
pDataBlocks
);
pSql
->
numOfSubs
=
(
uint16_t
)
taosArrayGetSize
(
pCmd
->
pDataBlocks
);
assert
(
pSql
->
numOfSubs
>
0
);
assert
(
pSql
->
numOfSubs
>
0
);
pRes
->
code
=
TSDB_CODE_SUCCESS
;
pRes
->
code
=
TSDB_CODE_SUCCESS
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录