Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Tonvia
TDengine
提交
e58f758b
T
TDengine
项目概览
Tonvia
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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,发现更多精彩内容 >>
提交
e58f758b
编写于
6月 19, 2020
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into feature/2.0tsdb
上级
dc1a04e6
ae360ecb
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
98 addition
and
58 deletion
+98
-58
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+6
-5
src/client/src/tscServer.c
src/client/src/tscServer.c
+2
-2
src/client/src/tscSql.c
src/client/src/tscSql.c
+1
-1
src/inc/trpc.h
src/inc/trpc.h
+1
-1
src/plugins/http/src/gcHandle.c
src/plugins/http/src/gcHandle.c
+2
-2
src/plugins/http/src/httpAuth.c
src/plugins/http/src/httpAuth.c
+1
-0
src/plugins/http/src/httpJson.c
src/plugins/http/src/httpJson.c
+7
-8
src/plugins/http/src/httpUtil.c
src/plugins/http/src/httpUtil.c
+1
-2
src/plugins/http/src/restHandle.c
src/plugins/http/src/restHandle.c
+2
-2
src/plugins/http/src/tgHandle.c
src/plugins/http/src/tgHandle.c
+4
-3
src/plugins/monitor/src/monitorMain.c
src/plugins/monitor/src/monitorMain.c
+1
-1
src/plugins/mqtt/src/mqttSystem.c
src/plugins/mqtt/src/mqttSystem.c
+1
-1
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+61
-22
src/util/inc/tutil.h
src/util/inc/tutil.h
+1
-1
src/util/src/tutil.c
src/util/src/tutil.c
+6
-6
tests/comparisonTest/opentsdb/opentsdbtest/pom.xml
tests/comparisonTest/opentsdb/opentsdbtest/pom.xml
+1
-1
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
e58f758b
...
...
@@ -294,11 +294,12 @@ typedef struct STscObj {
}
STscObj
;
typedef
struct
SSqlObj
{
void
*
signature
;
STscObj
*
pTscObj
;
void
(
*
fp
)();
void
(
*
fetchFp
)();
void
*
param
;
void
*
signature
;
STscObj
*
pTscObj
;
void
*
SRpcReqContext
;
void
(
*
fp
)();
void
(
*
fetchFp
)();
void
*
param
;
int64_t
stime
;
uint32_t
queryId
;
void
*
pStream
;
...
...
src/client/src/tscServer.c
浏览文件 @
e58f758b
...
...
@@ -196,8 +196,8 @@ int tscSendMsgToServer(SSqlObj *pSql) {
.
handle
=
pSql
,
.
code
=
0
};
rpcSendRequest
(
pObj
->
pDnodeConn
,
&
pSql
->
ipList
,
&
rpcMsg
);
pSql
->
SRpcReqContext
=
rpcSendRequest
(
pObj
->
pDnodeConn
,
&
pSql
->
ipList
,
&
rpcMsg
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -422,7 +422,7 @@ void tscKillSTableQuery(SSqlObj *pSql) {
* sub-queries not correctly released and master sql object of super table query reaches an abnormal state.
*/
pSql
->
pSubs
[
i
]
->
res
.
code
=
TSDB_CODE_TSC_QUERY_CANCELLED
;
// taosStopRpcConn(pSql->pSubs[i]->
);
rpcCancelRequest
(
pSql
->
pSubs
[
i
]
->
SRpcReqContext
);
}
/*
...
...
src/client/src/tscSql.c
浏览文件 @
e58f758b
...
...
@@ -627,7 +627,7 @@ void taos_stop_query(TAOS_RES *res) {
return
;
}
//taosStopRpcConn(pSql->thandle
);
rpcCancelRequest
(
pSql
->
SRpcReqContext
);
tscTrace
(
"%p query is cancelled"
,
res
);
}
...
...
src/inc/trpc.h
浏览文件 @
e58f758b
...
...
@@ -84,7 +84,7 @@ void rpcSendRedirectRsp(void *pConn, const SRpcIpSet *pIpSet);
int
rpcGetConnInfo
(
void
*
thandle
,
SRpcConnInfo
*
pInfo
);
void
rpcSendRecv
(
void
*
shandle
,
SRpcIpSet
*
pIpSet
,
const
SRpcMsg
*
pReq
,
SRpcMsg
*
pRsp
);
int
rpcReportProgress
(
void
*
pConn
,
char
*
pCont
,
int
contLen
);
void
rpcCanelRequest
(
void
*
pContext
);
void
rpcCan
c
elRequest
(
void
*
pContext
);
#ifdef __cplusplus
}
...
...
src/plugins/http/src/gcHandle.c
浏览文件 @
e58f758b
...
...
@@ -52,7 +52,7 @@ bool gcGetUserFromUrl(HttpContext* pContext) {
return
false
;
}
strcpy
(
pContext
->
user
,
pParser
->
path
[
GC_USER_URL_POS
].
pos
);
tstrncpy
(
pContext
->
user
,
pParser
->
path
[
GC_USER_URL_POS
].
pos
,
TSDB_USER_LEN
);
return
true
;
}
...
...
@@ -62,7 +62,7 @@ bool gcGetPassFromUrl(HttpContext* pContext) {
return
false
;
}
strcpy
(
pContext
->
pass
,
pParser
->
path
[
GC_PASS_URL_POS
].
pos
);
tstrncpy
(
pContext
->
pass
,
pParser
->
path
[
GC_PASS_URL_POS
].
pos
,
TSDB_PASSWORD_LEN
);
return
true
;
}
...
...
src/plugins/http/src/httpAuth.c
浏览文件 @
e58f758b
...
...
@@ -29,6 +29,7 @@ bool httpParseBasicAuthToken(HttpContext *pContext, char *token, int len) {
char
*
base64
=
(
char
*
)
base64_decode
(
token
,
len
,
&
outlen
);
if
(
base64
==
NULL
||
outlen
==
0
)
{
httpError
(
"context:%p, fd:%d, ip:%s, basic token:%s parsed error"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
token
);
free
(
base64
);
return
false
;
}
...
...
src/plugins/http/src/httpJson.c
浏览文件 @
e58f758b
...
...
@@ -442,14 +442,13 @@ void httpJsonPairStatus(JsonBuf* buf, int code) {
httpJsonPair
(
buf
,
"status"
,
6
,
"error"
,
5
);
httpJsonItemToken
(
buf
);
httpJsonPairIntVal
(
buf
,
"code"
,
4
,
code
);
if
(
code
>=
0
)
{
httpJsonItemToken
(
buf
);
if
(
code
==
TSDB_CODE_MND_DB_NOT_SELECTED
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create database"
,
23
);
}
else
if
(
code
==
TSDB_CODE_MND_INVALID_TABLE_NAME
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create table"
,
22
);
}
else
httpJsonPair
(
buf
,
"desc"
,
4
,
(
char
*
)
tstrerror
(
code
),
(
int
)
strlen
(
tstrerror
(
code
)));
httpJsonItemToken
(
buf
);
if
(
code
==
TSDB_CODE_MND_DB_NOT_SELECTED
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create database"
,
23
);
}
else
if
(
code
==
TSDB_CODE_MND_INVALID_TABLE_NAME
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create table"
,
22
);
}
else
{
httpJsonPair
(
buf
,
"desc"
,
4
,
(
char
*
)
tstrerror
(
code
),
(
int
)
strlen
(
tstrerror
(
code
)));
}
}
}
src/plugins/http/src/httpUtil.c
浏览文件 @
e58f758b
...
...
@@ -202,8 +202,7 @@ bool httpReMallocMultiCmdsSize(HttpContext *pContext, int cmdSize) {
pContext
->
user
,
cmdSize
);
return
false
;
}
memset
(
multiCmds
->
cmds
+
multiCmds
->
maxSize
*
(
int16_t
)
sizeof
(
HttpSqlCmd
),
0
,
(
size_t
)(
cmdSize
-
multiCmds
->
maxSize
)
*
sizeof
(
HttpSqlCmd
));
memset
(
multiCmds
->
cmds
+
multiCmds
->
maxSize
,
0
,
(
size_t
)(
cmdSize
-
multiCmds
->
maxSize
)
*
sizeof
(
HttpSqlCmd
));
multiCmds
->
maxSize
=
(
int16_t
)
cmdSize
;
return
true
;
...
...
src/plugins/http/src/restHandle.c
浏览文件 @
e58f758b
...
...
@@ -65,7 +65,7 @@ bool restGetUserFromUrl(HttpContext* pContext) {
return
false
;
}
strcpy
(
pContext
->
user
,
pParser
->
path
[
REST_USER_URL_POS
].
pos
);
tstrncpy
(
pContext
->
user
,
pParser
->
path
[
REST_USER_URL_POS
].
pos
,
TSDB_USER_LEN
);
return
true
;
}
...
...
@@ -75,7 +75,7 @@ bool restGetPassFromUrl(HttpContext* pContext) {
return
false
;
}
strcpy
(
pContext
->
pass
,
pParser
->
path
[
REST_PASS_URL_POS
].
pos
);
tstrncpy
(
pContext
->
pass
,
pParser
->
path
[
REST_PASS_URL_POS
].
pos
,
TSDB_PASSWORD_LEN
);
return
true
;
}
...
...
src/plugins/http/src/tgHandle.c
浏览文件 @
e58f758b
...
...
@@ -268,10 +268,10 @@ int tgReadSchema(char *fileName) {
httpPrint
(
"open telegraf schema file:%s success"
,
fileName
);
fseek
(
fp
,
0
,
SEEK_END
);
size_t
contentSize
=
(
size
_t
)
ftell
(
fp
);
int32_t
contentSize
=
(
int32
_t
)
ftell
(
fp
);
rewind
(
fp
);
char
*
content
=
(
char
*
)
calloc
(
contentSize
*
sizeof
(
char
)
+
1
,
1
);
size
_t
result
=
fread
(
content
,
1
,
contentSize
,
fp
);
char
*
content
=
(
char
*
)
calloc
(
contentSize
+
1
,
1
);
int32
_t
result
=
fread
(
content
,
1
,
contentSize
,
fp
);
if
(
result
!=
contentSize
)
{
httpError
(
"failed to read telegraf schema file:%s"
,
fileName
);
fclose
(
fp
);
...
...
@@ -279,6 +279,7 @@ int tgReadSchema(char *fileName) {
return
-
1
;
}
content
[
contentSize
]
=
0
;
int
schemaNum
=
tgParseSchema
(
content
,
fileName
);
free
(
content
);
...
...
src/plugins/monitor/src/monitorMain.c
浏览文件 @
e58f758b
...
...
@@ -61,7 +61,7 @@ typedef struct {
char
ep
[
TSDB_EP_LEN
];
int8_t
cmdIndex
;
int8_t
state
;
char
sql
[
SQL_LENGTH
];
char
sql
[
SQL_LENGTH
+
1
];
void
*
initTimer
;
void
*
diskTimer
;
}
SMonitorConn
;
...
...
src/plugins/mqtt/src/mqttSystem.c
浏览文件 @
e58f758b
...
...
@@ -164,7 +164,7 @@ void mqtt_PublishCallback(void** unused, struct mqtt_response_publish* published
void
*
mqttClientRefresher
(
void
*
client
)
{
while
(
mttIsRuning
)
{
mqtt_sync
((
struct
mqtt_client
*
)
client
);
usleep
(
100000U
);
taosMsleep
(
100
);
}
mqttPrint
(
"Exit mqttClientRefresher"
);
return
NULL
;
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
e58f758b
...
...
@@ -798,38 +798,77 @@ static int32_t copyDataFromFileBlock(STsdbQueryHandle* pQueryHandle, int32_t cap
int32_t
requiredNumOfCols
=
taosArrayGetSize
(
pQueryHandle
->
pColumns
);
//data in buffer has greater timestamp, copy data in file block
for
(
int32_t
i
=
0
;
i
<
requiredNumOfCols
;
++
i
)
{
int32_t
i
=
0
,
j
=
0
;
while
(
i
<
requiredNumOfCols
&&
j
<
pCols
->
numOfCols
)
{
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pQueryHandle
->
pColumns
,
i
);
int32_t
bytes
=
pColInfo
->
info
.
bytes
;
SDataCol
*
src
=
&
pCols
->
cols
[
j
];
if
(
src
->
colId
<
pColInfo
->
info
.
colId
)
{
j
++
;
continue
;
}
int32_t
bytes
=
pColInfo
->
info
.
bytes
;
if
(
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
))
{
pData
=
pColInfo
->
pData
+
numOfRows
*
pColInfo
->
info
.
bytes
;
}
else
{
pData
=
pColInfo
->
pData
+
(
capacity
-
numOfRows
-
num
)
*
pColInfo
->
info
.
bytes
;
}
for
(
int32_t
j
=
0
;
j
<
pCols
->
numOfCols
;
++
j
)
{
// todo opt performance
SDataCol
*
src
=
&
pCols
->
cols
[
j
];
if
(
pColInfo
->
info
.
colId
==
src
->
colId
)
{
if
(
pColInfo
->
info
.
type
!=
TSDB_DATA_TYPE_BINARY
&&
pColInfo
->
info
.
type
!=
TSDB_DATA_TYPE_NCHAR
)
{
memmove
(
pData
,
src
->
pData
+
bytes
*
start
,
bytes
*
num
);
}
else
{
// handle the var-string
char
*
dst
=
pData
;
// todo refactor, only copy one-by-one
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
)
{
char
*
p
=
tdGetColDataOfRow
(
src
,
k
);
memcpy
(
dst
,
p
,
varDataTLen
(
p
));
dst
+=
bytes
;
}
if
(
pColInfo
->
info
.
colId
==
src
->
colId
)
{
if
(
pColInfo
->
info
.
type
!=
TSDB_DATA_TYPE_BINARY
&&
pColInfo
->
info
.
type
!=
TSDB_DATA_TYPE_NCHAR
)
{
memmove
(
pData
,
src
->
pData
+
bytes
*
start
,
bytes
*
num
);
}
else
{
// handle the var-string
char
*
dst
=
pData
;
// todo refactor, only copy one-by-one
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
)
{
char
*
p
=
tdGetColDataOfRow
(
src
,
k
);
memcpy
(
dst
,
p
,
varDataTLen
(
p
));
dst
+=
bytes
;
}
break
;
}
j
++
;
i
++
;
}
else
{
// pColInfo->info.colId < src->colId, it is a NULL data
if
(
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_BINARY
||
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_NCHAR
)
{
char
*
dst
=
pData
;
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
)
{
setVardataNull
(
dst
,
pColInfo
->
info
.
type
);
dst
+=
bytes
;
}
}
else
{
setNullN
(
pData
,
pColInfo
->
info
.
type
,
pColInfo
->
info
.
bytes
,
num
);
}
i
++
;
}
}
while
(
i
<
requiredNumOfCols
)
{
// the remain columns are all null data
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pQueryHandle
->
pColumns
,
i
);
if
(
ASCENDING_TRAVERSE
(
pQueryHandle
->
order
))
{
pData
=
pColInfo
->
pData
+
numOfRows
*
pColInfo
->
info
.
bytes
;
}
else
{
pData
=
pColInfo
->
pData
+
(
capacity
-
numOfRows
-
num
)
*
pColInfo
->
info
.
bytes
;
}
if
(
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_BINARY
||
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_NCHAR
)
{
char
*
dst
=
pData
;
for
(
int32_t
k
=
start
;
k
<
num
+
start
;
++
k
)
{
setVardataNull
(
dst
,
pColInfo
->
info
.
type
);
dst
+=
pColInfo
->
info
.
bytes
;
}
}
else
{
setNullN
(
pData
,
pColInfo
->
info
.
type
,
pColInfo
->
info
.
bytes
,
num
);
}
i
++
;
}
pQueryHandle
->
cur
.
win
.
ekey
=
tsArray
[
end
];
pQueryHandle
->
cur
.
lastKey
=
tsArray
[
end
]
+
step
;
...
...
src/util/inc/tutil.h
浏览文件 @
e58f758b
...
...
@@ -117,7 +117,7 @@ extern "C" {
#define POW2(x) ((x) * (x))
in
t
taosRand
(
void
);
uint32_
t
taosRand
(
void
);
int32_t
strdequote
(
char
*
src
);
...
...
src/util/src/tutil.c
浏览文件 @
e58f758b
...
...
@@ -29,12 +29,12 @@
#ifdef WINDOWS
in
t
taosRand
(
void
)
uint32_
t
taosRand
(
void
)
{
return
rand
();
}
#else
in
t
taosRand
(
void
)
uint32_
t
taosRand
(
void
)
{
int
fd
;
int
seed
;
...
...
@@ -50,7 +50,7 @@ int taosRand(void)
close
(
fd
);
}
return
seed
;
return
(
uint32_t
)
seed
;
}
#endif
...
...
@@ -474,9 +474,9 @@ void getTmpfilePath(const char *fileNamePrefix, char *dstPath) {
void
taosRandStr
(
char
*
str
,
int32_t
size
)
{
const
char
*
set
=
"abcdefghijklmnopqrstuvwxyz0123456789-_."
;
int32_t
len
=
39
;
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
str
[
i
]
=
set
[
taosRand
()
%
len
];
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
str
[
i
]
=
set
[
taosRand
()
%
len
];
}
}
...
...
tests/comparisonTest/opentsdb/opentsdbtest/pom.xml
浏览文件 @
e58f758b
...
...
@@ -118,7 +118,7 @@
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
<version>
2.
9.10.4
</version>
<version>
2.
10.0.pr1
</version>
</dependency>
<dependency>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录