Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
e83fd504
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看板
提交
e83fd504
编写于
6月 18, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix some coverity issues
上级
c1968083
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
25 addition
and
20 deletion
+25
-20
src/client/src/TSDBJNIConnector.c
src/client/src/TSDBJNIConnector.c
+1
-1
src/client/src/tscServer.c
src/client/src/tscServer.c
+6
-8
src/client/src/tscSql.c
src/client/src/tscSql.c
+6
-1
src/client/src/tscStream.c
src/client/src/tscStream.c
+3
-3
src/client/src/tscSub.c
src/client/src/tscSub.c
+5
-3
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+2
-2
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+2
-2
未找到文件。
src/client/src/TSDBJNIConnector.c
浏览文件 @
e83fd504
...
...
@@ -192,7 +192,7 @@ JNIEXPORT jint JNICALL Java_com_taosdata_jdbc_TSDBJNIConnector_setOptions(JNIEnv
const
char
*
tz1
=
(
*
env
)
->
GetStringUTFChars
(
env
,
optionValue
,
NULL
);
if
(
tz1
&&
strlen
(
tz1
)
!=
0
)
{
res
=
taos_options
(
TSDB_OPTION_TIMEZONE
,
tz1
);
jniTrace
(
"set timezone to %s, result:%d"
,
t
imezone
,
res
);
jniTrace
(
"set timezone to %s, result:%d"
,
t
z1
,
res
);
}
else
{
jniTrace
(
"input timezone is empty"
);
}
...
...
src/client/src/tscServer.c
浏览文件 @
e83fd504
...
...
@@ -646,10 +646,6 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
size_t
numOfOutput
=
tscSqlExprNumOfExprs
(
pQueryInfo
);
pQueryMsg
->
numOfOutput
=
htons
(
numOfOutput
);
if
(
numOfOutput
<
0
)
{
tscError
(
"%p illegal value of number of output columns in query msg: %d"
,
pSql
,
numOfOutput
);
return
-
1
;
}
// set column list ids
size_t
numOfCols
=
taosArrayGetSize
(
pQueryInfo
->
colList
);
...
...
@@ -663,7 +659,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
if
(
pCol
->
colIndex
.
columnIndex
>=
tscGetNumOfColumns
(
pTableMeta
)
||
pColSchema
->
type
<
TSDB_DATA_TYPE_BOOL
||
pColSchema
->
type
>
TSDB_DATA_TYPE_NCHAR
)
{
tscError
(
"%p sid:%d uid:%"
PRIu64
" id:%s, column index out of range, numOfColumns:%d, index:%d, column name:%s"
,
pSql
,
pTableMeta
->
sid
,
pTableMeta
->
uid
,
pTableMetaInfo
->
name
,
tscGetNumOfColumns
(
pTableMeta
),
pCol
->
colIndex
,
pSql
,
pTableMeta
->
sid
,
pTableMeta
->
uid
,
pTableMetaInfo
->
name
,
tscGetNumOfColumns
(
pTableMeta
),
pCol
->
colIndex
.
columnIndex
,
pColSchema
->
name
);
return
TSDB_CODE_TSC_INVALID_SQL
;
...
...
@@ -783,7 +779,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
(
pColSchema
->
type
<
TSDB_DATA_TYPE_BOOL
||
pColSchema
->
type
>
TSDB_DATA_TYPE_NCHAR
))
{
tscError
(
"%p sid:%d uid:%"
PRIu64
" id:%s, tag index out of range, totalCols:%d, numOfTags:%d, index:%d, column name:%s"
,
pSql
,
pTableMeta
->
sid
,
pTableMeta
->
uid
,
pTableMetaInfo
->
name
,
total
,
numOfTagColumns
,
pCol
->
colIndex
,
pColSchema
->
name
);
pCol
->
colIndex
.
columnIndex
,
pColSchema
->
name
);
return
TSDB_CODE_TSC_INVALID_SQL
;
}
...
...
@@ -982,7 +978,7 @@ int32_t tscBuildDropDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SCMDropDbMsg
*
pDropDbMsg
=
(
SCMDropDbMsg
*
)
pCmd
->
payload
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
strncpy
(
pDropDbMsg
->
db
,
pTableMetaInfo
->
name
,
tListLen
(
pDropDbMsg
->
db
));
tstrncpy
(
pDropDbMsg
->
db
,
pTableMetaInfo
->
name
,
sizeof
(
pDropDbMsg
->
db
));
pDropDbMsg
->
ignoreNotExists
=
pInfo
->
pDCLInfo
->
existsCheck
?
1
:
0
;
pCmd
->
msgType
=
TSDB_MSG_TYPE_CM_DROP_DB
;
...
...
@@ -1052,7 +1048,7 @@ int32_t tscBuildDropAcctMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SCMDropUserMsg
*
pDropMsg
=
(
SCMDropUserMsg
*
)
pCmd
->
payload
;
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
strcpy
(
pDropMsg
->
user
,
pTableMetaInfo
->
name
);
tstrncpy
(
pDropMsg
->
user
,
pTableMetaInfo
->
name
,
sizeof
(
pDropMsg
->
user
)
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1812,6 +1808,7 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
// todo handle out of memory case
if
(
pTableMetaInfo
->
pTableMeta
==
NULL
)
{
free
(
pTableMeta
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
...
...
@@ -2324,6 +2321,7 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) {
SQueryInfo
*
pNewQueryInfo
=
NULL
;
if
((
code
=
tscGetQueryInfoDetailSafely
(
&
pNew
->
cmd
,
0
,
&
pNewQueryInfo
))
!=
TSDB_CODE_SUCCESS
)
{
tscFreeSqlObj
(
pNew
);
return
code
;
}
...
...
src/client/src/tscSql.c
浏览文件 @
e83fd504
...
...
@@ -584,7 +584,7 @@ char *taos_errstr(TAOS_RES *tres) {
void
taos_config
(
int
debug
,
char
*
log_path
)
{
uDebugFlag
=
debug
;
strcpy
(
tsLogDir
,
log_path
);
tstrncpy
(
tsLogDir
,
log_path
,
TSDB_FILENAME_LEN
);
}
char
*
taos_get_server_info
(
TAOS
*
taos
)
{
...
...
@@ -719,6 +719,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
if
(
sqlLen
>
tsMaxSQLStringLen
)
{
tscError
(
"%p sql too long"
,
pSql
);
pRes
->
code
=
TSDB_CODE_TSC_INVALID_SQL
;
tfree
(
pSql
);
return
pRes
->
code
;
}
...
...
@@ -727,6 +728,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
pRes
->
code
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
tscError
(
"%p failed to malloc sql string buffer"
,
pSql
);
tscTrace
(
"%p Valid SQL result:%d, %s pObj:%p"
,
pSql
,
pRes
->
code
,
taos_errstr
(
taos
),
pObj
);
tfree
(
pSql
);
return
pRes
->
code
;
}
...
...
@@ -851,6 +853,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
if
(
tblListLen
>
MAX_TABLE_NAME_LENGTH
)
{
tscError
(
"%p tableNameList too long, length:%d, maximum allowed:%d"
,
pSql
,
tblListLen
,
MAX_TABLE_NAME_LENGTH
);
pRes
->
code
=
TSDB_CODE_TSC_INVALID_SQL
;
tfree
(
pSql
);
return
pRes
->
code
;
}
...
...
@@ -858,6 +861,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
if
(
str
==
NULL
)
{
pRes
->
code
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
tscError
(
"%p failed to malloc sql string buffer"
,
pSql
);
tfree
(
pSql
);
return
pRes
->
code
;
}
...
...
@@ -873,6 +877,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
free
(
str
);
if
(
pRes
->
code
!=
TSDB_CODE_SUCCESS
)
{
tscFreeSqlObj
(
pSql
);
return
pRes
->
code
;
}
...
...
src/client/src/tscStream.c
浏览文件 @
e83fd504
...
...
@@ -125,7 +125,7 @@ static void tscProcessStreamTimer(void *handle, void *tmrId) {
}
// launch stream computing in a new thread
SSchedMsg
schedMsg
;
SSchedMsg
schedMsg
=
{
0
}
;
schedMsg
.
fp
=
tscProcessStreamLaunchQuery
;
schedMsg
.
ahandle
=
pStream
;
schedMsg
.
thandle
=
(
void
*
)
1
;
...
...
@@ -239,7 +239,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
/* no resuls in the query range, retry */
// todo set retry dynamic time
int32_t
retry
=
tsProjectExecInterval
;
tscError
(
"%p stream:%p, retrieve no data, code:%d, retry in %"
PRId
64
"ms"
,
pSql
,
pStream
,
numOfRows
,
retry
);
tscError
(
"%p stream:%p, retrieve no data, code:%d, retry in %"
PRId
32
"ms"
,
pSql
,
pStream
,
numOfRows
,
retry
);
tscSetRetryTimer
(
pStream
,
pStream
->
pSql
,
retry
);
return
;
...
...
@@ -250,7 +250,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
}
}
tscTrace
(
"%p stream:%p, query on:%s, fetch result completed, fetched rows:%
d"
,
pSql
,
pStream
,
pTableMetaInfo
->
name
,
tscTrace
(
"%p stream:%p, query on:%s, fetch result completed, fetched rows:%
"
PRId64
,
pSql
,
pStream
,
pTableMetaInfo
->
name
,
pStream
->
numOfRes
);
// release the metric/meter meta information reference, so data in cache can be updated
...
...
src/client/src/tscSub.c
浏览文件 @
e83fd504
...
...
@@ -291,7 +291,7 @@ static int tscLoadSubscriptionProgress(SSub* pSub) {
fclose
(
fp
);
taosArraySort
(
progress
,
tscCompareSubscriptionProgress
);
tscTrace
(
"subscription progress loaded, %
d
tables: %s"
,
taosArrayGetSize
(
progress
),
pSub
->
topic
);
tscTrace
(
"subscription progress loaded, %
z
tables: %s"
,
taosArrayGetSize
(
progress
),
pSub
->
topic
);
return
1
;
}
...
...
@@ -350,7 +350,7 @@ TAOS_SUB *taos_subscribe(TAOS *taos, int restart, const char* topic, const char
pSub
->
interval
=
interval
;
if
(
fp
!=
NULL
)
{
tscTrace
(
"asynchronize subscription, create new timer"
,
topic
);
tscTrace
(
"asynchronize subscription, create new timer
: %s
"
,
topic
);
pSub
->
fp
=
fp
;
pSub
->
param
=
param
;
taosTmrReset
(
tscProcessSubscriptionTimer
,
interval
,
pSub
,
tscTmr
,
&
pSub
->
pTimer
);
...
...
@@ -435,7 +435,9 @@ void taos_unsubscribe(TAOS_SUB *tsub, int keepProgress) {
}
else
{
char
path
[
256
];
sprintf
(
path
,
"%s/subscribe/%s"
,
tsDataDir
,
pSub
->
topic
);
remove
(
path
);
if
(
remove
(
path
)
!=
0
)
{
tscError
(
"failed to remove progress file, topic = %s, error = %s"
,
pSub
->
topic
,
strerror
(
errno
));
}
}
tscFreeSqlObj
(
pSub
->
pSql
);
...
...
src/client/src/tscSubquery.c
浏览文件 @
e83fd504
...
...
@@ -1703,7 +1703,7 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
pRes
->
numOfRows
,
pState
->
numOfRetrievedRows
,
pSql
->
ipList
.
fqdn
[
pSql
->
ipList
.
inUse
],
idx
);
if
(
num
>
tsMaxNumOfOrderedResults
&&
tscIsProjectionQueryOnSTable
(
pQueryInfo
,
0
))
{
tscError
(
"%p sub:%p num of OrderedRes is too many, max allowed:%"
PRId
64
" , current:%"
PRId64
,
tscError
(
"%p sub:%p num of OrderedRes is too many, max allowed:%"
PRId
32
" , current:%"
PRId64
,
pPObj
,
pSql
,
tsMaxNumOfOrderedResults
,
num
);
tscAbortFurtherRetryRetrieval
(
trsupport
,
tres
,
TSDB_CODE_TSC_SORTED_RES_TOO_MANY
);
return
;
...
...
@@ -1728,6 +1728,7 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
pRes
->
numOfRows
,
pQueryInfo
->
groupbyExpr
.
orderType
);
if
(
ret
<
0
)
{
// set no disk space error info, and abort retry
tscAbortFurtherRetryRetrieval
(
trsupport
,
tres
,
TSDB_CODE_TSC_NO_DISKSPACE
);
pthread_mutex_unlock
(
&
trsupport
->
queryMutex
);
}
else
if
(
pRes
->
completed
)
{
tscAllDataRetrievedFromDnode
(
trsupport
,
pSql
);
...
...
@@ -1738,7 +1739,6 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
taos_fetch_rows_a
(
tres
,
tscRetrieveFromDnodeCallBack
,
param
);
}
pthread_mutex_unlock
(
&
trsupport
->
queryMutex
);
}
else
{
// all data has been retrieved to client
tscAllDataRetrievedFromDnode
(
trsupport
,
pSql
);
}
...
...
src/client/src/tscUtil.c
浏览文件 @
e83fd504
...
...
@@ -1840,7 +1840,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, void (*fp)(), void
size_t
size
=
taosArrayGetSize
(
pNewQueryInfo
->
colList
);
tscTrace
(
"%p new subquery:%p, tableIndex:%d, vgroupIndex:%d, type:%d, exprInfo:%
d, colList:%d
,"
"%p new subquery:%p, tableIndex:%d, vgroupIndex:%d, type:%d, exprInfo:%
z, colList:%z
,"
"fieldInfo:%d, name:%s, qrang:%"
PRId64
" - %"
PRId64
" order:%d, limit:%"
PRId64
,
pSql
,
pNew
,
tableIndex
,
pTableMetaInfo
->
vgroupIndex
,
pNewQueryInfo
->
type
,
tscSqlExprNumOfExprs
(
pNewQueryInfo
),
size
,
pNewQueryInfo
->
fieldsInfo
.
numOfOutput
,
pFinalInfo
->
name
,
pNewQueryInfo
->
window
.
skey
,
...
...
@@ -2002,7 +2002,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
int32_t
totalVgroups
=
pTableMetaInfo
->
vgroupList
->
numOfVgroups
;
while
(
++
pTableMetaInfo
->
vgroupIndex
<
totalVgroups
)
{
tscTrace
(
"%p results from vgroup index:%d completed, try next:%d. total vgroups:%d. current numOfRes:%
d"
,
pSql
,
tscTrace
(
"%p results from vgroup index:%d completed, try next:%d. total vgroups:%d. current numOfRes:%
"
PRId64
,
pSql
,
pTableMetaInfo
->
vgroupIndex
-
1
,
pTableMetaInfo
->
vgroupIndex
,
totalVgroups
,
pRes
->
numOfClauseTotal
);
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录