Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
ae57aaae
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看板
提交
ae57aaae
编写于
7月 18, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] fix bugs in interp
上级
a174735c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
16 deletion
+18
-16
src/inc/tsdb.h
src/inc/tsdb.h
+1
-6
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-2
src/tsdb/src/tsdbRead.c
src/tsdb/src/tsdbRead.c
+15
-8
未找到文件。
src/inc/tsdb.h
浏览文件 @
ae57aaae
...
...
@@ -175,11 +175,6 @@ typedef struct {
SHashObj
*
map
;
// speedup acquire the tableQueryInfo from STableId
}
STableGroupInfo
;
typedef
struct
SQueryRowCond
{
int32_t
rel
;
TSKEY
ts
;
}
SQueryRowCond
;
/**
* Get the data block iterator, starting from position according to the query condition
*
...
...
@@ -276,7 +271,7 @@ int32_t tsdbQuerySTableByTagCond(TSDB_REPO_T *tsdb, uint64_t uid, const char *pT
* destory the created table group list, which is generated by tag query
* @param pGroupList
*/
void
tsdbDest
or
yTableGroup
(
STableGroupInfo
*
pGroupList
);
void
tsdbDest
ro
yTableGroup
(
STableGroupInfo
*
pGroupList
);
/**
* create the table group result including only one table, used to handle the normal table query
...
...
src/query/src/qExecutor.c
浏览文件 @
ae57aaae
...
...
@@ -5859,7 +5859,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SArray* pTableIdList,
return
pQInfo
;
_cleanup_qinfo:
tsdbDest
or
yTableGroup
(
pTableGroupInfo
);
tsdbDest
ro
yTableGroup
(
pTableGroupInfo
);
_cleanup_query:
taosArrayDestroy
(
pGroupbyExpr
->
columnInfo
);
...
...
@@ -6009,7 +6009,7 @@ static void freeQInfo(SQInfo *pQInfo) {
tfree
(
pQInfo
->
pBuf
);
taosArrayDestroy
(
pQInfo
->
tableqinfoGroupInfo
.
pGroupList
);
taosHashCleanup
(
pQInfo
->
tableqinfoGroupInfo
.
map
);
tsdbDest
or
yTableGroup
(
&
pQInfo
->
tableGroupInfo
);
tsdbDest
ro
yTableGroup
(
&
pQInfo
->
tableGroupInfo
);
taosArrayDestroy
(
pQInfo
->
arrTableIdInfo
);
if
(
pQuery
->
pGroupbyExpr
!=
NULL
)
{
...
...
src/tsdb/src/tsdbRead.c
浏览文件 @
ae57aaae
...
...
@@ -107,7 +107,7 @@ typedef struct STsdbQueryHandle {
bool
locateStart
;
int32_t
outputCapacity
;
int32_t
realNumOfRows
;
SArray
*
pTableCheckInfo
;
//SArray<STableCheckInfo>
SArray
*
pTableCheckInfo
;
//
SArray<STableCheckInfo>
int32_t
activeIndex
;
bool
checkFiles
;
// check file stage
void
*
qinfo
;
// query info handle, for debug purpose
...
...
@@ -191,6 +191,7 @@ TsdbQueryHandleT* tsdbQueryTables(TSDB_REPO_T* tsdb, STsdbQueryCond* pCond, STab
free
(
pQueryHandle
);
return
NULL
;
}
tsdbTakeMemSnapshot
(
pQueryHandle
->
pTsdb
,
&
pQueryHandle
->
mem
,
&
pQueryHandle
->
imem
);
size_t
sizeOfGroup
=
taosArrayGetSize
(
groupList
->
pGroupList
);
...
...
@@ -348,6 +349,11 @@ static bool initTableMemIterator(STsdbQueryHandle* pHandle, STableCheckInfo* pCh
return
true
;
}
static
void
destroyTableMemIterator
(
STableCheckInfo
*
pCheckInfo
)
{
tSkipListDestroyIter
(
pCheckInfo
->
iter
);
tSkipListDestroyIter
(
pCheckInfo
->
iiter
);
}
SDataRow
getSDataRowInTableMem
(
STableCheckInfo
*
pCheckInfo
)
{
SDataRow
rmem
=
NULL
,
rimem
=
NULL
;
if
(
pCheckInfo
->
iter
)
{
...
...
@@ -1543,6 +1549,7 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
free
(
pSecQueryHandle
);
return
false
;
}
tsdbTakeMemSnapshot
(
pSecQueryHandle
->
pTsdb
,
&
pSecQueryHandle
->
mem
,
&
pSecQueryHandle
->
imem
);
// allocate buffer in order to load data blocks from file
...
...
@@ -1567,7 +1574,6 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
for
(
int32_t
j
=
0
;
j
<
si
;
++
j
)
{
STableCheckInfo
*
pCheckInfo
=
(
STableCheckInfo
*
)
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
j
);
STableCheckInfo
info
=
{
.
lastKey
=
pSecQueryHandle
->
window
.
skey
,
.
tableId
=
pCheckInfo
->
tableId
,
...
...
@@ -1604,9 +1610,9 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
pQueryHandle
->
window
=
pQueryHandle
->
cur
.
win
;
pQueryHandle
->
cur
.
rows
=
2
;
pQueryHandle
->
cur
.
mixBlock
=
true
;
pQueryHandle
->
order
=
TSDB_ORDER_
A
SC
;
pQueryHandle
->
order
=
TSDB_ORDER_
DE
SC
;
int32_t
step
=
-
1
;
int32_t
step
=
-
1
;
// one step for ascending order traverse
for
(
int32_t
j
=
0
;
j
<
si
;
++
j
)
{
STableCheckInfo
*
pCheckInfo
=
(
STableCheckInfo
*
)
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
j
);
pCheckInfo
->
lastKey
=
pQueryHandle
->
cur
.
win
.
ekey
+
step
;
...
...
@@ -1615,8 +1621,9 @@ bool tsdbNextDataBlock(TsdbQueryHandleT* pHandle) {
tsdbCleanupQueryHandle
(
pSecQueryHandle
);
}
// disable it after retrieve data
pQueryHandle
->
type
=
TSDB_QUERY_TYPE_ALL
;
//disable it after retrieve data
pQueryHandle
->
type
=
TSDB_QUERY_TYPE_EXTERNAL
;
pQueryHandle
->
checkFiles
=
false
;
return
true
;
}
...
...
@@ -2365,7 +2372,7 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) {
size_t
size
=
taosArrayGetSize
(
pQueryHandle
->
pTableCheckInfo
);
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
STableCheckInfo
*
pTableCheckInfo
=
taosArrayGet
(
pQueryHandle
->
pTableCheckInfo
,
i
);
tSkipListDestroyIter
(
pTableCheckInfo
->
iter
);
destroyTableMemIterator
(
pTableCheckInfo
);
if
(
pTableCheckInfo
->
pDataCols
!=
NULL
)
{
tfree
(
pTableCheckInfo
->
pDataCols
->
buf
);
...
...
@@ -2401,7 +2408,7 @@ void tsdbCleanupQueryHandle(TsdbQueryHandleT queryHandle) {
tfree
(
pQueryHandle
);
}
void
tsdbDest
or
yTableGroup
(
STableGroupInfo
*
pGroupList
)
{
void
tsdbDest
ro
yTableGroup
(
STableGroupInfo
*
pGroupList
)
{
assert
(
pGroupList
!=
NULL
);
size_t
numOfGroup
=
taosArrayGetSize
(
pGroupList
->
pGroupList
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录