Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a67c4713
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a67c4713
编写于
5月 18, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225]refactor: change name
上级
3f8c7218
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
36 addition
and
36 deletion
+36
-36
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-1
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+1
-1
src/client/src/tscPrepare.c
src/client/src/tscPrepare.c
+1
-1
src/client/src/tscSecondaryMerge.c
src/client/src/tscSecondaryMerge.c
+20
-20
src/client/src/tscSql.c
src/client/src/tscSql.c
+6
-6
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+2
-2
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+5
-5
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
a67c4713
...
...
@@ -263,7 +263,7 @@ typedef struct SResRec {
typedef
struct
{
int64_t
numOfRows
;
// num of results in current retrieved
int64_t
numOfTotal
;
// num of total results
int64_t
numOf
TotalInCurrentClause
;
// num of total result in current subclause
int64_t
numOf
ClauseTotal
;
// num of total result in current subclause
char
*
pRsp
;
int32_t
rspType
;
int32_t
rspLen
;
...
...
src/client/src/tscAsync.c
浏览文件 @
a67c4713
...
...
@@ -147,7 +147,7 @@ static void tscAsyncFetchRowsProxy(void *param, TAOS_RES *tres, int numOfRows) {
// local merge has handle this situation during super table non-projection query.
if
(
pCmd
->
command
!=
TSDB_SQL_RETRIEVE_LOCALMERGE
)
{
pRes
->
numOf
TotalInCurrentClause
+=
pRes
->
numOfRows
;
pRes
->
numOf
ClauseTotal
+=
pRes
->
numOfRows
;
}
(
*
pSql
->
fetchFp
)(
param
,
tres
,
numOfRows
);
...
...
src/client/src/tscPrepare.c
浏览文件 @
a67c4713
...
...
@@ -447,7 +447,7 @@ static int insertStmtExecute(STscStmt* stmt) {
SSqlRes
*
pRes
=
&
pSql
->
res
;
pRes
->
numOfRows
=
0
;
pRes
->
numOfTotal
=
0
;
pRes
->
numOf
TotalInCurrentClause
=
0
;
pRes
->
numOf
ClauseTotal
=
0
;
pRes
->
qhandle
=
0
;
...
...
src/client/src/tscSecondaryMerge.c
浏览文件 @
a67c4713
...
...
@@ -892,7 +892,7 @@ static void doInterpolateResult(SSqlObj *pSql, SLocalReducer *pLocalReducer, boo
// no interval query, no fill operation
pRes
->
data
=
pLocalReducer
->
pFinalRes
;
pRes
->
numOfRows
=
pFinalDataPage
->
num
;
pRes
->
numOf
TotalInCurrentClause
+=
pRes
->
numOfRows
;
pRes
->
numOf
ClauseTotal
+=
pRes
->
numOfRows
;
if
(
pQueryInfo
->
limit
.
offset
>
0
)
{
if
(
pQueryInfo
->
limit
.
offset
<
pRes
->
numOfRows
)
{
...
...
@@ -903,23 +903,23 @@ static void doInterpolateResult(SSqlObj *pSql, SLocalReducer *pLocalReducer, boo
tColModelCompact
(
pLocalReducer
->
resColModel
,
pFinalDataPage
,
prevSize
);
pRes
->
numOfRows
-=
pQueryInfo
->
limit
.
offset
;
pRes
->
numOf
TotalInCurrentClause
-=
pQueryInfo
->
limit
.
offset
;
pRes
->
numOf
ClauseTotal
-=
pQueryInfo
->
limit
.
offset
;
pQueryInfo
->
limit
.
offset
=
0
;
}
else
{
pQueryInfo
->
limit
.
offset
-=
pRes
->
numOfRows
;
pRes
->
numOfRows
=
0
;
pRes
->
numOf
TotalInCurrentClause
=
0
;
pRes
->
numOf
ClauseTotal
=
0
;
}
}
if
(
pQueryInfo
->
limit
.
limit
>=
0
&&
pRes
->
numOf
TotalInCurrentClause
>
pQueryInfo
->
limit
.
limit
)
{
if
(
pQueryInfo
->
limit
.
limit
>=
0
&&
pRes
->
numOf
ClauseTotal
>
pQueryInfo
->
limit
.
limit
)
{
/* impose the limitation of output rows on the final result */
int32_t
prevSize
=
pFinalDataPage
->
num
;
int32_t
overFlow
=
pRes
->
numOf
TotalInCurrentClause
-
pQueryInfo
->
limit
.
limit
;
int32_t
overFlow
=
pRes
->
numOf
ClauseTotal
-
pQueryInfo
->
limit
.
limit
;
assert
(
overFlow
<
pRes
->
numOfRows
);
pRes
->
numOf
TotalInCurrentClause
=
pQueryInfo
->
limit
.
limit
;
pRes
->
numOf
ClauseTotal
=
pQueryInfo
->
limit
.
limit
;
pRes
->
numOfRows
-=
overFlow
;
pFinalDataPage
->
num
-=
overFlow
;
...
...
@@ -962,7 +962,7 @@ static void doInterpolateResult(SSqlObj *pSql, SLocalReducer *pLocalReducer, boo
pRes
->
data
=
pLocalReducer
->
pFinalRes
;
pRes
->
numOfRows
=
newRows
;
pRes
->
numOf
TotalInCurrentClause
+=
newRows
;
pRes
->
numOf
ClauseTotal
+=
newRows
;
pQueryInfo
->
limit
.
offset
=
0
;
break
;
...
...
@@ -987,13 +987,13 @@ static void doInterpolateResult(SSqlObj *pSql, SLocalReducer *pLocalReducer, boo
}
if
(
pRes
->
numOfRows
>
0
)
{
if
(
pQueryInfo
->
limit
.
limit
>=
0
&&
pRes
->
numOf
TotalInCurrentClause
>
pQueryInfo
->
limit
.
limit
)
{
int32_t
overFlow
=
pRes
->
numOf
TotalInCurrentClause
-
pQueryInfo
->
limit
.
limit
;
if
(
pQueryInfo
->
limit
.
limit
>=
0
&&
pRes
->
numOf
ClauseTotal
>
pQueryInfo
->
limit
.
limit
)
{
int32_t
overFlow
=
pRes
->
numOf
ClauseTotal
-
pQueryInfo
->
limit
.
limit
;
pRes
->
numOfRows
-=
overFlow
;
assert
(
pRes
->
numOfRows
>=
0
);
pRes
->
numOf
TotalInCurrentClause
=
pQueryInfo
->
limit
.
limit
;
pRes
->
numOf
ClauseTotal
=
pQueryInfo
->
limit
.
limit
;
pFinalDataPage
->
num
-=
overFlow
;
/* set remain data to be discarded, and reset the interpolation information */
...
...
@@ -1214,7 +1214,7 @@ static bool saveGroupResultInfo(SSqlObj *pSql) {
// pRes->pGroupRec = realloc(pRes->pGroupRec, pRes->numOfGroups*sizeof(SResRec));
// pRes->pGroupRec[pRes->numOfGroups-1].numOfRows = pRes->numOfRows;
// pRes->pGroupRec[pRes->numOfGroups-1].numOf
TotalInCurrentClause = pRes->numOfTotalInCurrentClause
;
// pRes->pGroupRec[pRes->numOfGroups-1].numOf
ClauseTotal = pRes->numOfClauseTotal
;
return
false
;
}
...
...
@@ -1249,7 +1249,6 @@ bool doGenerateFinalResults(SSqlObj *pSql, SLocalReducer *pLocalReducer, bool no
}
tColModelCompact
(
pModel
,
pResBuf
,
pModel
->
capacity
);
// memcpy(pLocalReducer->pBufForInterpo, pResBuf->data, pLocalReducer->nResultBufSize);
#ifdef _DEBUG_VIEW
printf
(
"final result before interpo:
\n
"
);
...
...
@@ -1258,7 +1257,7 @@ bool doGenerateFinalResults(SSqlObj *pSql, SLocalReducer *pLocalReducer, bool no
#endif
SFillInfo
*
pFillInfo
=
pLocalReducer
->
pFillInfo
;
if
(
pFillInfo
!=
NULL
)
{
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
STableComInfo
tinfo
=
tscGetTableInfo
(
pTableMetaInfo
->
pTableMeta
);
...
...
@@ -1267,6 +1266,7 @@ bool doGenerateFinalResults(SSqlObj *pSql, SLocalReducer *pLocalReducer, bool no
taosFillSetStartInfo
(
pFillInfo
,
pResBuf
->
num
,
ekey
);
taosFillCopyInputDataFromOneFilePage
(
pFillInfo
,
pResBuf
);
}
doInterpolateResult
(
pSql
,
pLocalReducer
,
noMoreCurrentGroupRes
);
return
true
;
...
...
@@ -1284,7 +1284,7 @@ void resetOutputBuf(SQueryInfo *pQueryInfo, SLocalReducer *pLocalReducer) { //
static
void
resetEnvForNewResultset
(
SSqlRes
*
pRes
,
SSqlCmd
*
pCmd
,
SLocalReducer
*
pLocalReducer
)
{
// In handling data in other groups, we need to reset the interpolation information for a new group data
pRes
->
numOfRows
=
0
;
pRes
->
numOf
TotalInCurrentClause
=
0
;
pRes
->
numOf
ClauseTotal
=
0
;
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
...
...
src/client/src/tscSql.c
浏览文件 @
a67c4713
...
...
@@ -242,7 +242,7 @@ int taos_query_imp(STscObj *pObj, SSqlObj *pSql) {
pRes
->
numOfRows
=
1
;
pRes
->
numOfTotal
=
0
;
pRes
->
numOf
TotalInCurrentClause
=
0
;
pRes
->
numOf
ClauseTotal
=
0
;
pCmd
->
curSql
=
NULL
;
if
(
NULL
!=
pCmd
->
pTableList
)
{
...
...
@@ -421,7 +421,7 @@ int taos_fetch_block_impl(TAOS_RES *res, TAOS_ROW *rows) {
// secondary merge has handle this situation
if
(
pCmd
->
command
!=
TSDB_SQL_RETRIEVE_LOCALMERGE
)
{
pRes
->
numOf
TotalInCurrentClause
+=
pRes
->
numOfRows
;
pRes
->
numOf
ClauseTotal
+=
pRes
->
numOfRows
;
}
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
...
...
@@ -504,8 +504,8 @@ int taos_fetch_block(TAOS_RES *res, TAOS_ROW *rows) {
pSql->cmd.command = pQueryInfo->command;
pCmd->clauseIndex++;
pRes->numOfTotal += pRes->numOf
TotalInCurrentClause
;
pRes->numOf
TotalInCurrentClause
= 0;
pRes->numOfTotal += pRes->numOf
ClauseTotal
;
pRes->numOf
ClauseTotal
= 0;
pRes->rspType = 0;
pSql->numOfSubs = 0;
...
...
@@ -804,7 +804,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
pRes
->
numOfRows
=
1
;
pRes
->
numOfTotal
=
0
;
pRes
->
numOf
TotalInCurrentClause
=
0
;
pRes
->
numOf
ClauseTotal
=
0
;
tscTrace
(
"%p Valid SQL: %s pObj:%p"
,
pSql
,
sql
,
pObj
);
...
...
@@ -935,7 +935,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
SSqlRes
*
pRes
=
&
pSql
->
res
;
pRes
->
numOfTotal
=
0
;
// the number of getting table meta from server
pRes
->
numOf
TotalInCurrentClause
=
0
;
pRes
->
numOf
ClauseTotal
=
0
;
pRes
->
code
=
0
;
...
...
src/client/src/tscSubquery.c
浏览文件 @
a67c4713
...
...
@@ -771,7 +771,7 @@ static void joinRetrieveCallback(void* param, TAOS_RES* tres, int numOfRows) {
}
SSqlRes
*
pRes1
=
&
pParentSql
->
pSubs
[
i
]
->
res
;
pRes1
->
numOf
TotalInCurrentClause
+=
pRes1
->
numOfRows
;
pRes1
->
numOf
ClauseTotal
+=
pRes1
->
numOfRows
;
}
// data has retrieved to client, build the join results
...
...
@@ -1834,7 +1834,7 @@ void tscBuildResFromSubqueries(SSqlObj *pSql) {
pRes
->
tsrow
[
i
]
=
pRes1
->
tsrow
[
pIndex
->
columnIndex
];
}
pRes
->
numOf
TotalInCurrentClause
++
;
pRes
->
numOf
ClauseTotal
++
;
break
;
}
else
{
// continue retrieve data from vnode
if
(
!
tscHashRemainDataInSubqueryResultSet
(
pSql
))
{
...
...
src/client/src/tscUtil.c
浏览文件 @
a67c4713
...
...
@@ -1989,7 +1989,7 @@ int32_t tscInvalidSQLErrMsg(char* msg, const char* additionalInfo, const char* s
bool
tscHasReachLimitation
(
SQueryInfo
*
pQueryInfo
,
SSqlRes
*
pRes
)
{
assert
(
pQueryInfo
!=
NULL
&&
pQueryInfo
->
clauseLimit
!=
0
);
return
(
pQueryInfo
->
clauseLimit
>
0
&&
pRes
->
numOf
TotalInCurrentClause
>=
pQueryInfo
->
clauseLimit
);
return
(
pQueryInfo
->
clauseLimit
>
0
&&
pRes
->
numOf
ClauseTotal
>=
pQueryInfo
->
clauseLimit
);
}
char
*
tscGetErrorMsgPayload
(
SSqlCmd
*
pCmd
)
{
return
pCmd
->
payload
;
}
...
...
@@ -2037,7 +2037,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
int32_t
totalVgroups
=
pTableMetaInfo
->
vgroupList
->
numOfVgroups
;
while
(
++
pTableMetaInfo
->
vgroupIndex
<
totalVgroups
)
{
tscTrace
(
"%p current vnode:%d exhausted, try next:%d. total vnode:%d. current numOfRes:%d"
,
pSql
,
pTableMetaInfo
->
vgroupIndex
-
1
,
pTableMetaInfo
->
vgroupIndex
,
totalVgroups
,
pRes
->
numOf
TotalInCurrentClause
);
pTableMetaInfo
->
vgroupIndex
-
1
,
pTableMetaInfo
->
vgroupIndex
,
totalVgroups
,
pRes
->
numOf
ClauseTotal
);
/*
* update the limit and offset value for the query on the next vnode,
...
...
@@ -2045,11 +2045,11 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
*
* NOTE:
* if the pRes->offset is larger than 0, the start returned position has not reached yet.
* Therefore, the pRes->numOfRows, as well as pRes->numOf
TotalInCurrentClause
, must be 0.
* Therefore, the pRes->numOfRows, as well as pRes->numOf
ClauseTotal
, must be 0.
* The pRes->offset value will be updated by virtual node, during query execution.
*/
if
(
pQueryInfo
->
clauseLimit
>=
0
)
{
pQueryInfo
->
limit
.
limit
=
pQueryInfo
->
clauseLimit
-
pRes
->
numOf
TotalInCurrentClause
;
pQueryInfo
->
limit
.
limit
=
pQueryInfo
->
clauseLimit
-
pRes
->
numOf
ClauseTotal
;
}
pQueryInfo
->
limit
.
offset
=
pRes
->
offset
;
...
...
@@ -2092,7 +2092,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, void (*queryFp)()) {
pSql
->
cmd
.
command
=
pQueryInfo
->
command
;
//backup the total number of result first
int64_t
num
=
pRes
->
numOfTotal
+
pRes
->
numOf
TotalInCurrentClause
;
int64_t
num
=
pRes
->
numOfTotal
+
pRes
->
numOf
ClauseTotal
;
tscFreeSqlResult
(
pSql
);
pRes
->
numOfTotal
=
num
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录