Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
31615d0c
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看板
未验证
提交
31615d0c
编写于
2月 23, 2023
作者:
D
dapan1121
提交者:
GitHub
2月 23, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20072 from taosdata/fix/TD-22647
fix: tag filter crash issue
上级
7dc3c6b4
4e0d69c6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
79 addition
and
1 deletion
+79
-1
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+2
-1
source/libs/tdb/src/db/tdbBtree.c
source/libs/tdb/src/db/tdbBtree.c
+9
-0
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-0
tests/system-test/2-query/tagFilter.py
tests/system-test/2-query/tagFilter.py
+67
-0
未找到文件。
source/libs/executor/src/executil.c
浏览文件 @
31615d0c
...
...
@@ -869,13 +869,14 @@ static SSDataBlock* createTagValBlockForFilter(SArray* pColList, int32_t numOfTa
}
else
if
(
pColInfo
->
info
.
type
==
TSDB_DATA_TYPE_JSON
)
{
colDataSetVal
(
pColInfo
,
i
,
p
,
false
);
}
else
if
(
IS_VAR_DATA_TYPE
(
pColInfo
->
info
.
type
))
{
char
*
tmp
=
alloca
(
tagVal
.
nData
+
VARSTR_HEADER_SIZE
+
1
);
char
*
tmp
=
taosMemoryMalloc
(
tagVal
.
nData
+
VARSTR_HEADER_SIZE
+
1
);
varDataSetLen
(
tmp
,
tagVal
.
nData
);
memcpy
(
tmp
+
VARSTR_HEADER_SIZE
,
tagVal
.
pData
,
tagVal
.
nData
);
colDataSetVal
(
pColInfo
,
i
,
tmp
,
false
);
#if TAG_FILTER_DEBUG
qDebug
(
"tagfilter varch:%s"
,
tmp
+
2
);
#endif
taosMemoryFree
(
tmp
);
}
else
{
colDataSetVal
(
pColInfo
,
i
,
(
const
char
*
)
&
tagVal
.
i64
,
false
);
#if TAG_FILTER_DEBUG
...
...
source/libs/tdb/src/db/tdbBtree.c
浏览文件 @
31615d0c
...
...
@@ -2188,6 +2188,9 @@ int tdbBtcMoveTo(SBTC *pBtc, const void *pKey, int kLen, int *pCRst) {
}
else
{
lidx
=
lidx
+
1
;
}
if
(
TDB_CELLDECODER_FREE_KEY
(
&
pBtc
->
coder
))
{
tdbFree
((
void
*
)
pTKey
);
}
// compare last cell
if
(
lidx
<=
ridx
)
{
...
...
@@ -2199,6 +2202,9 @@ int tdbBtcMoveTo(SBTC *pBtc, const void *pKey, int kLen, int *pCRst) {
}
else
{
ridx
=
ridx
-
1
;
}
if
(
TDB_CELLDECODER_FREE_KEY
(
&
pBtc
->
coder
))
{
tdbFree
((
void
*
)
pTKey
);
}
}
// binary search
...
...
@@ -2209,6 +2215,9 @@ int tdbBtcMoveTo(SBTC *pBtc, const void *pKey, int kLen, int *pCRst) {
pBtc
->
idx
=
(
lidx
+
ridx
)
>>
1
;
tdbBtcGet
(
pBtc
,
&
pTKey
,
&
tkLen
,
NULL
,
NULL
);
c
=
pBt
->
kcmpr
(
pKey
,
kLen
,
pTKey
,
tkLen
);
if
(
TDB_CELLDECODER_FREE_KEY
(
&
pBtc
->
coder
))
{
tdbFree
((
void
*
)
pTKey
);
}
if
(
c
<
0
)
{
// pKey < cd.pKey
ridx
=
pBtc
->
idx
-
1
;
...
...
tests/parallel_test/cases.task
浏览文件 @
31615d0c
...
...
@@ -646,6 +646,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/elapsed.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/csum.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/function_diff.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/tagFilter.py
,,n,system-test,python3 ./test.py -f 2-query/queryQnode.py
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode1mnode.py
,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/5dnode2mnode.py -N 5
...
...
tests/system-test/2-query/tagFilter.py
0 → 100644
浏览文件 @
31615d0c
from
util.log
import
*
from
util.sql
import
*
from
util.cases
import
*
from
util.dnodes
import
*
INT_COL
=
"c1"
BINT_COL
=
"c2"
SINT_COL
=
"c3"
TINT_COL
=
"c4"
FLOAT_COL
=
"c5"
DOUBLE_COL
=
"c6"
BOOL_COL
=
"c7"
BINARY_COL
=
"c8"
NCHAR_COL
=
"c9"
TS_COL
=
"c10"
NUM_COL
=
[
INT_COL
,
BINT_COL
,
SINT_COL
,
TINT_COL
,
FLOAT_COL
,
DOUBLE_COL
,
]
UN_NUM_COL
=
[
BOOL_COL
,
BINARY_COL
,
NCHAR_COL
,
]
TS_TYPE_COL
=
[
TS_COL
]
DBNAME
=
"db"
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
self
.
replicaVar
=
int
(
replicaVar
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
execute
(
f
'drop database if exists db'
)
tdSql
.
execute
(
f
'create database if not exists db vgroups 1'
)
def
__create_tb
(
self
,
dbname
=
"db"
):
create_stb_sql
=
f
'''create table
{
dbname
}
.stb1(
ts timestamp, f1 int
) tags (tag1 binary(16300))
'''
tdSql
.
execute
(
create_stb_sql
)
tag_value
=
'a'
for
i
in
range
(
1200
):
tag_value
=
tag_value
+
'a'
for
i
in
range
(
8000
):
tdSql
.
execute
(
f
"create table
{
dbname
}
.ct
{
i
+
1
}
using
{
dbname
}
.stb1 tags ( '
{
tag_value
}
' )"
)
def
__query_data
(
self
,
rows
,
dbname
=
"db"
):
tdSql
.
execute
(
f
'''select count(*) from
{
dbname
}
.stb1 where tag1 like '%a'
'''
)
tdSql
.
checkRows
(
0
)
def
run
(
self
):
tdLog
.
printNoPrefix
(
"==========step1:create table"
)
self
.
__create_tb
()
tdLog
.
printNoPrefix
(
"==========step2:query data"
)
self
.
__query_data
(
10
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录