Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
518a2ae8
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,发现更多精彩内容 >>
提交
518a2ae8
编写于
6月 22, 2021
作者:
W
wpan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support unsigned
上级
6cb9f0c5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
102 addition
and
15 deletion
+102
-15
src/common/src/texpr.c
src/common/src/texpr.c
+13
-5
src/util/src/thashutil.c
src/util/src/thashutil.c
+4
-0
tests/script/general/parser/condition.sim
tests/script/general/parser/condition.sim
+85
-10
未找到文件。
src/common/src/texpr.c
浏览文件 @
518a2ae8
...
...
@@ -526,26 +526,30 @@ void convertFilterSetFromBinary(void **q, const char *buf, int32_t len, uint32_t
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
switch
(
sType
)
{
case
TSDB_DATA_TYPE_BOOL
:
case
TSDB_DATA_TYPE_UTINYINT
:
case
TSDB_DATA_TYPE_TINYINT
:
{
int8_t
val
=
tbufReadInt64
(
&
br
);
uint8_t
val
=
(
uint8_t
)
tbufReadInt64
(
&
br
);
t
=
sizeof
(
val
);
pvar
=
&
val
;
break
;
}
case
TSDB_DATA_TYPE_USMALLINT
:
case
TSDB_DATA_TYPE_SMALLINT
:
{
int16_t
val
=
tbufReadInt64
(
&
br
);
uint16_t
val
=
(
uint16_t
)
tbufReadInt64
(
&
br
);
t
=
sizeof
(
val
);
pvar
=
&
val
;
break
;
}
case
TSDB_DATA_TYPE_UINT
:
case
TSDB_DATA_TYPE_INT
:
{
int32_t
val
=
tbufReadInt64
(
&
br
);
uint32_t
val
=
(
uint32_t
)
tbufReadInt64
(
&
br
);
t
=
sizeof
(
val
);
pvar
=
&
val
;
break
;
}
case
TSDB_DATA_TYPE_UBIGINT
:
case
TSDB_DATA_TYPE_BIGINT
:
{
int64_t
val
=
tbufReadInt64
(
&
br
);
uint64_t
val
=
(
uint64_t
)
tbufReadInt64
(
&
br
);
t
=
sizeof
(
val
);
pvar
=
&
val
;
break
;
...
...
@@ -557,7 +561,7 @@ void convertFilterSetFromBinary(void **q, const char *buf, int32_t len, uint32_t
break
;
}
case
TSDB_DATA_TYPE_FLOAT
:
{
float
val
=
tbufReadDouble
(
&
br
);
float
val
=
(
float
)
tbufReadDouble
(
&
br
);
t
=
sizeof
(
val
);
pvar
=
&
val
;
break
;
...
...
@@ -587,6 +591,7 @@ void convertFilterSetFromBinary(void **q, const char *buf, int32_t len, uint32_t
switch
(
tType
)
{
case
TSDB_DATA_TYPE_BOOL
:
case
TSDB_DATA_TYPE_UTINYINT
:
case
TSDB_DATA_TYPE_TINYINT
:
{
int8_t
val
=
0
;
if
(
tVariantDump
(
&
tmpVar
,
(
char
*
)
&
val
,
tType
,
false
))
{
...
...
@@ -596,6 +601,7 @@ void convertFilterSetFromBinary(void **q, const char *buf, int32_t len, uint32_t
t
=
sizeof
(
val
);
break
;
}
case
TSDB_DATA_TYPE_USMALLINT
:
case
TSDB_DATA_TYPE_SMALLINT
:
{
int16_t
val
=
0
;
if
(
tVariantDump
(
&
tmpVar
,
(
char
*
)
&
val
,
tType
,
false
))
{
...
...
@@ -605,6 +611,7 @@ void convertFilterSetFromBinary(void **q, const char *buf, int32_t len, uint32_t
t
=
sizeof
(
val
);
break
;
}
case
TSDB_DATA_TYPE_UINT
:
case
TSDB_DATA_TYPE_INT
:
{
int32_t
val
=
0
;
if
(
tVariantDump
(
&
tmpVar
,
(
char
*
)
&
val
,
tType
,
false
))
{
...
...
@@ -614,6 +621,7 @@ void convertFilterSetFromBinary(void **q, const char *buf, int32_t len, uint32_t
t
=
sizeof
(
val
);
break
;
}
case
TSDB_DATA_TYPE_UBIGINT
:
case
TSDB_DATA_TYPE_BIGINT
:
{
int64_t
val
=
0
;
if
(
tVariantDump
(
&
tmpVar
,
(
char
*
)
&
val
,
tType
,
false
))
{
...
...
src/util/src/thashutil.c
浏览文件 @
518a2ae8
...
...
@@ -126,12 +126,16 @@ _hash_fn_t taosGetDefaultHashFunction(int32_t type) {
_hash_fn_t
fn
=
NULL
;
switch
(
type
)
{
case
TSDB_DATA_TYPE_TIMESTAMP
:
case
TSDB_DATA_TYPE_UBIGINT
:
case
TSDB_DATA_TYPE_BIGINT
:
fn
=
taosIntHash_64
;
break
;
case
TSDB_DATA_TYPE_BINARY
:
fn
=
MurmurHash3_32
;
break
;
case
TSDB_DATA_TYPE_NCHAR
:
fn
=
MurmurHash3_32
;
break
;
case
TSDB_DATA_TYPE_UINT
:
case
TSDB_DATA_TYPE_INT
:
fn
=
taosIntHash_32
;
break
;
case
TSDB_DATA_TYPE_USMALLINT
:
case
TSDB_DATA_TYPE_SMALLINT
:
fn
=
taosIntHash_16
;
break
;
case
TSDB_DATA_TYPE_BOOL
:
fn
=
taosIntHash_8
;
break
;
case
TSDB_DATA_TYPE_UTINYINT
:
case
TSDB_DATA_TYPE_TINYINT
:
fn
=
taosIntHash_8
;
break
;
case
TSDB_DATA_TYPE_FLOAT
:
fn
=
taosFloatHash
;
break
;
case
TSDB_DATA_TYPE_DOUBLE
:
fn
=
taosDoubleHash
;
break
;
...
...
tests/script/general/parser/condition.sim
浏览文件 @
518a2ae8
...
...
@@ -49,6 +49,29 @@ sql insert into tb6 values ('2021-05-05 18:19:25',62,62.0,62,62,62,62.0,true ,'6
sql insert into tb6 values ('2021-05-05 18:19:26',63,63.0,63,63,63,63.0,false,'63','63')
sql insert into tb6 values ('2021-05-05 18:19:27',64,64.0,64,64,64,64.0,false,'64','64')
sql insert into tb6 values ('2021-05-05 18:19:28',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
sql create table stb2 (ts timestamp, u1 int unsigned, u2 bigint unsigned, u3 smallint unsigned, u4 tinyint unsigned, ts2 timestamp) TAGS(t1 int unsigned, t2 bigint unsigned, t3 timestamp)
sql create table tb2_1 using stb2 tags(1,1,'2021-05-05 18:38:38')
sql create table tb2_2 using stb2 tags(2,2,'2021-05-05 18:58:58')
sql insert into tb2_1 values ('2021-05-05 18:19:00',1,2,3,4,'2021-05-05 18:28:01')
sql insert into tb2_1 values ('2021-05-05 18:19:01',5,6,7,8,'2021-05-05 18:28:02')
sql insert into tb2_1 values ('2021-05-05 18:19:02',2,2,3,4,'2021-05-05 18:28:03')
sql insert into tb2_1 values ('2021-05-05 18:19:03',5,6,7,8,'2021-05-05 18:28:04')
sql insert into tb2_1 values ('2021-05-05 18:19:04',3,2,3,4,'2021-05-05 18:28:05')
sql insert into tb2_1 values ('2021-05-05 18:19:05',5,6,7,8,'2021-05-05 18:28:06')
sql insert into tb2_1 values ('2021-05-05 18:19:06',4,2,3,4,'2021-05-05 18:28:07')
sql insert into tb2_1 values ('2021-05-05 18:19:07',5,6,7,8,'2021-05-05 18:28:08')
sql insert into tb2_1 values ('2021-05-05 18:19:08',5,2,3,4,'2021-05-05 18:28:09')
sql insert into tb2_1 values ('2021-05-05 18:19:09',5,6,7,8,'2021-05-05 18:28:10')
sql insert into tb2_1 values ('2021-05-05 18:19:10',6,2,3,4,'2021-05-05 18:28:11')
sql insert into tb2_2 values ('2021-05-05 18:19:11',5,6,7,8,'2021-05-05 18:28:12')
sql insert into tb2_2 values ('2021-05-05 18:19:12',7,2,3,4,'2021-05-05 18:28:13')
sql insert into tb2_2 values ('2021-05-05 18:19:13',5,6,7,8,'2021-05-05 18:28:14')
sql insert into tb2_2 values ('2021-05-05 18:19:14',8,2,3,4,'2021-05-05 18:28:15')
sql insert into tb2_2 values ('2021-05-05 18:19:15',5,6,7,8,'2021-05-05 18:28:16')
sleep 100
print "column test"
...
...
@@ -68,6 +91,7 @@ sql_error select * from stb1 where c7 in (0,2,3,1);
sql_error select * from stb1 where c8 in (true);
sql_error select * from stb1 where c8 in (1,2);
sql_error select * from stb1 where t3 in (3);
sql_error select * from stb1 where t2 in (3.0);
sql_error select ts,c1,c7 from stb1 where c7 > false
sql_error select ts,c1,c7 from stb1 where ts != '2021-05-05 18:19:27'
sql_error select ts,c1,c7 from stb1 where ts > '2021-05-05 18:19:03.000' or ts > '2021-05-05 18:19:20.000';
...
...
@@ -1281,22 +1305,73 @@ if $data10 != @21-05-05 18:19:14.000@ then
return -1
endi
#sql select * from stb1 where c5 in (3,33) and c8 in ('22','55');
#if $rows != 2 then
# return -1
#endi
#if $data00 != @21-05-05 18:19:02.000@ then
# return -1
#endi
#if $data10 != @21-05-05 18:19:14.000@ then
# return -1
#endi
sql select * from stb1 where c5 in (3,33) and c8 in ('22','55');
if $rows != 0 then
return -1
endi
sql select * from stb1 where c5 in (3,33) and c8 in ('33','54');
if $rows != 1 then
return -1
endi
if $data00 != @21-05-05 18:19:14.000@ then
return -1
endi
sql select * from stb1 where c5 in (3,33) or c8 in ('22','54');
if $rows != 4 then
return -1
endi
if $data00 != @21-05-05 18:19:02.000@ then
return -1
endi
if $data10 != @21-05-05 18:19:09.000@ then
return -1
endi
if $data20 != @21-05-05 18:19:14.000@ then
return -1
endi
if $data30 != @21-05-05 18:19:23.000@ then
return -1
endi
sql select * from stb1 where (c9 in ('3','1','2','4','5') or c9 in ('33','11','22','44','55')) and c9 in ('1','3','11','13');
if $rows != 3 then
return -1
endi
if $data00 != @21-05-05 18:19:00.000@ then
return -1
endi
if $data10 != @21-05-05 18:19:02.000@ then
return -1
endi
if $data20 != @21-05-05 18:19:04.000@ then
return -1
endi
#sql select * from stb2 where (u1 in (1,2,3,4) or u2 in (5,6)) and (u3 in (3,6) or u4 in (7,8))
print "ts test"
print "tbname test"
print "tag test"
sql select * from stb1 where t1 in (1,2) and t1 in (2,3);
if $rows != 4 then
return -1
endi
if $data00 != @21-05-05 18:19:08.000@ then
return -1
endi
if $data10 != @21-05-05 18:19:09.000@ then
return -1
endi
if $data20 != @21-05-05 18:19:10.000@ then
return -1
endi
if $data30 != @21-05-05 18:19:11.000@ then
return -1
endi
print "join test"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录