Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7eeea8a2
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看板
提交
7eeea8a2
编写于
12月 29, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): fix the invalid access, and do some internal refactor.
上级
f970dd24
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
17 addition
and
19 deletion
+17
-19
source/common/src/ttypes.c
source/common/src/ttypes.c
+4
-1
source/libs/scalar/src/filter.c
source/libs/scalar/src/filter.c
+1
-1
source/libs/scalar/src/sclvector.c
source/libs/scalar/src/sclvector.c
+2
-12
source/libs/scalar/test/scalar/scalarTests.cpp
source/libs/scalar/test/scalar/scalarTests.cpp
+7
-3
source/util/src/tcompare.c
source/util/src/tcompare.c
+3
-2
未找到文件。
source/common/src/ttypes.c
浏览文件 @
7eeea8a2
...
@@ -131,7 +131,10 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) {
...
@@ -131,7 +131,10 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) {
varDataCopy
(
val
,
src
);
varDataCopy
(
val
,
src
);
break
;
break
;
default:
{
default:
{
if
(
len
>
0
)
{
memcpy
(
val
,
src
,
len
);
memcpy
(
val
,
src
,
len
);
}
break
;
break
;
}
}
}
}
...
...
source/libs/scalar/src/filter.c
浏览文件 @
7eeea8a2
...
@@ -338,7 +338,7 @@ int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) {
...
@@ -338,7 +338,7 @@ int8_t filterGetCompFuncIdx(int32_t type, int32_t optr) {
__compar_fn_t
filterGetCompFunc
(
int32_t
type
,
int32_t
optr
)
{
return
gDataCompare
[
filterGetCompFuncIdx
(
type
,
optr
)];
}
__compar_fn_t
filterGetCompFunc
(
int32_t
type
,
int32_t
optr
)
{
return
gDataCompare
[
filterGetCompFuncIdx
(
type
,
optr
)];
}
__compar_fn_t
filterGetCompFuncEx
(
int32_t
lType
,
int32_t
rType
,
int32_t
optr
)
{
__compar_fn_t
filterGetCompFuncEx
(
int32_t
lType
,
int32_t
rType
,
int32_t
optr
)
{
if
(
TSDB_DATA_TYPE_NULL
==
rType
)
{
if
(
TSDB_DATA_TYPE_NULL
==
rType
||
TSDB_DATA_TYPE_JSON
==
rType
)
{
return
NULL
;
return
NULL
;
}
}
...
...
source/libs/scalar/src/sclvector.c
浏览文件 @
7eeea8a2
...
@@ -1723,18 +1723,8 @@ void vectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *
...
@@ -1723,18 +1723,8 @@ void vectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *
param2
=
pRight
;
param2
=
pRight
;
}
else
{
}
else
{
vectorConvertCols
(
pLeft
,
pRight
,
&
pLeftOut
,
&
pRightOut
,
startIndex
,
numOfRows
);
vectorConvertCols
(
pLeft
,
pRight
,
&
pLeftOut
,
&
pRightOut
,
startIndex
,
numOfRows
);
param1
=
(
pLeftOut
.
columnData
!=
NULL
)
?
&
pLeftOut
:
pLeft
;
if
(
pLeftOut
.
columnData
!=
NULL
)
{
param2
=
(
pRightOut
.
columnData
!=
NULL
)
?
&
pRightOut
:
pRight
;
param1
=
&
pLeftOut
;
}
else
{
param1
=
pLeft
;
}
if
(
pRightOut
.
columnData
!=
NULL
)
{
param2
=
&
pRightOut
;
}
else
{
param2
=
pRight
;
}
}
}
doVectorCompare
(
param1
,
param2
,
pOut
,
startIndex
,
numOfRows
,
_ord
,
optr
);
doVectorCompare
(
param1
,
param2
,
pOut
,
startIndex
,
numOfRows
,
_ord
,
optr
);
...
...
source/libs/scalar/test/scalar/scalarTests.cpp
浏览文件 @
7eeea8a2
...
@@ -344,7 +344,7 @@ TEST(constantTest, int_or_binary) {
...
@@ -344,7 +344,7 @@ TEST(constantTest, int_or_binary) {
ASSERT_EQ
(
nodeType
(
res
),
QUERY_NODE_VALUE
);
ASSERT_EQ
(
nodeType
(
res
),
QUERY_NODE_VALUE
);
SValueNode
*
v
=
(
SValueNode
*
)
res
;
SValueNode
*
v
=
(
SValueNode
*
)
res
;
ASSERT_EQ
(
v
->
node
.
resType
.
type
,
TSDB_DATA_TYPE_BIGINT
);
ASSERT_EQ
(
v
->
node
.
resType
.
type
,
TSDB_DATA_TYPE_BIGINT
);
ASSERT_EQ
(
v
->
datum
.
b
,
scltLeftV
|
scltRightV
);
ASSERT_EQ
(
v
->
datum
.
i
,
scltLeftV
|
scltRightV
);
nodesDestroyNode
(
res
);
nodesDestroyNode
(
res
);
}
}
...
@@ -1101,7 +1101,8 @@ void makeCalculate(void *json, void *key, int32_t rightType, void *rightData, do
...
@@ -1101,7 +1101,8 @@ void makeCalculate(void *json, void *key, int32_t rightType, void *rightData, do
opType
==
OP_TYPE_LIKE
||
opType
==
OP_TYPE_NOT_LIKE
||
opType
==
OP_TYPE_MATCH
||
opType
==
OP_TYPE_LIKE
||
opType
==
OP_TYPE_NOT_LIKE
||
opType
==
OP_TYPE_MATCH
||
opType
==
OP_TYPE_NMATCH
)
{
opType
==
OP_TYPE_NMATCH
)
{
printf
(
"op:%s,3result:%d,except:%f
\n
"
,
operatorTypeStr
(
opType
),
*
((
bool
*
)
colDataGetData
(
column
,
0
)),
exceptValue
);
printf
(
"op:%s,3result:%d,except:%f
\n
"
,
operatorTypeStr
(
opType
),
*
((
bool
*
)
colDataGetData
(
column
,
0
)),
exceptValue
);
ASSERT_EQ
(
*
((
bool
*
)
colDataGetData
(
column
,
0
)),
exceptValue
);
assert
(
*
(
bool
*
)
colDataGetData
(
column
,
0
)
==
exceptValue
);
// ASSERT_EQ((int) *((bool *)colDataGetData(column, 0)), (int)exceptValue);
}
}
taosArrayDestroyEx
(
blockList
,
scltFreeDataBlock
);
taosArrayDestroyEx
(
blockList
,
scltFreeDataBlock
);
...
@@ -1426,7 +1427,7 @@ TEST(columnTest, json_column_logic_op) {
...
@@ -1426,7 +1427,7 @@ TEST(columnTest, json_column_logic_op) {
printf
(
"--------------------json string-- 6.6hello {1, 8, 2, 2, 3, 0, 0, 0, 0}-------------------
\n
"
);
printf
(
"--------------------json string-- 6.6hello {1, 8, 2, 2, 3, 0, 0, 0, 0}-------------------
\n
"
);
key
=
"k9"
;
key
=
"k9"
;
bool
eRes8
[
len
+
len1
]
=
{
false
,
false
,
false
,
false
,
false
,
false
,
false
,
true
,
true
,
false
,
true
,
fals
e
,
true
};
bool
eRes8
[
len
+
len1
]
=
{
false
,
false
,
false
,
false
,
false
,
false
,
false
,
true
,
true
,
false
,
true
,
tru
e
,
true
};
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
makeCalculate
(
row
,
key
,
TSDB_DATA_TYPE_INT
,
&
input
[
i
],
eRes8
[
i
],
op
[
i
],
false
);
makeCalculate
(
row
,
key
,
TSDB_DATA_TYPE_INT
,
&
input
[
i
],
eRes8
[
i
],
op
[
i
],
false
);
}
}
...
@@ -1437,6 +1438,9 @@ TEST(columnTest, json_column_logic_op) {
...
@@ -1437,6 +1438,9 @@ TEST(columnTest, json_column_logic_op) {
for
(
int
i
=
len
;
i
<
len
+
len1
;
i
++
)
{
for
(
int
i
=
len
;
i
<
len
+
len1
;
i
++
)
{
void
*
rightData
=
prepareNchar
(
inputNchar
[
i
-
len
]);
void
*
rightData
=
prepareNchar
(
inputNchar
[
i
-
len
]);
if
(
i
==
11
)
{
printf
(
"abc
\n
"
);
}
makeCalculate
(
row
,
key
,
TSDB_DATA_TYPE_NCHAR
,
rightData
,
eRes8
[
i
],
op
[
i
],
false
);
makeCalculate
(
row
,
key
,
TSDB_DATA_TYPE_NCHAR
,
rightData
,
eRes8
[
i
],
op
[
i
],
false
);
taosMemoryFree
(
rightData
);
taosMemoryFree
(
rightData
);
}
}
...
...
source/util/src/tcompare.c
浏览文件 @
7eeea8a2
...
@@ -1161,7 +1161,8 @@ static int32_t doExecRegexMatch(const char *pString, const char *pPattern) {
...
@@ -1161,7 +1161,8 @@ static int32_t doExecRegexMatch(const char *pString, const char *pPattern) {
return
1
;
return
1
;
}
}
ret
=
regexec
(
&
regex
,
pString
,
0
,
NULL
,
0
);
regmatch_t
pmatch
[
1
];
ret
=
regexec
(
&
regex
,
pString
,
1
,
pmatch
,
0
);
if
(
ret
!=
0
&&
ret
!=
REG_NOMATCH
)
{
if
(
ret
!=
0
&&
ret
!=
REG_NOMATCH
)
{
regerror
(
ret
,
&
regex
,
msgbuf
,
sizeof
(
msgbuf
));
regerror
(
ret
,
&
regex
,
msgbuf
,
sizeof
(
msgbuf
));
uDebug
(
"Failed to match %s with pattern %s, reason %s"
,
pString
,
pPattern
,
msgbuf
)
uDebug
(
"Failed to match %s with pattern %s, reason %s"
,
pString
,
pPattern
,
msgbuf
)
...
@@ -1192,7 +1193,7 @@ int32_t comparestrRegexMatch(const void *pLeft, const void *pRight) {
...
@@ -1192,7 +1193,7 @@ int32_t comparestrRegexMatch(const void *pLeft, const void *pRight) {
int32_t
comparewcsRegexMatch
(
const
void
*
pString
,
const
void
*
pPattern
)
{
int32_t
comparewcsRegexMatch
(
const
void
*
pString
,
const
void
*
pPattern
)
{
size_t
len
=
varDataLen
(
pPattern
);
size_t
len
=
varDataLen
(
pPattern
);
char
*
pattern
=
taosMemoryMalloc
(
len
+
TSDB_NCHAR_SIZE
);
char
*
pattern
=
taosMemoryMalloc
(
len
+
1
);
int
convertLen
=
taosUcs4ToMbs
((
TdUcs4
*
)
varDataVal
(
pPattern
),
len
,
pattern
);
int
convertLen
=
taosUcs4ToMbs
((
TdUcs4
*
)
varDataVal
(
pPattern
),
len
,
pattern
);
if
(
convertLen
<
0
)
{
if
(
convertLen
<
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录