Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3dce4c46
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看板
未验证
提交
3dce4c46
编写于
8月 11, 2021
作者:
D
dapan1121
提交者:
GitHub
8月 11, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7279 from taosdata/fix/TD-5918
[TD-5918]<fix> fix assert core by expand wild cards
上级
a8506a2d
28725856
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
27 deletion
+18
-27
src/common/src/tglobal.c
src/common/src/tglobal.c
+1
-1
src/util/src/tcompare.c
src/util/src/tcompare.c
+12
-11
tests/pytest/query/queryWildcardLength.py
tests/pytest/query/queryWildcardLength.py
+5
-15
未找到文件。
src/common/src/tglobal.c
浏览文件 @
3dce4c46
...
...
@@ -991,7 +991,7 @@ static void doInitGlobalConfig(void) {
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_CLIENT
|
TSDB_CFG_CTYPE_B_SHOW
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
TSDB_MAX_
ALLOWED_SQL
_LEN
;
cfg
.
maxValue
=
TSDB_MAX_
FIELD
_LEN
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_BYTE
;
taosInitConfigOption
(
cfg
);
...
...
src/util/src/tcompare.c
浏览文件 @
3dce4c46
...
...
@@ -280,25 +280,26 @@ int WCSPatternMatch(const wchar_t *patterStr, const wchar_t *str, size_t size, c
int32_t
compareStrPatternComp
(
const
void
*
pLeft
,
const
void
*
pRight
)
{
SPatternCompareInfo
pInfo
=
{
'%'
,
'_'
};
char
pattern
[
128
]
=
{
0
};
assert
(
varDataLen
(
pRight
)
<=
TSDB_MAX_FIELD_LEN
);
char
*
pattern
=
calloc
(
varDataLen
(
pRight
)
+
1
,
sizeof
(
char
));
memcpy
(
pattern
,
varDataVal
(
pRight
),
varDataLen
(
pRight
));
assert
(
varDataLen
(
pRight
)
<
128
);
size_t
sz
=
varDataLen
(
pLeft
);
char
*
buf
=
malloc
(
sz
+
1
);
memcpy
(
buf
,
varDataVal
(
pLeft
),
sz
);
char
*
buf
=
malloc
(
sz
+
1
);
memcpy
(
buf
,
varDataVal
(
pLeft
),
sz
);
buf
[
sz
]
=
0
;
int32_t
ret
=
patternMatch
(
pattern
,
buf
,
sz
,
&
pInfo
);
free
(
buf
);
free
(
pattern
);
return
(
ret
==
TSDB_PATTERN_MATCH
)
?
0
:
1
;
}
int32_t
taosArrayCompareString
(
const
void
*
a
,
const
void
*
b
)
{
const
char
*
x
=
*
(
const
char
**
)
a
;
const
char
*
y
=
*
(
const
char
**
)
b
;
return
compareLenPrefixedStr
(
x
,
y
);
}
...
...
@@ -307,19 +308,19 @@ int32_t taosArrayCompareString(const void* a, const void* b) {
// return taosArraySearchString(arr, pLeft, taosArrayCompareString, TD_EQ) == NULL ? 0 : 1;
//}
int32_t
compareFindItemInSet
(
const
void
*
pLeft
,
const
void
*
pRight
)
{
return
NULL
!=
taosHashGet
((
SHashObj
*
)
pRight
,
varDataVal
(
pLeft
),
varDataLen
(
pLeft
))
?
1
:
0
;
return
NULL
!=
taosHashGet
((
SHashObj
*
)
pRight
,
varDataVal
(
pLeft
),
varDataLen
(
pLeft
))
?
1
:
0
;
}
int32_t
compareWStrPatternComp
(
const
void
*
pLeft
,
const
void
*
pRight
)
{
SPatternCompareInfo
pInfo
=
{
'%'
,
'_'
};
wchar_t
pattern
[
128
]
=
{
0
}
;
assert
(
TSDB_PATTERN_STRING_MAX_LEN
<
128
);
assert
(
varDataLen
(
pRight
)
<=
TSDB_MAX_FIELD_LEN
*
TSDB_NCHAR_SIZE
)
;
wchar_t
*
pattern
=
calloc
(
varDataLen
(
pRight
)
+
1
,
sizeof
(
wchar_t
)
);
memcpy
(
pattern
,
varDataVal
(
pRight
),
varDataLen
(
pRight
));
assert
(
varDataLen
(
pRight
)
<
128
);
int32_t
ret
=
WCSPatternMatch
(
pattern
,
varDataVal
(
pLeft
),
varDataLen
(
pLeft
)
/
TSDB_NCHAR_SIZE
,
&
pInfo
);
free
(
pattern
);
return
(
ret
==
TSDB_PATTERN_MATCH
)
?
0
:
1
;
}
...
...
tests/pytest/query/queryWildcardLength.py
浏览文件 @
3dce4c46
...
...
@@ -157,19 +157,6 @@ class TDTestCase:
tdSql
.
execute
(
f
'create table
{
table_name
}
_sub1 using
{
table_name
}
tags ("
{
table_name
}
", "
{
table_name
}
")'
)
tdSql
.
execute
(
f
'insert into
{
table_name
}
_sub1 values (now, "
{
table_name
}
", "
{
table_name
}
");'
)
# TODO sc1 leave a bug ---> TD-5918
# sql_list = [f'select * from {table_name} where bi1 like "{hp_name}"',
# f'select * from {table_name} where bi1 like "{lp_name}"',
# f'select * from {table_name} where bi1 like "{ul_name}"',
# f'select * from {table_name} where nc1 like "{hp_name}"',
# f'select * from {table_name} where nc1 like "{lp_name}"',
# f'select * from {table_name} where nc1 like "{ul_name}"',
# f'select * from {table_name} where si1 like "{hp_name}"',
# f'select * from {table_name} where si1 like "{lp_name}"',
# f'select * from {table_name} where si1 like "{ul_name}"',
# f'select * from {table_name} where sc1 like "{hp_name}"',
# f'select * from {table_name} where sc1 like "{lp_name}"',
# f'select * from {table_name} where sc1 like "{ul_name}"']
sql_list
=
[
f
'select * from
{
table_name
}
where bi1 like "
{
hp_name
}
"'
,
f
'select * from
{
table_name
}
where bi1 like "
{
lp_name
}
"'
,
f
'select * from
{
table_name
}
where bi1 like "
{
ul_name
}
"'
,
...
...
@@ -178,7 +165,11 @@ class TDTestCase:
f
'select * from
{
table_name
}
where nc1 like "
{
ul_name
}
"'
,
f
'select * from
{
table_name
}
where si1 like "
{
hp_name
}
"'
,
f
'select * from
{
table_name
}
where si1 like "
{
lp_name
}
"'
,
f
'select * from
{
table_name
}
where si1 like "
{
ul_name
}
"'
]
f
'select * from
{
table_name
}
where si1 like "
{
ul_name
}
"'
,
f
'select * from
{
table_name
}
where sc1 like "
{
hp_name
}
"'
,
f
'select * from
{
table_name
}
where sc1 like "
{
lp_name
}
"'
,
f
'select * from
{
table_name
}
where sc1 like "
{
ul_name
}
"'
]
for
sql
in
sql_list
:
tdSql
.
query
(
sql
)
if
len
(
table_name
)
>=
1
:
...
...
@@ -211,7 +202,6 @@ class TDTestCase:
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录