Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
03b66106
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
03b66106
编写于
4月 23, 2023
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix filter err
上级
4291cfda
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
45 addition
and
43 deletion
+45
-43
source/libs/index/src/indexFilter.c
source/libs/index/src/indexFilter.c
+45
-43
未找到文件。
source/libs/index/src/indexFilter.c
浏览文件 @
03b66106
...
...
@@ -474,41 +474,41 @@ static FORCE_INLINE FilterFunc sifGetFilterFunc(EIndexQueryType type, bool *reve
}
return
NULL
;
}
int32_t
sifStr2num
(
char
*
buf
,
int8_t
type
,
void
*
val
)
{
if
(
type
==
TSDB_DATA_TYPE_TINYINT
)
{
int8_t
v
=
0
;
if
(
1
!=
sscanf
(
buf
,
"%hhd"
,
&
v
))
return
-
1
;
*
(
int8_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_SMALLINT
)
{
int16_t
v
=
0
;
if
(
1
!=
sscanf
(
buf
,
"%hd"
,
&
v
))
return
-
1
;
*
(
int16_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_INT
)
{
int32_t
v
=
0
;
if
(
1
!=
sscanf
(
buf
,
"%d"
,
&
v
))
return
-
1
;
*
(
int32_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_BIGINT
)
{
int32_t
sifStr2Num
(
char
*
buf
,
int32_t
len
,
int8_t
type
,
void
*
val
)
{
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
))
{
int64_t
v
=
0
;
if
(
1
!=
sscanf
(
buf
,
"%"
PRId64
""
,
&
v
))
return
-
1
;
*
(
int64_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_FLOAT
)
{
float
v
=
0
;
if
(
1
!=
sscanf
(
buf
,
"%f"
,
&
v
))
return
-
1
;
*
(
float
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_DOUBLE
)
{
double
v
=
0
;
if
(
1
!=
sscanf
(
buf
,
"%lf"
,
&
v
))
return
-
1
;
*
(
double
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_UBIGINT
)
{
if
(
0
!=
toInteger
(
buf
,
len
,
10
,
&
v
))
{
return
-
1
;
}
if
(
type
==
TSDB_DATA_TYPE_BIGINT
)
{
*
(
int64_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_INT
)
{
*
(
int32_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_TINYINT
)
{
*
(
int8_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_SMALLINT
)
{
*
(
int16_t
*
)
val
=
v
;
}
}
else
if
(
IS_FLOAT_TYPE
(
type
))
{
if
(
type
==
TSDB_DATA_TYPE_FLOAT
)
{
*
(
float
*
)
val
=
taosStr2Float
(
buf
,
NULL
);
}
else
{
*
(
double
*
)
val
=
taosStr2Double
(
buf
,
NULL
);
}
}
else
if
(
IS_UNSIGNED_NUMERIC_TYPE
(
type
))
{
uint64_t
v
=
0
;
if
(
1
!=
sscanf
(
buf
,
"%"
PRIu64
""
,
&
v
))
return
-
1
;
*
(
uint64_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_UINT
||
type
==
TSDB_DATA_TYPE_UTINYINT
||
type
==
TSDB_DATA_TYPE_USMALLINT
)
{
uint32_t
v
=
0
;
if
(
1
!=
sscanf
(
buf
,
"%u"
,
&
v
))
return
-
1
;
*
(
uint32_t
*
)
val
=
v
;
}
else
{
return
-
1
;
if
(
0
!=
toUInteger
(
buf
,
len
,
10
,
&
v
))
{
return
-
1
;
}
if
(
type
==
TSDB_DATA_TYPE_UBIGINT
)
{
*
(
uint64_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_UINT
)
{
*
(
uint32_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_UTINYINT
)
{
*
(
uint8_t
*
)
val
=
v
;
}
else
if
(
type
==
TSDB_DATA_TYPE_USMALLINT
)
{
*
(
uint16_t
*
)
val
=
v
;
}
}
return
0
;
}
...
...
@@ -524,7 +524,7 @@ static int32_t sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typ
if
(
IS_NUMERIC_TYPE
(
rtype
))
{
SIF_DATA_CONVERT
(
rtype
,
right
->
condValue
,
f
);
}
else
{
SIF_ERR_RET
(
sifStr2
num
(
right
->
condValue
+
VARSTR_HEADER_SIZE
,
TSDB_DATA_TYPE_FLOAT
,
&
f
));
SIF_ERR_RET
(
sifStr2
Num
(
varDataVal
(
right
->
condValue
),
varDataLen
(
right
->
condValue
)
,
TSDB_DATA_TYPE_FLOAT
,
&
f
));
}
typedata
->
f
=
f
;
param
->
val
=
&
typedata
->
f
;
...
...
@@ -533,7 +533,7 @@ static int32_t sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typ
if
(
IS_NUMERIC_TYPE
(
rtype
))
{
SIF_DATA_CONVERT
(
rtype
,
right
->
condValue
,
d
);
}
else
{
SIF_ERR_RET
(
sifStr2
num
(
right
->
condValue
+
VARSTR_HEADER_SIZE
,
TSDB_DATA_TYPE_DOUBLE
,
&
d
));
SIF_ERR_RET
(
sifStr2
Num
(
varDataVal
(
right
->
condValue
),
varDataLen
(
right
->
condValue
)
,
TSDB_DATA_TYPE_DOUBLE
,
&
d
));
}
typedata
->
d
=
d
;
param
->
val
=
&
typedata
->
d
;
...
...
@@ -542,7 +542,7 @@ static int32_t sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typ
if
(
IS_NUMERIC_TYPE
(
rtype
))
{
SIF_DATA_CONVERT
(
rtype
,
right
->
condValue
,
i64
);
}
else
{
SIF_ERR_RET
(
sifStr2
num
(
right
->
condValue
+
VARSTR_HEADER_SIZE
,
TSDB_DATA_TYPE_BIGINT
,
&
i64
));
SIF_ERR_RET
(
sifStr2
Num
(
varDataVal
(
right
->
condValue
),
varDataLen
(
right
->
condValue
)
,
TSDB_DATA_TYPE_BIGINT
,
&
i64
));
}
typedata
->
i64
=
i64
;
param
->
val
=
&
typedata
->
i64
;
...
...
@@ -551,7 +551,7 @@ static int32_t sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typ
if
(
IS_NUMERIC_TYPE
(
rtype
))
{
SIF_DATA_CONVERT
(
rtype
,
right
->
condValue
,
i32
);
}
else
{
SIF_ERR_RET
(
sifStr2
num
(
right
->
condValue
+
VARSTR_HEADER_SIZE
,
TSDB_DATA_TYPE_INT
,
&
i32
));
SIF_ERR_RET
(
sifStr2
Num
(
varDataVal
(
right
->
condValue
),
varDataLen
(
right
->
condValue
)
,
TSDB_DATA_TYPE_INT
,
&
i32
));
}
typedata
->
i32
=
i32
;
param
->
val
=
&
typedata
->
i32
;
...
...
@@ -560,7 +560,8 @@ static int32_t sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typ
if
(
IS_NUMERIC_TYPE
(
rtype
))
{
SIF_DATA_CONVERT
(
rtype
,
right
->
condValue
,
i16
);
}
else
{
SIF_ERR_RET
(
sifStr2num
(
right
->
condValue
+
VARSTR_HEADER_SIZE
,
TSDB_DATA_TYPE_SMALLINT
,
&
i16
));
SIF_ERR_RET
(
sifStr2Num
(
varDataVal
(
right
->
condValue
),
varDataLen
(
right
->
condValue
),
TSDB_DATA_TYPE_SMALLINT
,
&
i16
));
}
typedata
->
i16
=
i16
;
...
...
@@ -570,7 +571,7 @@ static int32_t sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typ
if
(
IS_NUMERIC_TYPE
(
rtype
))
{
SIF_DATA_CONVERT
(
rtype
,
right
->
condValue
,
i8
);
}
else
{
SIF_ERR_RET
(
sifStr2
num
(
right
->
condValue
+
VARSTR_HEADER_SIZE
,
TSDB_DATA_TYPE_TINYINT
,
&
i8
));
SIF_ERR_RET
(
sifStr2
Num
(
varDataVal
(
right
->
condValue
),
varDataLen
(
right
->
condValue
)
,
TSDB_DATA_TYPE_TINYINT
,
&
i8
));
}
typedata
->
i8
=
i8
;
param
->
val
=
&
typedata
->
i8
;
...
...
@@ -579,7 +580,7 @@ static int32_t sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typ
if
(
IS_NUMERIC_TYPE
(
rtype
))
{
SIF_DATA_CONVERT
(
rtype
,
right
->
condValue
,
u64
);
}
else
{
SIF_ERR_RET
(
sifStr2
num
(
right
->
condValue
+
VARSTR_HEADER_SIZE
,
TSDB_DATA_TYPE_UBIGINT
,
&
u64
));
SIF_ERR_RET
(
sifStr2
Num
(
varDataVal
(
right
->
condValue
),
varDataLen
(
right
->
condValue
)
,
TSDB_DATA_TYPE_UBIGINT
,
&
u64
));
}
typedata
->
u64
=
u64
;
param
->
val
=
&
typedata
->
u64
;
...
...
@@ -588,7 +589,7 @@ static int32_t sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typ
if
(
IS_NUMERIC_TYPE
(
rtype
))
{
SIF_DATA_CONVERT
(
rtype
,
right
->
condValue
,
u32
);
}
else
{
SIF_ERR_RET
(
sifStr2
num
(
right
->
condValue
+
VARSTR_HEADER_SIZE
,
TSDB_DATA_TYPE_UINT
,
&
u32
));
SIF_ERR_RET
(
sifStr2
Num
(
varDataVal
(
right
->
condValue
),
varDataLen
(
right
->
condValue
)
,
TSDB_DATA_TYPE_UINT
,
&
u32
));
}
typedata
->
u32
=
u32
;
param
->
val
=
&
typedata
->
u32
;
...
...
@@ -597,7 +598,8 @@ static int32_t sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typ
if
(
IS_NUMERIC_TYPE
(
rtype
))
{
SIF_DATA_CONVERT
(
rtype
,
right
->
condValue
,
u16
);
}
else
{
SIF_ERR_RET
(
sifStr2num
(
right
->
condValue
+
VARSTR_HEADER_SIZE
,
TSDB_DATA_TYPE_USMALLINT
,
&
u16
));
SIF_ERR_RET
(
sifStr2Num
(
varDataVal
(
right
->
condValue
),
varDataLen
(
right
->
condValue
),
TSDB_DATA_TYPE_USMALLINT
,
&
u16
));
}
typedata
->
u16
=
u16
;
param
->
val
=
&
typedata
->
u16
;
...
...
@@ -606,7 +608,7 @@ static int32_t sifSetFltParam(SIFParam *left, SIFParam *right, SDataTypeBuf *typ
if
(
IS_NUMERIC_TYPE
(
rtype
))
{
SIF_DATA_CONVERT
(
rtype
,
right
->
condValue
,
u8
);
}
else
{
SIF_ERR_RET
(
sifStr2
num
(
right
->
condValue
+
VARSTR_HEADER_SIZE
,
TSDB_DATA_TYPE_UTINYINT
,
&
u8
));
SIF_ERR_RET
(
sifStr2
Num
(
varDataVal
(
right
->
condValue
),
varDataLen
(
right
->
condValue
)
,
TSDB_DATA_TYPE_UTINYINT
,
&
u8
));
}
typedata
->
u8
=
u8
;
param
->
val
=
&
typedata
->
u8
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录