Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
2acc0194
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看板
提交
2acc0194
编写于
7月 14, 2021
作者:
W
wpan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug
上级
fb010431
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
3 deletion
+12
-3
src/query/inc/qUtil.h
src/query/inc/qUtil.h
+9
-0
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+3
-3
未找到文件。
src/query/inc/qUtil.h
浏览文件 @
2acc0194
...
@@ -24,6 +24,15 @@
...
@@ -24,6 +24,15 @@
memcpy((_k) + sizeof(uint64_t), (_ori), (_len)); \
memcpy((_k) + sizeof(uint64_t), (_ori), (_len)); \
} while (0)
} while (0)
#define SET_RES_EXT_WINDOW_KEY(_k, _ori, _len, _uid, _buf) \
do { \
assert(sizeof(_uid) == sizeof(uint64_t)); \
*(void **)(_k) = (_buf); \
*(uint64_t *)((_k) + POINTER_BYTES) = (_uid); \
memcpy((_k) + POINTER_BYTES + sizeof(uint64_t), (_ori), (_len)); \
} while (0)
#define GET_RES_WINDOW_KEY_LEN(_l) ((_l) + sizeof(uint64_t))
#define GET_RES_WINDOW_KEY_LEN(_l) ((_l) + sizeof(uint64_t))
#define GET_QID(_r) (((SQInfo*)((_r)->qinfo))->qId)
#define GET_QID(_r) (((SQInfo*)((_r)->qinfo))->qId)
...
...
src/query/src/qExecutor.c
浏览文件 @
2acc0194
...
@@ -433,7 +433,7 @@ static SResultRow* doSetResultOutBufByKey(SQueryRuntimeEnv* pRuntimeEnv, SResult
...
@@ -433,7 +433,7 @@ static SResultRow* doSetResultOutBufByKey(SQueryRuntimeEnv* pRuntimeEnv, SResult
existed
=
(
pResultRowInfo
->
pResult
[
0
]
==
(
*
p1
));
existed
=
(
pResultRowInfo
->
pResult
[
0
]
==
(
*
p1
));
pResultRowInfo
->
curPos
=
0
;
pResultRowInfo
->
curPos
=
0
;
}
else
{
// check if current pResultRowInfo contains the existed pResultRow
}
else
{
// check if current pResultRowInfo contains the existed pResultRow
SET_RES_
WINDOW_KEY
(
pRuntimeEnv
->
keyBuf
,
pData
,
bytes
,
tid
);
SET_RES_
EXT_WINDOW_KEY
(
pRuntimeEnv
->
keyBuf
,
pData
,
bytes
,
tid
,
pResultRowInfo
);
int64_t
*
index
=
taosHashGet
(
pRuntimeEnv
->
pResultRowListSet
,
pRuntimeEnv
->
keyBuf
,
GET_RES_WINDOW_KEY_LEN
(
bytes
));
int64_t
*
index
=
taosHashGet
(
pRuntimeEnv
->
pResultRowListSet
,
pRuntimeEnv
->
keyBuf
,
GET_RES_WINDOW_KEY_LEN
(
bytes
));
if
(
index
!=
NULL
)
{
if
(
index
!=
NULL
)
{
pResultRowInfo
->
curPos
=
(
int32_t
)
*
index
;
pResultRowInfo
->
curPos
=
(
int32_t
)
*
index
;
...
@@ -471,7 +471,7 @@ static SResultRow* doSetResultOutBufByKey(SQueryRuntimeEnv* pRuntimeEnv, SResult
...
@@ -471,7 +471,7 @@ static SResultRow* doSetResultOutBufByKey(SQueryRuntimeEnv* pRuntimeEnv, SResult
pResultRowInfo
->
pResult
[
pResultRowInfo
->
size
++
]
=
pResult
;
pResultRowInfo
->
pResult
[
pResultRowInfo
->
size
++
]
=
pResult
;
int64_t
index
=
pResultRowInfo
->
curPos
;
int64_t
index
=
pResultRowInfo
->
curPos
;
SET_RES_
WINDOW_KEY
(
pRuntimeEnv
->
keyBuf
,
pData
,
bytes
,
tid
);
SET_RES_
EXT_WINDOW_KEY
(
pRuntimeEnv
->
keyBuf
,
pData
,
bytes
,
tid
,
pResultRowInfo
);
taosHashPut
(
pRuntimeEnv
->
pResultRowListSet
,
pRuntimeEnv
->
keyBuf
,
GET_RES_WINDOW_KEY_LEN
(
bytes
),
&
index
,
POINTER_BYTES
);
taosHashPut
(
pRuntimeEnv
->
pResultRowListSet
,
pRuntimeEnv
->
keyBuf
,
GET_RES_WINDOW_KEY_LEN
(
bytes
),
&
index
,
POINTER_BYTES
);
}
}
...
@@ -1790,7 +1790,7 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf
...
@@ -1790,7 +1790,7 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf
pRuntimeEnv
->
pResultRowHashTable
=
taosHashInit
(
numOfTables
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
,
HASH_NO_LOCK
);
pRuntimeEnv
->
pResultRowHashTable
=
taosHashInit
(
numOfTables
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
true
,
HASH_NO_LOCK
);
pRuntimeEnv
->
pResultRowListSet
=
taosHashInit
(
numOfTables
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_NO_LOCK
);
pRuntimeEnv
->
pResultRowListSet
=
taosHashInit
(
numOfTables
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_NO_LOCK
);
pRuntimeEnv
->
keyBuf
=
malloc
(
pQueryAttr
->
maxTableColumnWidth
+
sizeof
(
int64_t
));
pRuntimeEnv
->
keyBuf
=
malloc
(
pQueryAttr
->
maxTableColumnWidth
+
sizeof
(
int64_t
)
+
POINTER_BYTES
);
pRuntimeEnv
->
pool
=
initResultRowPool
(
getResultRowSize
(
pRuntimeEnv
));
pRuntimeEnv
->
pool
=
initResultRowPool
(
getResultRowSize
(
pRuntimeEnv
));
pRuntimeEnv
->
prevRow
=
malloc
(
POINTER_BYTES
*
pQueryAttr
->
numOfCols
+
pQueryAttr
->
srcRowSize
);
pRuntimeEnv
->
prevRow
=
malloc
(
POINTER_BYTES
*
pQueryAttr
->
numOfCols
+
pQueryAttr
->
srcRowSize
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录