Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b93b8686
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b93b8686
编写于
12月 09, 2019
作者:
F
fang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
solve static check
上级
02d509e6
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
15 addition
and
13 deletion
+15
-13
src/client/src/tscPrepare.c
src/client/src/tscPrepare.c
+1
-1
src/client/src/tscProfile.c
src/client/src/tscProfile.c
+4
-2
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+10
-10
未找到文件。
src/client/src/tscPrepare.c
浏览文件 @
b93b8686
...
@@ -65,7 +65,7 @@ static int normalStmtAddPart(SNormalStmt* stmt, bool isParam, char* str, uint32_
...
@@ -65,7 +65,7 @@ static int normalStmtAddPart(SNormalStmt* stmt, bool isParam, char* str, uint32_
}
}
stmt
->
sizeParts
=
size
;
stmt
->
sizeParts
=
size
;
stmt
->
parts
=
(
SNormalStmtPart
*
)
tmp
;
stmt
->
parts
=
(
SNormalStmtPart
*
)
tmp
;
free
(
tmp
);
//fang memory leak
free
(
tmp
);
}
}
stmt
->
parts
[
stmt
->
numParts
].
isParam
=
isParam
;
stmt
->
parts
[
stmt
->
numParts
].
isParam
=
isParam
;
...
...
src/client/src/tscProfile.c
浏览文件 @
b93b8686
...
@@ -198,7 +198,9 @@ void tscKillStream(STscObj *pObj, uint32_t killId) {
...
@@ -198,7 +198,9 @@ void tscKillStream(STscObj *pObj, uint32_t killId) {
pthread_mutex_unlock
(
&
pObj
->
mutex
);
pthread_mutex_unlock
(
&
pObj
->
mutex
);
tscTrace
(
"%p stream:%p is killed, streamId:%d"
,
pStream
->
pSql
,
pStream
,
killId
);
//fang, pStream could be null
if
(
pStream
)
{
tscTrace
(
"%p stream:%p is killed, streamId:%d"
,
pStream
->
pSql
,
pStream
,
killId
);
}
taos_close_stream
(
pStream
);
taos_close_stream
(
pStream
);
if
(
pStream
->
callback
)
{
if
(
pStream
->
callback
)
{
...
...
src/client/src/tscSQLParser.c
浏览文件 @
b93b8686
...
@@ -257,7 +257,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
...
@@ -257,7 +257,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
}
}
if
(
pToken
->
n
>
TSDB_DB_NAME_LEN
)
{
if
(
pToken
->
n
>
TSDB_DB_NAME_LEN
)
{
const
char
*
msg
=
"db name too long"
;
//fang, reduce scope
const
char
*
msg
=
"db name too long"
;
return
invalidSqlErrMsg
(
pCmd
,
msg
);
return
invalidSqlErrMsg
(
pCmd
,
msg
);
}
}
...
@@ -306,12 +306,12 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
...
@@ -306,12 +306,12 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
SCreateDBInfo
*
pCreateDB
=
&
(
pInfo
->
pDCLInfo
->
dbOpt
);
SCreateDBInfo
*
pCreateDB
=
&
(
pInfo
->
pDCLInfo
->
dbOpt
);
if
(
tscValidateName
(
&
pCreateDB
->
dbname
)
!=
TSDB_CODE_SUCCESS
)
{
if
(
tscValidateName
(
&
pCreateDB
->
dbname
)
!=
TSDB_CODE_SUCCESS
)
{
const
char
*
msg3
=
"invalid db name"
;
const
char
*
msg3
=
"invalid db name"
;
return
invalidSqlErrMsg
(
pCmd
,
msg3
);
//fang reduce scope
return
invalidSqlErrMsg
(
pCmd
,
msg3
);
}
}
int32_t
ret
=
setObjFullName
(
pMeterMetaInfo
->
name
,
getAccountId
(
pSql
),
&
(
pCreateDB
->
dbname
),
NULL
,
NULL
);
int32_t
ret
=
setObjFullName
(
pMeterMetaInfo
->
name
,
getAccountId
(
pSql
),
&
(
pCreateDB
->
dbname
),
NULL
,
NULL
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
const
char
*
msg2
=
"name too long"
;
//fang reduce scope
const
char
*
msg2
=
"name too long"
;
return
invalidSqlErrMsg
(
pCmd
,
msg2
);
return
invalidSqlErrMsg
(
pCmd
,
msg2
);
}
}
...
@@ -349,7 +349,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
...
@@ -349,7 +349,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
if
(
pInfo
->
pDCLInfo
->
a
[
1
].
type
!=
TK_STRING
)
{
if
(
pInfo
->
pDCLInfo
->
a
[
1
].
type
!=
TK_STRING
)
{
const
char
*
msg3
=
"password needs single quote marks enclosed"
;
const
char
*
msg3
=
"password needs single quote marks enclosed"
;
return
invalidSqlErrMsg
(
pCmd
,
msg3
);
//fang reduce scope
return
invalidSqlErrMsg
(
pCmd
,
msg3
);
}
}
strdequote
(
pInfo
->
pDCLInfo
->
a
[
1
].
z
);
strdequote
(
pInfo
->
pDCLInfo
->
a
[
1
].
z
);
...
@@ -358,17 +358,17 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
...
@@ -358,17 +358,17 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
if
(
pInfo
->
pDCLInfo
->
a
[
1
].
n
<=
0
)
{
if
(
pInfo
->
pDCLInfo
->
a
[
1
].
n
<=
0
)
{
const
char
*
msg1
=
"password can not be empty"
;
const
char
*
msg1
=
"password can not be empty"
;
return
invalidSqlErrMsg
(
pCmd
,
msg1
);
//fang reduce scope
return
invalidSqlErrMsg
(
pCmd
,
msg1
);
}
}
if
(
pInfo
->
pDCLInfo
->
a
[
0
].
n
>
TSDB_USER_LEN
||
pInfo
->
pDCLInfo
->
a
[
1
].
n
>
TSDB_PASSWORD_LEN
)
{
if
(
pInfo
->
pDCLInfo
->
a
[
0
].
n
>
TSDB_USER_LEN
||
pInfo
->
pDCLInfo
->
a
[
1
].
n
>
TSDB_PASSWORD_LEN
)
{
const
char
*
msg
=
"name or password too long"
;
const
char
*
msg
=
"name or password too long"
;
return
invalidSqlErrMsg
(
pCmd
,
msg
);
//fang reduce scope
return
invalidSqlErrMsg
(
pCmd
,
msg
);
}
}
if
(
tscValidateName
(
&
pInfo
->
pDCLInfo
->
a
[
0
])
!=
TSDB_CODE_SUCCESS
)
{
if
(
tscValidateName
(
&
pInfo
->
pDCLInfo
->
a
[
0
])
!=
TSDB_CODE_SUCCESS
)
{
const
char
*
msg2
=
"invalid user/account name"
;
const
char
*
msg2
=
"invalid user/account name"
;
return
invalidSqlErrMsg
(
pCmd
,
msg2
);
//fang reduce scope
return
invalidSqlErrMsg
(
pCmd
,
msg2
);
}
}
strncpy
(
pMeterMetaInfo
->
name
,
pInfo
->
pDCLInfo
->
a
[
0
].
z
,
pInfo
->
pDCLInfo
->
a
[
0
].
n
);
// name
strncpy
(
pMeterMetaInfo
->
name
,
pInfo
->
pDCLInfo
->
a
[
0
].
z
,
pInfo
->
pDCLInfo
->
a
[
0
].
n
);
// name
...
@@ -402,7 +402,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
...
@@ -402,7 +402,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
pCmd
->
defaultVal
[
8
]
=
0
;
pCmd
->
defaultVal
[
8
]
=
0
;
}
else
{
}
else
{
const
char
*
msg4
=
"invalid state option, available options[no, r, w, all]"
;
const
char
*
msg4
=
"invalid state option, available options[no, r, w, all]"
;
return
invalidSqlErrMsg
(
pCmd
,
msg4
);
//fang reduce scope
return
invalidSqlErrMsg
(
pCmd
,
msg4
);
}
}
}
}
}
}
...
@@ -2163,7 +2163,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, int32_t colIdx, tSQLExprItem* pItem
...
@@ -2163,7 +2163,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, int32_t colIdx, tSQLExprItem* pItem
int16_t
resultSize
=
pSchema
[
index
.
columnIndex
].
bytes
;
int16_t
resultSize
=
pSchema
[
index
.
columnIndex
].
bytes
;
char
val
[
8
]
=
{
0
};
char
val
[
8
]
=
{
0
};
int32_t
numOfAddedColumn
=
1
;
//fang reduce scope
int32_t
numOfAddedColumn
=
1
;
if
(
optr
==
TK_PERCENTILE
||
optr
==
TK_APERCENTILE
)
{
if
(
optr
==
TK_PERCENTILE
||
optr
==
TK_APERCENTILE
)
{
tVariantDump
(
pVariant
,
val
,
TSDB_DATA_TYPE_DOUBLE
);
tVariantDump
(
pVariant
,
val
,
TSDB_DATA_TYPE_DOUBLE
);
...
@@ -2927,7 +2927,7 @@ static SColumnFilterInfo* addColumnFilterInfo(SColumnBase* pColumn) {
...
@@ -2927,7 +2927,7 @@ static SColumnFilterInfo* addColumnFilterInfo(SColumnBase* pColumn) {
char
*
tmp
=
realloc
(
pColumn
->
filterInfo
,
sizeof
(
SColumnFilterInfo
)
*
(
size
));
char
*
tmp
=
realloc
(
pColumn
->
filterInfo
,
sizeof
(
SColumnFilterInfo
)
*
(
size
));
if
(
tmp
!=
NULL
)
{
if
(
tmp
!=
NULL
)
{
pColumn
->
filterInfo
=
(
SColumnFilterInfo
*
)
tmp
;
pColumn
->
filterInfo
=
(
SColumnFilterInfo
*
)
tmp
;
free
(
tmp
);
//fang, memory leak
free
(
tmp
);
}
}
pColumn
->
numOfFilters
++
;
pColumn
->
numOfFilters
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录