Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a1eafe88
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
a1eafe88
编写于
2月 14, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix some errors.
上级
61a7751b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
61 addition
and
37 deletion
+61
-37
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+2
-2
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+2
-0
source/util/src/tsimplehash.c
source/util/src/tsimplehash.c
+21
-1
tests/develop-test/2-query/table_count_scan.py
tests/develop-test/2-query/table_count_scan.py
+35
-33
tests/script/tsim/scalar/caseWhen.sim
tests/script/tsim/scalar/caseWhen.sim
+1
-1
未找到文件。
source/libs/executor/src/executil.c
浏览文件 @
a1eafe88
...
...
@@ -1026,7 +1026,7 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
code
=
doFilterByTagCond
(
pListInfo
,
pUidList
,
pTagCond
,
metaHandle
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
goto
_end
;
}
}
else
{
T_MD5_CTX
context
=
{
0
};
...
...
@@ -1064,7 +1064,7 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
code
=
doFilterByTagCond
(
pListInfo
,
pUidList
,
pTagCond
,
metaHandle
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
goto
_end
;
}
// let's add the filter results into meta-cache
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
a1eafe88
...
...
@@ -847,6 +847,7 @@ static int32_t saveWinResult(int64_t ts, int32_t pageId, int32_t offset, uint64_
if
(
newPos
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
newPos
->
groupId
=
groupId
;
newPos
->
pos
=
(
SResultRowPosition
){.
pageId
=
pageId
,
.
offset
=
offset
};
*
(
int64_t
*
)
newPos
->
key
=
ts
;
...
...
@@ -854,6 +855,7 @@ static int32_t saveWinResult(int64_t ts, int32_t pageId, int32_t offset, uint64_
if
(
taosHashPut
(
pUpdatedMap
,
&
key
,
sizeof
(
SWinKey
),
&
newPos
,
sizeof
(
void
*
))
!=
TSDB_CODE_SUCCESS
)
{
taosMemoryFree
(
newPos
);
}
return
TSDB_CODE_SUCCESS
;
}
...
...
source/util/src/tsimplehash.c
浏览文件 @
a1eafe88
...
...
@@ -81,6 +81,7 @@ SSHashObj *tSimpleHashInit(size_t capacity, _hash_fn_t fn) {
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
}
return
pHashObj
;
}
...
...
@@ -92,6 +93,7 @@ int32_t tSimpleHashGetSize(const SSHashObj *pHashObj) {
}
static
void
*
doInternalAlloc
(
SSHashObj
*
pHashObj
,
int32_t
size
)
{
#if 0
void** p = taosArrayGetLast(pHashObj->pHashNodeBuf);
if (p == NULL || (pHashObj->offset + size) > DEFAULT_BUF_PAGE_SIZE) {
// let's allocate one new page
...
...
@@ -112,6 +114,9 @@ static void* doInternalAlloc(SSHashObj* pHashObj, int32_t size) {
pHashObj->offset += size;
return pPos;
}
#else
return
taosMemoryMalloc
(
size
);
#endif
}
static
SHNode
*
doCreateHashNode
(
SSHashObj
*
pHashObj
,
const
void
*
key
,
size_t
keyLen
,
const
void
*
data
,
size_t
dataLen
,
...
...
@@ -356,7 +361,22 @@ void tSimpleHashClear(SSHashObj *pHashObj) {
return
;
}
memset
(
pHashObj
->
hashList
,
0
,
pHashObj
->
capacity
*
sizeof
(
void
*
));
SHNode
*
pNode
=
NULL
,
*
pNext
=
NULL
;
for
(
int32_t
i
=
0
;
i
<
pHashObj
->
capacity
;
++
i
)
{
pNode
=
pHashObj
->
hashList
[
i
];
if
(
!
pNode
)
{
continue
;
}
while
(
pNode
)
{
pNext
=
pNode
->
next
;
FREE_HASH_NODE
(
pNode
);
pNode
=
pNext
;
}
pHashObj
->
hashList
[
i
]
=
NULL
;
}
taosArrayClearEx
(
pHashObj
->
pHashNodeBuf
,
destroyItems
);
pHashObj
->
offset
=
0
;
pHashObj
->
size
=
0
;
...
...
tests/develop-test/2-query/table_count_scan.py
浏览文件 @
a1eafe88
...
...
@@ -75,7 +75,7 @@ class TDTestCase:
tdSql
.
checkData
(
2
,
1
,
'performance_schema'
)
tdSql
.
checkData
(
2
,
2
,
None
)
tdSql
.
query
(
'select count(1)
,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name
;'
)
tdSql
.
query
(
'select count(1)
v,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name order by v desc
;'
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
23
)
tdSql
.
checkData
(
0
,
1
,
'information_schema'
)
...
...
@@ -87,12 +87,12 @@ class TDTestCase:
tdSql
.
checkData
(
2
,
1
,
'tbl_count'
)
tdSql
.
checkData
(
2
,
2
,
'stb1'
)
tdSql
.
query
(
'select count(1)
,db_name from information_schema.ins_tables group by db_name
'
)
tdSql
.
query
(
'select count(1)
v,db_name from information_schema.ins_tables group by db_name order by v asc
'
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
5
)
tdSql
.
checkData
(
0
,
1
,
'performance_schema'
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
1
,
1
,
'tbl_count'
)
tdSql
.
checkData
(
1
,
0
,
5
)
tdSql
.
checkData
(
1
,
1
,
'performance_schema'
)
tdSql
.
checkData
(
0
,
0
,
3
)
tdSql
.
checkData
(
0
,
1
,
'tbl_count'
)
tdSql
.
checkData
(
2
,
0
,
23
)
tdSql
.
checkData
(
2
,
1
,
'information_schema'
)
...
...
@@ -177,42 +177,44 @@ class TDTestCase:
tdSql
.
execute
(
'insert into tba1 values (
\'
2021-11-11 09:00:29
\'
,true, 0,0,0,0,0,0,"000","0000",0,0,0,0);'
)
tdSql
.
query
(
'select count(*)
,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name
;'
)
tdSql
.
query
(
'select count(*)
v,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name order by v
;'
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
'tbl_count'
)
tdSql
.
checkData
(
0
,
2
,
'stba'
)
tdSql
.
checkData
(
1
,
0
,
23
)
tdSql
.
checkData
(
1
,
1
,
'information_schema'
)
tdSql
.
checkData
(
1
,
2
,
None
)
tdSql
.
checkData
(
2
,
0
,
3
)
tdSql
.
checkData
(
2
,
1
,
'tbl_count'
)
tdSql
.
checkData
(
2
,
2
,
'stb1'
)
tdSql
.
checkData
(
3
,
0
,
5
)
tdSql
.
checkData
(
3
,
1
,
'performance_schema'
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
1
,
1
,
'tbl_count'
)
tdSql
.
checkData
(
1
,
2
,
'stb1'
)
tdSql
.
checkData
(
2
,
0
,
5
)
tdSql
.
checkData
(
2
,
1
,
'performance_schema'
)
tdSql
.
checkData
(
2
,
2
,
None
)
tdSql
.
checkData
(
3
,
0
,
23
)
tdSql
.
checkData
(
3
,
1
,
'information_schema'
)
tdSql
.
checkData
(
3
,
2
,
None
)
tdSql
.
query
(
'select count(1)
,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name
;'
)
tdSql
.
query
(
'select count(1)
v,db_name, stable_name from information_schema.ins_tables group by db_name, stable_name order by v
;'
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkData
(
0
,
0
,
23
)
tdSql
.
checkData
(
0
,
1
,
'
information_schema
'
)
tdSql
.
checkData
(
0
,
2
,
None
)
tdSql
.
checkData
(
1
,
0
,
5
)
tdSql
.
checkData
(
1
,
1
,
'
performance_schema
'
)
tdSql
.
checkData
(
1
,
2
,
None
)
tdSql
.
checkData
(
2
,
0
,
1
)
tdSql
.
checkData
(
2
,
1
,
'
tbl_count
'
)
tdSql
.
checkData
(
2
,
2
,
'stba'
)
tdSql
.
checkData
(
3
,
0
,
3
)
tdSql
.
checkData
(
3
,
1
,
'
tbl_count
'
)
tdSql
.
checkData
(
3
,
2
,
'stb1'
)
tdSql
.
checkData
(
0
,
0
,
1
)
tdSql
.
checkData
(
0
,
1
,
'
tbl_count
'
)
tdSql
.
checkData
(
0
,
2
,
'stba'
)
tdSql
.
checkData
(
1
,
0
,
3
)
tdSql
.
checkData
(
1
,
1
,
'
tbl_count
'
)
tdSql
.
checkData
(
1
,
2
,
'stb1'
)
tdSql
.
checkData
(
2
,
0
,
5
)
tdSql
.
checkData
(
2
,
1
,
'
performance_schema
'
)
tdSql
.
checkData
(
2
,
2
,
None
)
tdSql
.
checkData
(
3
,
0
,
2
3
)
tdSql
.
checkData
(
3
,
1
,
'
information_schema
'
)
tdSql
.
checkData
(
3
,
2
,
None
)
tdSql
.
query
(
'select count(1)
,db_name from information_schema.ins_tables group by db_name
'
)
tdSql
.
query
(
'select count(1)
v,db_name from information_schema.ins_tables group by db_name order by v
'
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
5
)
tdSql
.
checkData
(
0
,
1
,
'performance_schema'
)
tdSql
.
checkData
(
1
,
0
,
4
)
tdSql
.
checkData
(
1
,
1
,
'tbl_count'
)
tdSql
.
checkData
(
0
,
0
,
4
)
tdSql
.
checkData
(
0
,
1
,
'tbl_count'
)
tdSql
.
checkData
(
1
,
0
,
5
)
tdSql
.
checkData
(
1
,
1
,
'performance_schema'
)
tdSql
.
checkData
(
2
,
0
,
23
)
tdSql
.
checkData
(
2
,
1
,
'information_schema'
)
...
...
tests/script/tsim/scalar/caseWhen.sim
浏览文件 @
a1eafe88
...
...
@@ -519,7 +519,7 @@ if $rows != 0 then
return -1
endi
sql select sum(f1)
,count(f1) from tba1 partition by case when f1 then f1 when 1 then 1 end
;
sql select sum(f1)
v,count(f1) from tba1 partition by case when f1 then f1 when 1 then 1 end order by v
;
if $rows != 2 then
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录