Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
c77d3a2a
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c77d3a2a
编写于
7月 08, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-225] update scripts;
上级
a3df1e2f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
99 addition
and
13 deletion
+99
-13
tests/script/general/parser/tags_dynamically_specifiy.sim
tests/script/general/parser/tags_dynamically_specifiy.sim
+47
-7
tests/script/general/parser/tags_filter.sim
tests/script/general/parser/tags_filter.sim
+52
-6
未找到文件。
tests/script/general/parser/tags_dynamically_specifiy.sim
浏览文件 @
c77d3a2a
...
...
@@ -28,16 +28,27 @@ sql insert into tb3 using stb (t3) tags (3.3) values ( now + 3s, 'binary3', 3
sql insert into tb4 (ts, c1, c2) using stb (t1, t2) tags ('tag4', 4) values ( now + 4s, 'binary4', 4)
sql insert into tb5 (ts, c1, c3) using stb (t1, t3) tags ('tag5', 11.11) values ( now + 5s, 'binary5', 5.5)
sql insert into tb6 (ts, c1, c3) using stb tags ('tag5', 6, 11.11) values ( now + 5s, 'binary6', 6.6)
sql insert into tb7 (ts, c1, c2, c3) using stb tags ('tag5', 7, 11.11) values ( now + 5s, 'binary7', 7, 7.7)
sql select * from stb order by ts asc
if $rows !=
5
then
if $rows !=
7
then
return -1
endi
sql_error insert into tb11 using stb (t1) tags () values ( now + 1s, 'binary1', 1, 1.1)
sql_error insert into tb12 using stb (t1, t3) tags () values ( now + 1s, 'binary1', 1, 1.1)
sql_error insert into tb13 using stb (t1, t2, t3) tags (8, 9.13, 'ac') values ( now + 1s, 'binary1', 1, 1.1)
sql_error insert into tb14 using stb () tags (2) values ( now + 2s, 'binary2', 2, 2.2)
sql_error insert into tb15 using stb (t2, t3) tags (3.3) values ( now + 3s, 'binary3', 3, 3.3)
sql_error insert into tb16 (ts, c1, c2) using stb (t1, t2) tags ('tag4', 4) values ( now + 4s, 'binary4')
sql_error insert into tb17 (ts, c1, c3) using stb (t1, t3) tags ('tag5', 11.11, 5) values ( now + 5s, 'binary5', 5.5)
sql_error insert into tb18 (ts, c1, c3) using stb tags ('tag5', 16) values ( now + 5s, 'binary6', 6.6)
sql_error insert into tb19 (ts, c1, c2, c3) using stb tags (19, 'tag5', 91.11) values ( now + 5s, 'binary7', 7, 7.7)
sql create table stbx (ts timestamp, c1 binary(10), c2 int, c3 float) tags (t1 binary(10), t2 int, t3 float)
sql insert into tb100 (ts, c1, c2, c3) using stbx (t1, t2, t3) tags ('tag100', 100, 100.
9
) values ( now + 10s, 'binary100', 100, 100.9) tb101 (ts, c1, c2, c3) using stbx (t1, t2, t3) tags ('tag101', 101, 101.9) values ( now + 10s, 'binary101', 101, 101.9) tb102 (ts, c1, c2, c3) using stbx (t1, t2, t3) tags ('tag102', 102, 102.9) values ( now + 10s, 'binary102', 102, 102.9)
sql insert into tb100 (ts, c1, c2, c3) using stbx (t1, t2, t3) tags ('tag100', 100, 100.
123456
) values ( now + 10s, 'binary100', 100, 100.9) tb101 (ts, c1, c2, c3) using stbx (t1, t2, t3) tags ('tag101', 101, 101.9) values ( now + 10s, 'binary101', 101, 101.9) tb102 (ts, c1, c2, c3) using stbx (t1, t2, t3) tags ('tag102', 102, 102.9) values ( now + 10s, 'binary102', 102, 102.9)
sql select * from stbx
if $rows != 3 then
...
...
@@ -52,9 +63,38 @@ if $data05 != 100 then
return -1
endi
#if $data06 != 100.90000 then
# print "expect: 100.90000, act: $data06"
# return -1
#endi
if $data06 != 100.12346 then
print "expect: 100.12346, act: $data06"
return -1
endi
sql create table stby (ts timestamp, c1 binary(10), c2 int, c3 float) tags (t1 binary(10), t2 int, t3 float)
sql reset query cache
sql insert into tby1 using stby (t1) tags ('tag1') values ( now + 1s, 'binary1', 1, 1.1)
sql insert into tby2 using stby (t2) tags (2) values ( now + 2s, 'binary2', 2, 2.2)
sql insert into tby3 using stby (t3) tags (3.3) values ( now + 3s, 'binary3', 3, 3.3)
sql insert into tby4 (ts, c1, c2) using stby (t1, t2) tags ('tag4', 4) values ( now + 4s, 'binary4', 4)
sql insert into tby5 (ts, c1, c3) using stby (t1, t3) tags ('tag5', 11.11) values ( now + 5s, 'binary5', 5.5)
sql insert into tby6 (ts, c1, c3) using stby tags ('tag5', 6, 11.11) values ( now + 5s, 'binary6', 6.6)
sql insert into tby7 (ts, c1, c2, c3) using stby tags ('tag5', 7, 11.11) values ( now + 5s, 'binary7', 7, 7.7)
sql select * from stby order by ts asc
if $rows != 7 then
return -1
endi
sql reset query cache
sql insert into tby1 using stby (t1) tags ('tag1') values ( now + 1s, 'binary1y', 1, 1.1)
sql insert into tby2 using stby (t2) tags (2) values ( now + 2s, 'binary2y', 2, 2.2)
sql insert into tby3 using stby (t3) tags (3.3) values ( now + 3s, 'binary3y', 3, 3.3)
sql insert into tby4 (ts, c1, c2) using stby (t1, t2) tags ('tag4', 4) values ( now + 4s, 'binary4y', 4)
sql insert into tby5 (ts, c1, c3) using stby (t1, t3) tags ('tag5', 11.11) values ( now + 5s, 'binary5y', 5.5)
sql insert into tby6 (ts, c1, c3) using stby tags ('tag5', 6, 11.11) values ( now + 5s, 'binary6y', 6.6)
sql insert into tby7 (ts, c1, c2, c3) using stby tags ('tag5', 7, 11.11) values ( now + 5s, 'binary7y', 7, 7.7)
sql select * from stby order by ts asc
if $rows != 14 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/general/parser/tags_filter.sim
浏览文件 @
c77d3a2a
...
...
@@ -23,7 +23,7 @@ sql create table stb (ts timestamp, c1 int) tags (t1 binary(10))
sql create table tb1 using stb tags('*')
sql create table tb2 using stb tags('%')
sql create table tb3 using stb tags('')
sql create table tb4 using stb tags('
/
'')
sql create table tb4 using stb tags('
\
'')
sql insert into tb1 values ( $ts0 , 1)
sql insert into tb2 values ( $ts0 , 2)
...
...
@@ -54,7 +54,7 @@ if $data01 != 3 then
return -1
endi
sql select * from stb where t1 = '
/
''
sql select * from stb where t1 = '
\
''
if $rows != 1 then
return -1
endi
...
...
@@ -70,9 +70,8 @@ if $data01 != 1 then
return -1
endi
sql_error select * from stb where t1 > 1
sql_error select * from stb where t1 > '1'
sql_error select * from stb where t1 > 'a'
sql select * from stb where t1 > '1'
sql select * from stb where t1 > 'a'
## wildcard '%'
#sql select * from stb where t1 like '%'
...
...
@@ -91,7 +90,7 @@ if $data01 != 3 then
return -1
endi
sql select * from stb where t1 like '
/
''
sql select * from stb where t1 like '
\
''
if $rows != 1 then
return -1
endi
...
...
@@ -104,3 +103,50 @@ sql show databases
if $rows != 0 then
return -1
endi
print ============tbase-1328
sql drop database if exists testselectwheretags;
sql CREATE DATABASE IF NOT EXISTS testselectwheretags;
sql USE testselectwheretags;
sql CREATE TABLE IF NOT EXISTS st1 (ts TIMESTAMP, v1 INT, v2 FLOAT, v3 BOOL) TAGS (farm NCHAR(2), period NCHAR(2), line NCHAR(2), unit INT);
sql CREATE TABLE IF NOT EXISTS a01 USING st1 TAGS ('2', 'c', '2', 2);
sql CREATE TABLE IF NOT EXISTS a02 USING st1 TAGS ('1', 'c', 'a', 1);
sql CREATE TABLE IF NOT EXISTS a03 USING st1 TAGS ('1', 'c', '02', 1);
sql INSERT INTO a01 VALUES (1574872693209, 3, 3.000000, 1);
sql INSERT INTO a02 VALUES (1574872683933, 2, 2.000000, 1);
sql INSERT INTO a03 VALUES (1574872683933, 2, 2.000000, 1);
sql select * from st1 where line='02';
if $rows != 1 then
return -1
endi
sql CREATE TABLE IF NOT EXISTS st2 (ts TIMESTAMP, v1 INT, v2 FLOAT) TAGS (farm BINARY(2), period BINARY(2), line BINARY(2));
sql CREATE TABLE IF NOT EXISTS b01 USING st2 TAGS ('01', '01', '01');
sql CREATE TABLE IF NOT EXISTS b02 USING st2 TAGS ('01', '01', '01');
sql CREATE TABLE IF NOT EXISTS b03 USING st2 TAGS ('01', '02', '01');
sql CREATE TABLE IF NOT EXISTS b04 USING st2 TAGS ('01', '01', '02');
sql INSERT INTO b03 VALUES (1576043322749, 3, 3.000000);
sql INSERT INTO b03 VALUES (1576043323596, 3, 3.000000);
sql INSERT INTO b02 VALUES (1576043315169, 2, 2.000000);
sql INSERT INTO b02 VALUES (1576043316295, 2, 2.000000);
sql INSERT INTO b02 VALUES (1576043317167, 2, 2.000000);
sql INSERT INTO b01 VALUES (1576043305972, 1, 1.000000);
sql INSERT INTO b01 VALUES (1576043308513, 1, 1.000000);
sql select * from st2 where period='02';
if $rows != 2 then
return -1
endi
sql select sum(v2) from st2 group by farm,period,line;
if $rows != 2 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录