Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c64b5d5b
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
c64b5d5b
编写于
1月 04, 2023
作者:
S
Shengliang Guan
提交者:
GitHub
1月 04, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #19364 from taosdata/enh/3.0_planner_optimize
enh: clear assert and fix coverity scan
上级
52d0119f
68ac5e52
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
14 addition
and
32 deletion
+14
-32
source/client/src/clientMain.c
source/client/src/clientMain.c
+4
-5
source/common/src/tname.c
source/common/src/tname.c
+3
-5
source/libs/parser/inc/parToken.h
source/libs/parser/inc/parToken.h
+0
-2
source/libs/parser/src/parInsertSql.c
source/libs/parser/src/parInsertSql.c
+1
-0
source/libs/parser/src/parInsertUtil.c
source/libs/parser/src/parInsertUtil.c
+0
-4
source/libs/parser/src/parTokenizer.c
source/libs/parser/src/parTokenizer.c
+0
-11
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+6
-4
source/libs/parser/test/mockCatalogService.cpp
source/libs/parser/test/mockCatalogService.cpp
+0
-1
未找到文件。
source/client/src/clientMain.c
浏览文件 @
c64b5d5b
...
...
@@ -802,7 +802,7 @@ static void doAsyncQueryFromParse(SMetaData *pResultMeta, void *param, int32_t c
tstrerror
(
code
));
if
(
code
==
TSDB_CODE_SUCCESS
)
{
//pWrapper->pCatalogReq->forceUpdate = false;
//
pWrapper->pCatalogReq->forceUpdate = false;
code
=
qContinueParseSql
(
pWrapper
->
pParseCtx
,
pWrapper
->
pCatalogReq
,
pResultMeta
,
pQuery
);
}
...
...
@@ -831,8 +831,8 @@ void continueInsertFromCsv(SSqlCallbackWrapper *pWrapper, SRequestObj *pRequest)
tstrerror
(
code
),
pWrapper
->
pRequest
->
requestId
);
destorySqlCallbackWrapper
(
pWrapper
);
terrno
=
code
;
p
Wrapper
->
p
Request
->
code
=
code
;
p
Wrapper
->
pRequest
->
body
.
queryFp
(
pWrapper
->
pRequest
->
body
.
param
,
pWrapper
->
pRequest
,
code
);
pRequest
->
code
=
code
;
p
Request
->
body
.
queryFp
(
pRequest
->
body
.
param
,
pRequest
,
code
);
}
}
...
...
@@ -1379,8 +1379,7 @@ int taos_stmt_get_col_fields(TAOS_STMT *stmt, int *fieldNum, TAOS_FIELD_E **fiel
}
// let stmt to reclaim TAOS_FIELD_E that was allocated by `taos_stmt_get_tag_fields`/`taos_stmt_get_col_fields`
void
taos_stmt_reclaim_fields
(
TAOS_STMT
*
stmt
,
TAOS_FIELD_E
*
fields
)
{
void
taos_stmt_reclaim_fields
(
TAOS_STMT
*
stmt
,
TAOS_FIELD_E
*
fields
)
{
(
void
)
stmt
;
if
(
!
fields
)
return
;
taosMemoryFree
(
fields
);
...
...
source/common/src/tname.c
浏览文件 @
c64b5d5b
...
...
@@ -90,10 +90,8 @@ int64_t taosGetIntervalStartTimestamp(int64_t startTime, int64_t slidingTime, in
SName
*
toName
(
int32_t
acctId
,
const
char
*
pDbName
,
const
char
*
pTableName
,
SName
*
pName
)
{
pName
->
type
=
TSDB_TABLE_NAME_T
;
pName
->
acctId
=
acctId
;
memset
(
pName
->
dbname
,
0
,
TSDB_DB_NAME_LEN
);
strncpy
(
pName
->
dbname
,
pDbName
,
TSDB_DB_NAME_LEN
-
1
);
memset
(
pName
->
tname
,
0
,
TSDB_TABLE_NAME_LEN
);
strncpy
(
pName
->
tname
,
pTableName
,
TSDB_TABLE_NAME_LEN
-
1
);
snprintf
(
pName
->
dbname
,
sizeof
(
pName
->
dbname
),
"%s"
,
pDbName
);
snprintf
(
pName
->
tname
,
sizeof
(
pName
->
tname
),
"%s"
,
pTableName
);
return
pName
;
}
...
...
@@ -316,7 +314,7 @@ static int compareKv(const void* p1, const void* p2) {
void
buildChildTableName
(
RandTableName
*
rName
)
{
SStringBuilder
sb
=
{
0
};
taosStringBuilderAppendStringLen
(
&
sb
,
rName
->
stbFullName
,
rName
->
stbFullNameLen
);
if
(
sb
.
buf
==
NULL
)
return
;
if
(
sb
.
buf
==
NULL
)
return
;
taosArraySort
(
rName
->
tags
,
compareKv
);
for
(
int
j
=
0
;
j
<
taosArrayGetSize
(
rName
->
tags
);
++
j
)
{
taosStringBuilderAppendChar
(
&
sb
,
','
);
...
...
source/libs/parser/inc/parToken.h
浏览文件 @
c64b5d5b
...
...
@@ -175,8 +175,6 @@ _end:
void
taosCleanupKeywordsTable
();
SToken
taosTokenDup
(
SToken
*
pToken
,
char
*
buf
,
int32_t
len
);
#ifdef __cplusplus
}
#endif
...
...
source/libs/parser/src/parInsertSql.c
浏览文件 @
c64b5d5b
...
...
@@ -1161,6 +1161,7 @@ static int32_t parseValueTokenImpl(SInsertParseContext* pCxt, const char** pSql,
return
TSDB_CODE_OUT_OF_MEMORY
;
}
if
(
!
taosMbsToUcs4
(
pToken
->
z
,
pToken
->
n
,
(
TdUcs4
*
)
pUcs4
,
pSchema
->
bytes
-
VARSTR_HEADER_SIZE
,
&
len
))
{
taosMemoryFree
(
pUcs4
);
if
(
errno
==
E2BIG
)
{
return
generateSyntaxErrMsg
(
&
pCxt
->
msg
,
TSDB_CODE_PAR_VALUE_TOO_LONG
,
pSchema
->
name
);
}
...
...
source/libs/parser/src/parInsertUtil.c
浏览文件 @
c64b5d5b
...
...
@@ -73,8 +73,6 @@ int32_t insCreateSName(SName* pName, SToken* pTableName, int32_t acctId, const c
char
*
p
=
tableNameGetPosition
(
pTableName
,
TS_PATH_DELIMITER
[
0
]);
if
(
p
!=
NULL
)
{
// db has been specified in sql string so we ignore current db path
assert
(
*
p
==
TS_PATH_DELIMITER
[
0
]);
int32_t
dbLen
=
p
-
pTableName
->
z
;
if
(
dbLen
<=
0
)
{
return
buildInvalidOperationMsg
(
pMsgBuf
,
msg2
);
...
...
@@ -106,8 +104,6 @@ int32_t insCreateSName(SName* pName, SToken* pTableName, int32_t acctId, const c
return
buildInvalidOperationMsg
(
pMsgBuf
,
msg1
);
}
assert
(
pTableName
->
n
<
TSDB_TABLE_FNAME_LEN
);
char
name
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
strncpy
(
name
,
pTableName
->
z
,
pTableName
->
n
);
strdequote
(
name
);
...
...
source/libs/parser/src/parTokenizer.c
浏览文件 @
c64b5d5b
...
...
@@ -715,14 +715,3 @@ void taosCleanupKeywordsTable() {
taosHashCleanup
(
m
);
}
}
SToken
taosTokenDup
(
SToken
*
pToken
,
char
*
buf
,
int32_t
len
)
{
assert
(
pToken
!=
NULL
&&
buf
!=
NULL
&&
len
>
pToken
->
n
);
strncpy
(
buf
,
pToken
->
z
,
pToken
->
n
);
buf
[
pToken
->
n
]
=
0
;
SToken
token
=
*
pToken
;
token
.
z
=
buf
;
return
token
;
}
source/libs/parser/src/parTranslater.c
浏览文件 @
c64b5d5b
...
...
@@ -3902,7 +3902,8 @@ static int32_t checkDbKeepOption(STranslateContext* pCxt, SDatabaseOptions* pOpt
if
(
pOptions
->
keep
[
0
]
<
TSDB_MIN_KEEP
||
pOptions
->
keep
[
1
]
<
TSDB_MIN_KEEP
||
pOptions
->
keep
[
2
]
<
TSDB_MIN_KEEP
||
pOptions
->
keep
[
0
]
>
tsdbMaxKeep
||
pOptions
->
keep
[
1
]
>
tsdbMaxKeep
||
pOptions
->
keep
[
2
]
>
tsdbMaxKeep
)
{
return
generateSyntaxErrMsgExt
(
&
pCxt
->
msgBuf
,
TSDB_CODE_PAR_INVALID_DB_OPTION
,
"Invalid option keep: %"
PRId64
", %"
PRId64
", %"
PRId64
" valid range: [%dm, %dm]"
,
"Invalid option keep: %"
PRId64
", %"
PRId64
", %"
PRId64
" valid range: [%dm, %"
PRId64
"m]"
,
pOptions
->
keep
[
0
],
pOptions
->
keep
[
1
],
pOptions
->
keep
[
2
],
TSDB_MIN_KEEP
,
tsdbMaxKeep
);
}
...
...
@@ -5856,6 +5857,7 @@ static int32_t adjustStreamQueryForExistTable(STranslateContext* pCxt, SCreateSt
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
adjustStreamQueryForExistTableImpl
(
pCxt
,
pStmt
,
pMeta
);
}
taosMemoryFree
(
pMeta
);
return
code
;
}
...
...
@@ -6435,7 +6437,7 @@ int32_t extractResultSchema(const SNode* pRoot, int32_t* numOfCols, SSchema** pS
return
extractShowCreateDatabaseResultSchema
(
numOfCols
,
pSchema
);
case
QUERY_NODE_SHOW_DB_ALIVE_STMT
:
case
QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT
:
return
extractShowAliveResultSchema
(
numOfCols
,
pSchema
);
return
extractShowAliveResultSchema
(
numOfCols
,
pSchema
);
case
QUERY_NODE_SHOW_CREATE_TABLE_STMT
:
case
QUERY_NODE_SHOW_CREATE_STABLE_STMT
:
return
extractShowCreateTableResultSchema
(
numOfCols
,
pSchema
);
...
...
@@ -6540,7 +6542,7 @@ static int32_t createOperatorNode(EOperatorType opType, const char* pColName, SN
nodesDestroyNode
((
SNode
*
)
pOper
);
return
TSDB_CODE_OUT_OF_MEMORY
;
}
s
trcpy
(((
SColumnNode
*
)
pOper
->
pLeft
)
->
colName
,
pColName
);
s
nprintf
(((
SColumnNode
*
)
pOper
->
pLeft
)
->
colName
,
sizeof
(((
SColumnNode
*
)
pOper
->
pLeft
)
->
colName
),
"%s"
,
pColName
);
*
pOp
=
(
SNode
*
)
pOper
;
return
TSDB_CODE_SUCCESS
;
...
...
@@ -7956,7 +7958,7 @@ static int32_t setQuery(STranslateContext* pCxt, SQuery* pQuery) {
case
QUERY_NODE_DESCRIBE_STMT
:
case
QUERY_NODE_SHOW_CREATE_DATABASE_STMT
:
case
QUERY_NODE_SHOW_DB_ALIVE_STMT
:
case
QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT
:
case
QUERY_NODE_SHOW_CLUSTER_ALIVE_STMT
:
case
QUERY_NODE_SHOW_CREATE_TABLE_STMT
:
case
QUERY_NODE_SHOW_CREATE_STABLE_STMT
:
case
QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT
:
...
...
source/libs/parser/test/mockCatalogService.cpp
浏览文件 @
c64b5d5b
...
...
@@ -33,7 +33,6 @@ std::unique_ptr<MockCatalogService> g_mockCatalogService;
class
TableBuilder
:
public
ITableBuilder
{
public:
virtual
TableBuilder
&
addColumn
(
const
string
&
name
,
int8_t
type
,
int32_t
bytes
)
{
assert
(
colId_
<=
schema
()
->
tableInfo
.
numOfTags
+
schema
()
->
tableInfo
.
numOfColumns
);
SSchema
*
col
=
schema
()
->
schema
+
(
colId_
-
1
);
col
->
type
=
type
;
col
->
colId
=
colId_
++
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录