未验证 提交 abf7a9e7 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #15557 from taosdata/fix/tsim

test: restore case
......@@ -25,9 +25,9 @@ TDengine 分布式架构的逻辑结构图如下:
**管理节点(mnode):** 一个虚拟的逻辑单元,负责所有数据节点运行状态的监控和维护,以及节点之间的负载均衡(图中 M)。同时,管理节点也负责元数据(包括用户、数据库、超级表等)的存储和管理,因此也称为 Meta Node。TDengine 集群中可配置多个(最多不超过 3 个)mnode,它们自动构建成为一个虚拟管理节点组(图中 M1,M2,M3)。mnode 支持多副本,采用 RAFT 一致性协议,保证系统的高可用与高可靠,任何数据更新操作只能在 Leader 上进行。mnode 集群的第一个节点在集群部署时自动完成,其他节点的创建与删除由用户通过 SQL 命令完成。每个 dnode 上至多有一个 mnode,由所属的数据节点的 EP 来唯一标识。每个 dnode 通过内部消息交互自动获取整个集群中所有 mnode 所在的 dnode 的 EP。
**弹性计算点(qnode):** 一个虚拟的逻辑单元,运行查询计算任务,也包括基于系统表来实现的 show 命令(图中 Q)。集群中可配置多个 qnode,在整个集群内部共享使用(图中 Q1,Q2,Q3)。qnode 不与具体的 DB 绑定,即一个 qnode 可以同时执行多个 DB 的查询任务。每个 dnode 上至多有一个 qnode,由所属的数据节点的 EP 来唯一标识。客户端通过与 mnode 交互,获取可用的 qnode 列表,当没有可用的 qnode 时,计算任务在 vnode 中执行。
**弹性计算点(qnode):** 一个虚拟的逻辑单元,运行查询计算任务,也包括基于系统表来实现的 show 命令(图中 Q)。集群中可配置多个 qnode,在整个集群内部共享使用(图中 Q1,Q2,Q3)。qnode 不与具体的 DB 绑定,即一个 qnode 可以同时执行多个 DB 的查询任务。每个 dnode 上至多有一个 qnode,由所属的数据节点的 EP 来唯一标识。客户端通过与 mnode 交互,获取可用的 qnode 列表,当没有可用的 qnode 时,计算任务在 vnode 中执行。
**流计算点(snode):** 一个虚拟的逻辑单元,只运行流计算任务(图中 S)。集群中可配置多个 snode,在整个集群内部共享使用(图中 S1,S2,S3)。snode 不与具体的 stream 绑定,即一个 snode 可以同时执行多个 stream 的计算任务。每个 dnode 上至多有一个 snode,由所属的数据节点的 EP 来唯一标识。由 mnode 调度可用的 snode 完成流计算任务,当没有可用的 snode 时,流计算任务在 vnode 中执行。
**流计算点(snode):** 一个虚拟的逻辑单元,只运行流计算任务(图中 S)。集群中可配置多个 snode,在整个集群内部共享使用(图中 S1,S2,S3)。snode 不与具体的 stream 绑定,即一个 snode 可以同时执行多个 stream 的计算任务。每个 dnode 上至多有一个 snode,由所属的数据节点的 EP 来唯一标识。由 mnode 调度可用的 snode 完成流计算任务,当没有可用的 snode 时,流计算任务在 vnode 中执行。
**虚拟节点组(VGroup):** 不同数据节点上的 vnode 可以组成一个虚拟节点组(vgroup),采用 RAFT 一致性协议,保证系统的高可用与高可靠。写操作只能在 leader vnode 上进行,系统采用异步复制的方式将数据同步到 follower vnode,这样确保了一份数据在多个物理节点上有拷贝。一个 vgroup 里虚拟节点个数就是数据的副本数。如果一个 DB 的副本数为 N,系统必须有至少 N 数据节点。副本数在创建 DB 时通过参数 replica 可以指定,缺省为 1。使用 TDengine 的多副本特性,可以不再需要昂贵的磁盘阵列等存储设备,就可以获得同样的数据高可靠性。虚拟节点组由管理节点创建、管理,并且由管理节点分配一个系统唯一的 ID,VGroup ID。如果两个虚拟节点的 VGroup ID 相同,说明他们属于同一个组,数据互为备份。虚拟节点组里虚拟节点的个数是可以动态改变的,容许只有一个,也就是没有数据复制。VGroup ID 是永远不变的,即使一个虚拟节点组被删除,它的 ID 也不会被收回重复利用。
......@@ -103,11 +103,11 @@ TDengine 存储的数据包括采集的时序数据以及库、表相关的元
vnode(虚拟数据节点)负责为采集的时序数据提供写入、查询和计算功能。为便于负载均衡、数据恢复、支持异构环境,TDengine 将一个数据节点根据其计算和存储资源切分为多个 vnode。这些 vnode 的管理是 TDengine 自动完成的,对应用完全透明。
对于单独一个数据采集点,无论其数据量多大,一个 vnode(或 vgroup,如果副本数大于 1)有足够的计算资源和存储资源来处理(如果每秒生成一条 16 字节的记录,一年产生的原始数据不到 0.5G),因此 TDengine 将一张表(一个数据采集点)的所有数据都存放在一个 vnode 里,而不会让同一个采集点的数据分布到两个或多个 dnode 上。而且一个 vnode 可存储多个数据采集点(表)的数据,一个 vnode 可容纳的表的数目的上限为一百万。设计上,一个 vnode 里所有的表都属于同一个 DB。一个数据节点上,除非特殊配置,一个 DB 拥有的 vnode 数目不会超过系统核的数目。
对于单独一个数据采集点,无论其数据量多大,一个 vnode(或 vgroup,如果副本数大于 1)有足够的计算资源和存储资源来处理(如果每秒生成一条 16 字节的记录,一年产生的原始数据不到 0.5G),因此 TDengine 将一张表(一个数据采集点)的所有数据都存放在一个 vnode 里,而不会让同一个采集点的数据分布到两个或多个 dnode 上。而且一个 vnode 可存储多个数据采集点(表)的数据,一个 vnode 可容纳的表的数目的上限为一百万。设计上,一个 vnode 里所有的表都属于同一个 DB。
TDengine 3.0 采用 hash 一致性算法,确定每张数据表所在的 vnode。创建 DB 时,系统会立刻分配指定数目的 vnode,并确定每个 vnode 所负责的数据表范围。当创建一张表时,系统根据数据表名计算出所在的 vnodeID,立即在该 vnode 创建表。如果 DB 有多个副本,系统不是只创建一个 vnode,而是一个 vgroup(虚拟数据节点组)。系统对 vnode 的数目没有任何限制,仅仅受限于物理节点本身的计算和存储资源。
每张表的 meta data(包含 schema,标签等)也存放于 vnode 里,而不是集中存放于 mnode,实际上这是对 Meta 数据的分片,这样便于高效并行的进行标签过滤操作。
每张表的 meta data(包含 schema,标签等)也存放于 vnode 里,而不是集中存放于 mnode,实际上这是对 meta 数据的分片,这样便于高效并行的进行标签过滤操作。
### 数据分区
......
......@@ -89,13 +89,20 @@
./test.sh -f tsim/parser/alter_column.sim
./test.sh -f tsim/parser/alter_stable.sim
./test.sh -f tsim/parser/alter.sim
# TD-17661 ./test.sh -f tsim/parser/alter1.sim
# TD-17959 ./test.sh -f tsim/parser/alter1.sim
./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim
./test.sh -f tsim/parser/auto_create_tb.sim
./test.sh -f tsim/parser/between_and.sim
./test.sh -f tsim/parser/binary_escapeCharacter.sim
# TD-17738 ./test.sh -f tsim/parser/col_arithmetic_operation.sim
# TD-17661 ./test.sh -f tsim/parser/columnValue.sim
./test.sh -f tsim/parser/col_arithmetic_operation.sim
./test.sh -f tsim/parser/columnValue_bigint.sim
./test.sh -f tsim/parser/columnValue_bool.sim
./test.sh -f tsim/parser/columnValue_double.sim
./test.sh -f tsim/parser/columnValue_float.sim
./test.sh -f tsim/parser/columnValue_int.sim
./test.sh -f tsim/parser/columnValue_smallint.sim
./test.sh -f tsim/parser/columnValue_tinyint.sim
./test.sh -f tsim/parser/columnValue_unsign.sim
./test.sh -f tsim/parser/commit.sim
./test.sh -f tsim/parser/condition.sim
./test.sh -f tsim/parser/constCol.sim
......@@ -145,7 +152,7 @@
./test.sh -f tsim/parser/select_across_vnodes.sim
./test.sh -f tsim/parser/select_distinct_tag.sim
./test.sh -f tsim/parser/select_from_cache_disk.sim
# TD-17832 ./test.sh -f tsim/parser/select_with_tags.sim
./test.sh -f tsim/parser/select_with_tags.sim
./test.sh -f tsim/parser/selectResNum.sim
./test.sh -f tsim/parser/set_tag_vals.sim
./test.sh -f tsim/parser/single_row_in_tb.sim
......@@ -154,15 +161,15 @@
./test.sh -f tsim/parser/slimit.sim
./test.sh -f tsim/parser/slimit1.sim
./test.sh -f tsim/parser/stableOp.sim
# TD-17661 ./test.sh -f tsim/parser/tags_dynamically_specifiy.sim
# TD-17661 ./test.sh -f tsim/parser/tags_filter.sim
./test.sh -f tsim/parser/tags_dynamically_specifiy.sim
./test.sh -f tsim/parser/tags_filter.sim
./test.sh -f tsim/parser/tbnameIn.sim
./test.sh -f tsim/parser/timestamp.sim
./test.sh -f tsim/parser/top_groupby.sim
./test.sh -f tsim/parser/topbot.sim
./test.sh -f tsim/parser/union.sim
# TD-17704 ./test.sh -f tsim/parser/union_sysinfo.sim
# TD-17661 ./test.sh -f tsim/parser/where.sim
./test.sh -f tsim/parser/union_sysinfo.sim
./test.sh -f tsim/parser/where.sim
# ---- query ----
./test.sh -f tsim/query/charScalarFunction.sim
......@@ -422,18 +429,18 @@
./test.sh -f tsim/tag/bool_binary.sim
./test.sh -f tsim/tag/bool_int.sim
./test.sh -f tsim/tag/bool.sim
# TD-17661 ./test.sh -f tsim/tag/change.sim
# TD-17407 ./test.sh -f tsim/tag/change.sim
./test.sh -f tsim/tag/column.sim
./test.sh -f tsim/tag/commit.sim
# TD-17661 ./test.sh -f tsim/tag/create.sim
# TD-17661 ./test.sh -f tsim/tag/delete.sim
# TD-17661 ./test.sh -f tsim/tag/double.sim
# TD-17661 ./test.sh -f tsim/tag/filter.sim
# TD-17407 ./test.sh -f tsim/tag/create.sim
# TD-17407 ./test.sh -f tsim/tag/delete.sim
# TD-17407 ./test.sh -f tsim/tag/double.sim
./test.sh -f tsim/tag/filter.sim
# TD-17407 ./test.sh -f tsim/tag/float.sim
./test.sh -f tsim/tag/int_binary.sim
./test.sh -f tsim/tag/int_float.sim
./test.sh -f tsim/tag/int.sim
# TD-17661 ./test.sh -f tsim/tag/set.sim
# TD-17959 ./test.sh -f tsim/tag/set.sim
./test.sh -f tsim/tag/smallint.sim
./test.sh -f tsim/tag/tinyint.sim
......
......@@ -103,7 +103,7 @@ endi
print ================== change a tag value
sql alter table car1 set tag carid=10
sql select carId, carmodel from car1
sql select distinct carId, carmodel from car1
if $rows != 1 then
return -1
endi
......
......@@ -131,20 +131,5 @@ sql_error select max(c1-c2) from $tb
#========================================regression test cases====================================
print =====================> td-1764
sql select sum(c1)/count(*), sum(c1) as b, count(*) as b from $stb interval(1y)
if $rows != 1 then
return -1
endi
if $data00 != @18-01-01 00:00:00.000@ then
return -1
endi
if $data01 != 2.250000000 then
return -1
endi
if $data02 != 225000 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
......@@ -511,24 +511,21 @@ if $rows != 1 then
endi
# slimit/soffset not support for normal table query. [d.11]===============================================================
sql select sum(c1) from $stb slimit 1 soffset 19;
if $rows != 0 then
return -1
endi
sql_error select sum(c1) from $stb slimit 1 soffset 19;
sql select sum(c1) from $stb interval(1s) group by tbname slimit 1 soffset 1
sql select sum(c1) from ca_stb0 interval(1s) group by tbname slimit 2 soffset 4 limit 10 offset 1
sql select sum(c1) from ca_stb0 partition by tbname interval(1s) slimit 1 soffset 1
sql select sum(c1) from ca_stb0 partition by tbname interval(1s) slimit 2 soffset 4 limit 10 offset 1
# fill [d.12]===============================================================
sql_error select first(c1)-last(c1), sum(c3)*count(c3), spread(c5 ) % count(*) from $stb interval(1s) fill(prev);
sql_error select first(c1) from $stb fill(value, 20);
sql_error select first(c1)-last(c1), sum(c3)*count(c3), spread(c5 ) % count(*) from ca_stb0 interval(1s) fill(prev);
sql_error select first(c1) from ca_stb0 fill(value, 20);
# constant column. [d.13]===============================================================
# column value filter [d.14]===============================================================
# tag filter. [d.15]===============================================================
sql select sum(c2)+99 from $stb where t1=12;
sql select sum(c2)+99 from ca_stb0 where t1=12;
# multi-field output [d.16]===============================================================
sql select count(*), sum(c1)*avg(c2), avg(c3)*count(c3), sum(c3), sum(c4), first(c7), last(c8), first(c9), first(c7), last(c8) from $tb
......@@ -548,15 +545,12 @@ if $data90 != 9.500000000 then
endi
# interval query [d.17]===============================================================
sql select avg(c2)*count(c2), sum(c3)-first(c3), last(c4)+9 from $stb interval(1s)
sql select avg(c2)*count(c2), sum(c3)-first(c3), last(c4)+9 from ca_stb0 interval(1s)
if $rows != 10000 then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
return -1
endi
sql_error select first(c7)- last(c1) from $tb interval(2y)
sql select first(c7)- last(c1) from $tb interval(2y)
# aggregation query [d.18]===============================================================
# all cases in this part are aggregation query test.
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
run tsim/parser/columnValue_bool.sim
run tsim/parser/columnValue_tinyint.sim
run tsim/parser/columnValue_smallint.sim
run tsim/parser/columnValue_int.sim
run tsim/parser/columnValue_bigint.sim
run tsim/parser/columnValue_float.sim
run tsim/parser/columnValue_double.sim
run tsim/parser/columnValue_unsign.sim
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database if not exists db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
......@@ -10,78 +17,64 @@ sql create table mt_bigint (ts timestamp, c bigint) tags (tagname bigint)
## case 00: static create table for test tag values
sql create table st_bigint_0 using mt_bigint tags (NULL)
sql select tagname from st_bigint_0
if $data00 != NULL then
sql show tags from st_bigint_0
if $data05 != NULL then
return -1
endi
sql create table st_bigint_1 using mt_bigint tags (NULL)
sql select tagname from st_bigint_1
if $data00 != NULL then
return -1
endi
sql create table st_bigint_2 using mt_bigint tags ('NULL')
sql select tagname from st_bigint_2
if $data00 != NULL then
return -1
endi
sql create table st_bigint_3 using mt_bigint tags ('NULL')
sql select tagname from st_bigint_3
if $data00 != NULL then
return -1
endi
sql create table st_bigint_4 using mt_bigint tags ("NULL")
sql select tagname from st_bigint_4
if $data00 != NULL then
return -1
endi
sql create table st_bigint_5 using mt_bigint tags ("NULL")
sql select tagname from st_bigint_5
if $data00 != NULL then
sql show tags from st_bigint_1
if $data05 != NULL then
return -1
endi
sql_error create table st_bigint_2 using mt_bigint tags ('NULL')
sql_error create table st_bigint_3 using mt_bigint tags ('NULL')
sql_error create table st_bigint_4 using mt_bigint tags ("NULL")
sql_error create table st_bigint_5 using mt_bigint tags ("NULL")
sql create table st_bigint_6 using mt_bigint tags (-9223372036854775807)
sql select tagname from st_bigint_6
if $data00 != -9223372036854775807 then
sql show tags from st_bigint_6
if $data05 != -9223372036854775807 then
return -1
endi
sql create table st_bigint_7 using mt_bigint tags (9223372036854775807)
sql select tagname from st_bigint_7
if $data00 != 9223372036854775807 then
sql show tags from st_bigint_7
if $data05 != 9223372036854775807 then
return -1
endi
sql create table st_bigint_8 using mt_bigint tags (37)
sql select tagname from st_bigint_8
if $data00 != 37 then
sql show tags from st_bigint_8
if $data05 != 37 then
return -1
endi
sql create table st_bigint_9 using mt_bigint tags (-100)
sql select tagname from st_bigint_9
if $data00 != -100 then
sql show tags from st_bigint_9
if $data05 != -100 then
return -1
endi
sql create table st_bigint_10 using mt_bigint tags (+113)
sql select tagname from st_bigint_10
if $data00 != 113 then
sql show tags from st_bigint_10
if $data05 != 113 then
return -1
endi
sql create table st_bigint_11 using mt_bigint tags ('-100')
sql select tagname from st_bigint_11
if $data00 != -100 then
sql show tags from st_bigint_11
if $data05 != -100 then
return -1
endi
sql create table st_bigint_12 using mt_bigint tags ("+78")
sql select tagname from st_bigint_12
if $data00 != 78 then
sql show tags from st_bigint_12
if $data05 != 78 then
return -1
endi
sql create table st_bigint_13 using mt_bigint tags (+0078)
sql select tagname from st_bigint_13
if $data00 != 78 then
sql show tags from st_bigint_13
if $data05 != 78 then
return -1
endi
sql create table st_bigint_14 using mt_bigint tags (-00078)
sql select tagname from st_bigint_14
if $data00 != -78 then
sql show tags from st_bigint_14
if $data05 != -78 then
return -1
endi
......@@ -102,38 +95,7 @@ endi
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_2 values (now, 'NULL')
sql select * from st_bigint_2
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_3 values (now, 'NULL')
sql select * from st_bigint_3
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_4 values (now, "NULL")
sql select * from st_bigint_4
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_5 values (now, "NULL")
sql select * from st_bigint_5
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_6 values (now, 9223372036854775807)
sql select * from st_bigint_6
if $rows != 1 then
......@@ -211,8 +173,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_bigint_16 using mt_bigint tags (NULL) values (now, NULL)
sql select tagname from st_bigint_16
if $data00 != NULL then
sql show tags from st_bigint_16
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_16
......@@ -221,8 +183,8 @@ if $data01 != NULL then
endi
sql insert into st_bigint_17 using mt_bigint tags (NULL) values (now, NULL)
sql select tagname from st_bigint_17
if $data00 != NULL then
sql show tags from st_bigint_17
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_17
......@@ -230,8 +192,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bigint_18 using mt_bigint tags ('NULL') values (now, 'NULL')
sql select tagname from st_bigint_18
if $data00 != NULL then
sql show tags from st_bigint_18
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_18
......@@ -239,8 +201,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bigint_19 using mt_bigint tags ('NULL') values (now, 'NULL')
sql select tagname from st_bigint_19
if $data00 != NULL then
sql show tags from st_bigint_19
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_19
......@@ -248,8 +210,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bigint_20 using mt_bigint tags ("NULL") values (now, "NULL")
sql select tagname from st_bigint_20
if $data00 != NULL then
sql show tags from st_bigint_20
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_20
......@@ -257,8 +219,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bigint_21 using mt_bigint tags ("NULL") values (now, "NULL")
sql select tagname from st_bigint_21
if $data00 != NULL then
sql show tags from st_bigint_21
if $data05 != NULL then
return -1
endi
sql select * from st_bigint_21
......@@ -266,8 +228,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bigint_22 using mt_bigint tags (9223372036854775807) values (now, 9223372036854775807)
sql select tagname from st_bigint_22
if $data00 != 9223372036854775807 then
sql show tags from st_bigint_22
if $data05 != 9223372036854775807 then
return -1
endi
sql select * from st_bigint_22
......@@ -275,8 +237,8 @@ if $data01 != 9223372036854775807 then
return -1
endi
sql insert into st_bigint_23 using mt_bigint tags (-9223372036854775807) values (now, -9223372036854775807)
sql select tagname from st_bigint_23
if $data00 != -9223372036854775807 then
sql show tags from st_bigint_23
if $data05 != -9223372036854775807 then
return -1
endi
sql select * from st_bigint_23
......@@ -284,8 +246,8 @@ if $data01 != -9223372036854775807 then
return -1
endi
sql insert into st_bigint_24 using mt_bigint tags (10) values (now, 10)
sql select tagname from st_bigint_24
if $data00 != 10 then
sql show tags from st_bigint_24
if $data05 != 10 then
return -1
endi
sql select * from st_bigint_24
......@@ -293,8 +255,8 @@ if $data01 != 10 then
return -1
endi
sql insert into st_bigint_25 using mt_bigint tags ("-0") values (now, "-0")
sql select tagname from st_bigint_25
if $data00 != 0 then
sql show tags from st_bigint_25
if $data05 != 0 then
return -1
endi
sql select * from st_bigint_25
......@@ -302,8 +264,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_bigint_26 using mt_bigint tags ('123') values (now, '123')
sql select tagname from st_bigint_26
if $data00 != 123 then
sql show tags from st_bigint_26
if $data05 != 123 then
return -1
endi
sql select * from st_bigint_26
......@@ -311,8 +273,8 @@ if $data01 != 123 then
return -1
endi
sql insert into st_bigint_27 using mt_bigint tags (+056) values (now, +00056)
sql select tagname from st_bigint_27
if $data00 != 56 then
sql show tags from st_bigint_27
if $data05 != 56 then
return -1
endi
sql select * from st_bigint_27
......@@ -320,8 +282,8 @@ if $data01 != 56 then
return -1
endi
sql insert into st_bigint_28 using mt_bigint tags (-056) values (now, -0056)
sql select tagname from st_bigint_28
if $data00 != -56 then
sql show tags from st_bigint_28
if $data05 != -56 then
return -1
endi
sql select * from st_bigint_28
......@@ -331,50 +293,50 @@ endi
### case 03: alter tag values
#sql alter table st_bigint_0 set tag tagname=9223372036854775807
#sql select tagname from st_bigint_0
#if $data00 != 9223372036854775807 then
#sql show tags from st_bigint_0
#if $data05 != 9223372036854775807 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname=-9223372036854775807
#sql select tagname from st_bigint_0
#if $data00 != -9223372036854775807 then
#sql show tags from st_bigint_0
#if $data05 != -9223372036854775807 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname=+100
#sql select tagname from st_bigint_0
#if $data00 != 100 then
#sql show tags from st_bigint_0
#if $data05 != 100 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname=-33
#sql select tagname from st_bigint_0
#if $data00 != -33 then
#sql show tags from st_bigint_0
#if $data05 != -33 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname='+98'
#sql select tagname from st_bigint_0
#if $data00 != 98 then
#sql show tags from st_bigint_0
#if $data05 != 98 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname='-076'
#sql select tagname from st_bigint_0
#if $data00 != -76 then
#sql show tags from st_bigint_0
#if $data05 != -76 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname=+0012
#sql select tagname from st_bigint_0
#if $data00 != 12 then
#sql show tags from st_bigint_0
#if $data05 != 12 then
# return -1
#endi
#sql alter table st_bigint_0 set tag tagname=-00063
#sql select tagname from st_bigint_0
#if $data00 != -63 then
#sql show tags from st_bigint_0
#if $data05 != -63 then
# return -1
#endi
## case 04: illegal input
################## when overflow, auto set max
sql_error create table st_bigint_e0 using mt_bigint tags (9223372036854775808)
sql_error create table st_bigint_e0_1 using mt_bigint tags (-9223372036854775808)
sql create table st_bigint_e0_1 using mt_bigint tags (-9223372036854775808)
sql_error create table st_bigint_e0_2 using mt_bigint tags (92233720368547758080)
sql_error create table st_bigint_e0_3 using mt_bigint tags (-9223372036854775809)
#sql_error create table st_bigint_e0 using mt_bigint tags (12.80) truncate integer part
......@@ -384,7 +346,7 @@ sql_error create table st_bigint_e0 using mt_bigint tags ("123abc")
sql_error create table st_bigint_e0 using mt_bigint tags (abc)
sql_error create table st_bigint_e0 using mt_bigint tags ("abc")
sql_error create table st_bigint_e0 using mt_bigint tags (" ")
sql_error create table st_bigint_e0 using mt_bigint tags ('')
sql create table st_bigint_e0_error using mt_bigint tags ('')
sql create table st_bigint_e0 using mt_bigint tags (123)
sql create table st_bigint_e1 using mt_bigint tags (123)
......@@ -401,9 +363,9 @@ sql create table st_bigint_e11 using mt_bigint tags (123)
sql create table st_bigint_e12 using mt_bigint tags (123)
sql_error insert into st_bigint_e0 values (now, 9223372036854775808)
sql_error insert into st_bigint_e1 values (now, -9223372036854775808)
sql insert into st_bigint_e1 values (now, -9223372036854775808)
sql_error insert into st_bigint_e2 values (now, 9223372036854775809)
sql_error insert into st_bigint_e3 values (now, -9223372036854775808)
sql insert into st_bigint_e3 values (now, -9223372036854775808)
#sql_error insert into st_bigint_e4 values (now, 922337203.6854775808)
#sql_error insert into st_bigint_e5 values (now, -922337203685477580.9)
sql_error insert into st_bigint_e6 values (now, 123abc)
......@@ -411,10 +373,10 @@ sql_error insert into st_bigint_e7 values (now, "123abc")
sql_error insert into st_bigint_e9 values (now, abc)
sql_error insert into st_bigint_e10 values (now, "abc")
sql_error insert into st_bigint_e11 values (now, " ")
sql_error insert into st_bigint_e12 values (now, '')
sql insert into st_bigint_e12 values (now, '')
sql_error insert into st_bigint_e13 using mt_bigint tags (033) values (now, 9223372036854775808)
sql_error insert into st_bigint_e14 using mt_bigint tags (033) values (now, -9223372036854775808)
sql insert into st_bigint_e14 using mt_bigint tags (033) values (now, -9223372036854775808)
sql_error insert into st_bigint_e15 using mt_bigint tags (033) values (now, 9223372036854775818)
sql_error insert into st_bigint_e16 using mt_bigint tags (033) values (now, -9923372036854775808)
#sql_error insert into st_bigint_e17 using mt_bigint tags (033) values (now, 92233720368547758.08)
......@@ -424,10 +386,10 @@ sql_error insert into st_bigint_e20 using mt_bigint tags (033) values (now, "123
sql_error insert into st_bigint_e22 using mt_bigint tags (033) values (now, abc)
sql_error insert into st_bigint_e23 using mt_bigint tags (033) values (now, "abc")
sql_error insert into st_bigint_e24 using mt_bigint tags (033) values (now, " ")
sql_error insert into st_bigint_e25 using mt_bigint tags (033) values (now, '')
sql insert into st_bigint_e25 using mt_bigint tags (033) values (now, '')
sql_error insert into st_bigint_e13_0 using mt_bigint tags (9223372036854775808) values (now, -033)
sql_error insert into st_bigint_e14_0 using mt_bigint tags (-9223372036854775808) values (now, -033)
sql insert into st_bigint_e14_0 using mt_bigint tags (-9223372036854775808) values (now, -033)
sql_error insert into st_bigint_e15_0 using mt_bigint tags (9223372036854775809) values (now, -033)
sql_error insert into st_bigint_e16_0 using mt_bigint tags (-9223372036854775898) values (now, -033)
#sql_error insert into st_bigint_e17 using mt_bigint tags (12.80) values (now, -033)
......@@ -437,7 +399,7 @@ sql_error insert into st_bigint_e20 using mt_bigint tags ("123abc") values (now,
sql_error insert into st_bigint_e22 using mt_bigint tags (abc) values (now, -033)
sql_error insert into st_bigint_e23 using mt_bigint tags ("abc") values (now, -033)
sql_error insert into st_bigint_e24 using mt_bigint tags (" ") values (now, -033)
sql_error insert into st_bigint_e25 using mt_bigint tags ('') values (now, -033)
sql insert into st_bigint_e25 using mt_bigint tags ('') values (now, -033)
sql insert into st_bigint_e13 using mt_bigint tags (033) values (now, 00062)
sql insert into st_bigint_e14 using mt_bigint tags (033) values (now, 00062)
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database if not exists db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
......@@ -10,110 +17,110 @@ sql create table mt_bool (ts timestamp, c bool) tags (tagname bool)
## case 00: static create table for test tag values
sql create table st_bool_0 using mt_bool tags (NULL)
sql select tagname from st_bool_0
if $data00 != NULL then
print ==1== expect: NULL, actually: $data00
sql show tags from st_bool_0
if $data05 != NULL then
print ==1== expect: NULL, actually: $data05
return -1
endi
sql create table st_bool_1 using mt_bool tags (NULL)
sql select tagname from st_bool_1
if $data00 != NULL then
print ==2== expect: NULL, actually: $data00
sql show tags from st_bool_1
if $data05 != NULL then
print ==2== expect: NULL, actually: $data05
return -1
endi
sql create table st_bool_2 using mt_bool tags ('NULL')
sql select tagname from st_bool_2
if $data00 != NULL then
print ==3== expect: NULL, actually: $data00
sql show tags from st_bool_2
if $data05 != false then
print ==3== expect: false, actually: $data05
return -1
endi
sql create table st_bool_3 using mt_bool tags ('NULL')
sql select tagname from st_bool_3
if $data00 != NULL then
print ==4== expect: NULL, actually: $data00
sql show tags from st_bool_3
if $data05 != false then
print ==4== expect: false, actually: $data05
return -1
endi
sql create table st_bool_4 using mt_bool tags ("NULL")
sql select tagname from st_bool_4
if $data00 != NULL then
print ==5== expect: NULL, actually: $data00
sql show tags from st_bool_4
if $data05 != false then
print ==5== expect: false, actually: $data05
return -1
endi
sql create table st_bool_5 using mt_bool tags ("NULL")
sql select tagname from st_bool_5
if $data00 != NULL then
print ==6== expect: NULL, actually: $data00
sql show tags from st_bool_5
if $data05 != false then
print ==6== expect: false, actually: $data05
return -1
endi
sql create table st_bool_6 using mt_bool tags ("true")
sql select tagname from st_bool_6
if $data00 != 1 then
print ==7== expect: 1, actually: $data00
sql show tags from st_bool_6
if $data05 != true then
print ==7== expect: 1, actually: $data05
return -1
endi
sql create table st_bool_7 using mt_bool tags ('true')
sql select tagname from st_bool_7
if $data00 != 1 then
print ==8== expect: 1, actually: $data00
sql show tags from st_bool_7
if $data05 != true then
print ==8== expect: 1, actually: $data05
return -1
endi
sql create table st_bool_8 using mt_bool tags (true)
sql select tagname from st_bool_8
if $data00 != 1 then
print ==9== expect: 1, actually: $data00
sql show tags from st_bool_8
if $data05 != true then
print ==9== expect: 1, actually: $data05
return -1
endi
sql create table st_bool_9 using mt_bool tags ("false")
sql select tagname from st_bool_9
if $data00 != 0 then
print ==10== expect: 0, actually: $data00
sql show tags from st_bool_9
if $data05 != false then
print ==10== expect: 0, actually: $data05
return -1
endi
sql create table st_bool_10 using mt_bool tags ('false')
sql select tagname from st_bool_10
if $data00 != 0 then
print ==11== expect: 0, actually: $data00
sql show tags from st_bool_10
if $data05 != false then
print ==11== expect: 0, actually: $data05
return -1
endi
sql create table st_bool_11 using mt_bool tags (false)
sql select tagname from st_bool_11
if $data00 != 0 then
print ==12== expect: 0, actually: $data00
sql show tags from st_bool_11
if $data05 != false then
print ==12== expect: 0, actually: $data05
return -1
endi
sql create table st_bool_12 using mt_bool tags (0)
sql select tagname from st_bool_12
if $data00 != 0 then
print ==13== expect: 0, actually: $data00
sql show tags from st_bool_12
if $data05 != false then
print ==13== expect: 0, actually: $data05
return -1
endi
sql create table st_bool_13 using mt_bool tags (1)
sql select tagname from st_bool_13
if $data00 != 1 then
print ==14== expect: 1, actually: $data00
sql show tags from st_bool_13
if $data05 != true then
print ==14== expect: 1, actually: $data05
return -1
endi
sql create table st_bool_14 using mt_bool tags (6.9)
sql select tagname from st_bool_14
if $data00 != 1 then
print ==15== expect: 1, actually: $data00
sql show tags from st_bool_14
if $data05 != true then
print ==15== expect: 1, actually: $data05
return -1
endi
sql create table st_bool_15 using mt_bool tags (-3)
sql select tagname from st_bool_15
if $data00 != 1 then
sql show tags from st_bool_15
if $data05 != true then
print ==16== expect: 1, actually: $data00
return -1
endi
sql create table st_bool_15_0 using mt_bool tags (+300)
sql select tagname from st_bool_15_0
if $data00 != 1 then
sql show tags from st_bool_15_0
if $data05 != true then
print ==16== expect: 1, actually: $data00
return -1
endi
sql create table st_bool_15_1 using mt_bool tags (-8.03)
sql select tagname from st_bool_15_1
if $data00 != 1 then
sql show tags from st_bool_15_1
if $data05 != true then
print ==16== expect: 1, actually: $data00
return -1
endi
......@@ -284,8 +291,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_bool_16 using mt_bool tags (NULL) values (now, NULL)
sql select tagname from st_bool_16
if $data00 != NULL then
sql show tags from st_bool_16
if $data05 != NULL then
print ==33== expect: NULL, actually: $data00
return -1
endi
......@@ -296,8 +303,8 @@ if $data01 != NULL then
endi
sql insert into st_bool_17 using mt_bool tags (NULL) values (now, NULL)
sql select tagname from st_bool_17
if $data00 != NULL then
sql show tags from st_bool_17
if $data05 != NULL then
print ==35== expect: NULL, actually: $data00
return -1
endi
......@@ -307,8 +314,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bool_18 using mt_bool tags ('NULL') values (now, 'NULL')
sql select tagname from st_bool_18
if $data00 != NULL then
sql show tags from st_bool_18
if $data05 != NULL then
print ==37== expect: NULL, actually: $data00
return -1
endi
......@@ -318,8 +325,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bool_19 using mt_bool tags ('NULL') values (now, 'NULL')
sql select tagname from st_bool_19
if $data00 != NULL then
sql show tags from st_bool_19
if $data05 != NULL then
print ==39== expect: NULL, actually: $data00
return -1
endi
......@@ -329,8 +336,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bool_20 using mt_bool tags ("NULL") values (now, "NULL")
sql select tagname from st_bool_20
if $data00 != NULL then
sql show tags from st_bool_20
if $data05 != NULL then
print ==41== expect: NULL, actually: $data00
return -1
endi
......@@ -340,8 +347,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bool_21 using mt_bool tags ("NULL") values (now, "NULL")
sql select tagname from st_bool_21
if $data00 != NULL then
sql show tags from st_bool_21
if $data05 != NULL then
print ==43== expect: NULL, actually: $data00
return -1
endi
......@@ -351,8 +358,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_bool_22 using mt_bool tags ("true") values (now, "true")
sql select tagname from st_bool_22
if $data00 != 1 then
sql show tags from st_bool_22
if $data05 != true then
print ==45== expect: 1, actually: $data00
return -1
endi
......@@ -362,8 +369,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_23 using mt_bool tags ('true') values (now, 'true')
sql select tagname from st_bool_23
if $data00 != 1 then
sql show tags from st_bool_23
if $data05 != true then
print ==47== expect: 1, actually: $data00
return -1
endi
......@@ -373,8 +380,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_24 using mt_bool tags (true) values (now, true)
sql select tagname from st_bool_24
if $data00 != 1 then
sql show tags from st_bool_24
if $data05 != true then
print ==49== expect: 1, actually: $data00
return -1
endi
......@@ -384,8 +391,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_25 using mt_bool tags ("false") values (now, "false")
sql select tagname from st_bool_25
if $data00 != 0 then
sql show tags from st_bool_25
if $data05 != false then
print ==51== expect: 0, actually: $data00
return -1
endi
......@@ -395,8 +402,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_bool_26 using mt_bool tags ('false') values (now, 'false')
sql select tagname from st_bool_26
if $data00 != 0 then
sql show tags from st_bool_26
if $data05 != false then
print ==53== expect: 0, actually: $data00
return -1
endi
......@@ -406,8 +413,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_bool_27 using mt_bool tags (false) values (now, false)
sql select tagname from st_bool_27
if $data00 != 0 then
sql show tags from st_bool_27
if $data05 != false then
print ==55== expect: 0, actually: $data00
return -1
endi
......@@ -417,8 +424,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_bool_28 using mt_bool tags (0) values (now, 0)
sql select tagname from st_bool_28
if $data00 != 0 then
sql show tags from st_bool_28
if $data05 != false then
print ==57== expect: 0, actually: $data00
return -1
endi
......@@ -428,8 +435,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_bool_29 using mt_bool tags (1) values (now, 1)
sql select tagname from st_bool_29
if $data00 != 1 then
sql show tags from st_bool_29
if $data05 != true then
print ==59== expect: 1, actually: $data00
return -1
endi
......@@ -439,8 +446,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_30 using mt_bool tags (6.9) values (now, 6.9)
sql select tagname from st_bool_30
if $data00 != 1 then
sql show tags from st_bool_30
if $data05 != true then
print ==61== expect: 1, actually: $data00
return -1
endi
......@@ -450,8 +457,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_31 using mt_bool tags (-3) values (now, -3)
sql select tagname from st_bool_31
if $data00 != 1 then
sql show tags from st_bool_31
if $data05 != true then
print ==63== expect: 1, actually: $data00
return -1
endi
......@@ -461,8 +468,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_32 using mt_bool tags (+300) values (now, +300)
sql select tagname from st_bool_32
if $data00 != 1 then
sql show tags from st_bool_32
if $data05 != true then
print ==63== expect: 1, actually: $data00
return -1
endi
......@@ -472,8 +479,8 @@ if $data01 != 1 then
return -1
endi
sql insert into st_bool_33 using mt_bool tags (+30.890) values (now, +30.890)
sql select tagname from st_bool_33
if $data00 != 1 then
sql show tags from st_bool_33
if $data05 != true then
print ==63== expect: 1, actually: $data00
return -1
endi
......@@ -490,140 +497,140 @@ endi
## case 03: alter tag values
#sql alter table st_bool_0 set tag tagname=true
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=NULL
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=false
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != false then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=NULL
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname='true'
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname='NULL'
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname='false'
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != false then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname='NULL'
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname="true"
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname="NULL"
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname="false"
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != false then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname="NULL"
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != NULL then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=1
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=0
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != false then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=6.9
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
#sql alter table st_bool_0 set tag tagname=-3
#sql select tagname from st_bool_0
#sql show tags from st_bool_0
#if $data00 != true then
# return -1
#endi
# case 04: illegal input
sql_error create table st_bool_e0 using mt_bool tags (123abc)
sql_error create table st_bool_e1 using mt_bool tags ("123abc")
sql_error create table st_bool_e2 using mt_bool tags ("123")
sql create table st_bool_e1 using mt_bool tags ("123abc")
sql create table st_bool_e2 using mt_bool tags ("123")
sql_error create table st_bool_e3 using mt_bool tags (abc)
sql_error create table st_bool_e4 using mt_bool tags ("abc")
sql_error create table st_bool_e5 using mt_bool tags (" ")
sql_error create table st_bool_e6 using mt_bool tags ('')
sql create table st_bool_e4 using mt_bool tags ("abc")
sql create table st_bool_e5 using mt_bool tags (" ")
sql create table st_bool_e6 using mt_bool tags ('')
sql create table st_bool_e0 using mt_bool tags (true)
sql create table st_bool_e1 using mt_bool tags (true)
sql create table st_bool_e2 using mt_bool tags (true)
sql create table st_bool_e3 using mt_bool tags (true)
sql create table st_bool_e4 using mt_bool tags (true)
sql create table st_bool_e5 using mt_bool tags (true)
sql create table st_bool_e6 using mt_bool tags (true)
sql create table st_bool_f0 using mt_bool tags (true)
sql create table st_bool_f1 using mt_bool tags (true)
sql create table st_bool_f2 using mt_bool tags (true)
sql create table st_bool_f3 using mt_bool tags (true)
sql create table st_bool_f4 using mt_bool tags (true)
sql create table st_bool_f5 using mt_bool tags (true)
sql create table st_bool_f6 using mt_bool tags (true)
sql_error insert into st_bool_e0 values (now, 123abc)
sql_error insert into st_bool_e1 values (now, "123abc")
sql_error insert into st_bool_e2 values (now, "123")
sql_error insert into st_bool_e3 values (now, abc)
sql_error insert into st_bool_e4 values (now, "abc")
sql_error insert into st_bool_e5 values (now, " ")
sql_error insert into st_bool_e6 values (now, '')
sql_error insert into st_bool_g0 values (now, 123abc)
sql_error insert into st_bool_g1 values (now, "123abc")
sql_error insert into st_bool_g2 values (now, "123")
sql_error insert into st_bool_g3 values (now, abc)
sql_error insert into st_bool_g4 values (now, "abc")
sql_error insert into st_bool_g5 values (now, " ")
sql_error insert into st_bool_g6 values (now, '')
sql_error insert into st_bool_e10 using mt_bool tags (123abc) values (now, 1)
sql_error insert into st_bool_e11 using mt_bool tags ("123abc") values (now, 1)
sql_error insert into st_bool_e12 using mt_bool tags ("123") values (now, 1)
sql_error insert into st_bool_e13 using mt_bool tags (abc) values (now, 1)
sql_error insert into st_bool_e14 using mt_bool tags ("abc") values (now, 1)
sql_error insert into st_bool_e15 using mt_bool tags (" ") values (now, 1)
sql_error insert into st_bool_e16 using mt_bool tags ('') values (now, 1)
sql_error insert into st_bool_h0 using mt_bool tags (123abc) values (now, 1)
sql_error insert into st_bool_h1 using mt_bool tags ("123abc") values (now, 1)
sql_error insert into st_bool_h2 using mt_bool tags ("123") values (now, 1)
sql_error insert into st_bool_h3 using mt_bool tags (abc) values (now, 1)
sql_error insert into st_bool_h4 using mt_bool tags ("abc") values (now, 1)
sql_error insert into st_bool_h5 using mt_bool tags (" ") values (now, 1)
sql_error insert into st_bool_h6 using mt_bool tags ('') values (now, 1)
sql_error insert into st_bool_e17 using mt_bool tags (1) values (now, 123abc)
sql_error insert into st_bool_e18 using mt_bool tags (1) values (now, "123abc")
sql_error insert into st_bool_e19 using mt_bool tags (1) values (now, "123")
sql_error insert into st_bool_e20 using mt_bool tags (1) values (now, abc)
sql_error insert into st_bool_e21 using mt_bool tags (1) values (now, "abc")
sql_error insert into st_bool_e22 using mt_bool tags (1) values (now, " ")
sql_error insert into st_bool_e23 using mt_bool tags (1) values (now, '')
sql_error insert into st_bool_h0 using mt_bool tags (1) values (now, 123abc)
sql_error insert into st_bool_h1 using mt_bool tags (1) values (now, "123abc")
sql_error insert into st_bool_h2 using mt_bool tags (1) values (now, "123")
sql_error insert into st_bool_h3 using mt_bool tags (1) values (now, abc)
sql_error insert into st_bool_h4 using mt_bool tags (1) values (now, "abc")
sql_error insert into st_bool_h5 using mt_bool tags (1) values (now, " ")
sql_error insert into st_bool_h6 using mt_bool tags (1) values (now, '')
sql insert into st_bool_e10 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e11 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e12 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e13 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e14 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e15 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_e16 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i0 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i1 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i2 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i3 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i4 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i5 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i6 using mt_bool tags (1) values (now, 1)
sql_error alter table st_bool_e10 set tag tagname=123abc
sql_error alter table st_bool_e11 set tag tagname="123abc"
sql_error alter table st_bool_e12 set tag tagname="123"
sql_error alter table st_bool_e13 set tag tagname=abc
sql_error alter table st_bool_e14 set tag tagname="abc"
sql_error alter table st_bool_e15 set tag tagname=" "
sql_error alter table st_bool_e16 set tag tagname=''
sql_error alter table st_bool_i0 set tag tagname=123abc
sql alter table st_bool_i1 set tag tagname="123abc"
sql alter table st_bool_i2 set tag tagname="123"
sql_error alter table st_bool_i3 set tag tagname=abc
sql alter table st_bool_i4 set tag tagname="abc"
sql alter table st_bool_i5 set tag tagname=" "
sql alter table st_bool_i6 set tag tagname=''
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database if not exists db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
......@@ -10,135 +17,135 @@ sql create table mt_double (ts timestamp, c double) tags (tagname double)
## case 00: static create table for test tag values
sql create table st_double_0 using mt_double tags (NULL )
sql select tagname from st_double_0
if $data00 != NULL then
sql show tags from st_double_0
if $data05 != NULL then
return -1
endi
sql create table st_double_1 using mt_double tags (NULL)
sql select tagname from st_double_1
if $data00 != NULL then
sql show tags from st_double_1
if $data05 != NULL then
return -1
endi
sql create table st_double_2 using mt_double tags ('NULL')
sql select tagname from st_double_2
if $data00 != NULL then
sql show tags from st_double_2
if $data05 != 0.000000000 then
return -1
endi
sql create table st_double_3 using mt_double tags ('NULL')
sql select tagname from st_double_3
if $data00 != NULL then
sql show tags from st_double_3
if $data05 != 0.000000000 then
return -1
endi
sql create table st_double_4 using mt_double tags ("NULL")
sql select tagname from st_double_4
if $data00 != NULL then
sql show tags from st_double_4
if $data05 != 0.000000000 then
return -1
endi
sql create table st_double_5 using mt_double tags ("NULL")
sql select tagname from st_double_5
if $data00 != NULL then
sql show tags from st_double_5
if $data05 != 0.000000000 then
return -1
endi
sql create table st_double_6 using mt_double tags (-123.321)
sql select tagname from st_double_6
if $data00 != -123.321000000 then
print expect -123.321000000, actual: $data00
sql show tags from st_double_6
if $data05 != -123.321000000 then
print expect -123.321000000, actual: $data05
return -1
endi
sql create table st_double_7 using mt_double tags (+1.567)
sql select tagname from st_double_7
if $data00 != 1.567000000 then
sql show tags from st_double_7
if $data05 != 1.567000000 then
return -1
endi
sql create table st_double_8 using mt_double tags (379.001)
sql select tagname from st_double_8
if $data00 != 379.001000000 then
sql show tags from st_double_8
if $data05 != 379.001000000 then
return -1
endi
sql create table st_double_9 using mt_double tags (1.5e+3)
sql select tagname from st_double_9
if $data00 != 1500.000000000 then
sql show tags from st_double_9
if $data05 != 1500.000000000 then
return -1
endi
sql create table st_double_10 using mt_double tags (-1.5e-3)
sql select tagname from st_double_10
if $data00 != -0.001500000 then
sql show tags from st_double_10
if $data05 != -0.001500000 then
return -1
endi
sql create table st_double_11 using mt_double tags (+1.5e+3)
sql select tagname from st_double_11
if $data00 != 1500.000000000 then
sql show tags from st_double_11
if $data05 != 1500.000000000 then
return -1
endi
sql create table st_double_12 using mt_double tags (-1.5e+3)
sql select tagname from st_double_12
if $data00 != -1500.000000000 then
sql show tags from st_double_12
if $data05 != -1500.000000000 then
return -1
endi
sql create table st_double_13 using mt_double tags (1.5e-3)
sql select tagname from st_double_13
if $data00 != 0.001500000 then
sql show tags from st_double_13
if $data05 != 0.001500000 then
return -1
endi
sql create table st_double_14 using mt_double tags (1.5E-3)
sql select tagname from st_double_14
if $data00 != 0.001500000 then
sql show tags from st_double_14
if $data05 != 0.001500000 then
return -1
endi
sql create table st_double_6_0 using mt_double tags ('-123.321')
sql select tagname from st_double_6_0
if $data00 != -123.321000000 then
sql show tags from st_double_6_0
if $data05 != -123.321000000 then
return -1
endi
sql create table st_double_7_0 using mt_double tags ('+1.567')
sql select tagname from st_double_7_0
if $data00 != 1.567000000 then
sql show tags from st_double_7_0
if $data05 != 1.567000000 then
return -1
endi
sql create table st_double_8_0 using mt_double tags ('379.001')
sql select tagname from st_double_8_0
if $data00 != 379.001000000 then
sql show tags from st_double_8_0
if $data05 != 379.001000000 then
return -1
endi
sql create table st_double_9_0 using mt_double tags ('1.5e+3')
sql select tagname from st_double_9_0
if $data00 != 1500.000000000 then
sql show tags from st_double_9_0
if $data05 != 1500.000000000 then
return -1
endi
sql create table st_double_10_0 using mt_double tags ('-1.5e-3')
sql select tagname from st_double_10_0
if $data00 != -0.001500000 then
sql show tags from st_double_10_0
if $data05 != -0.001500000 then
return -1
endi
sql create table st_double_11_0 using mt_double tags ('+1.5e+3')
sql select tagname from st_double_11_0
if $data00 != 1500.000000000 then
sql show tags from st_double_11_0
if $data05 != 1500.000000000 then
return -1
endi
sql create table st_double_12_0 using mt_double tags ('-1.5e+3')
sql select tagname from st_double_12_0
if $data00 != -1500.000000000 then
sql show tags from st_double_12_0
if $data05 != -1500.000000000 then
return -1
endi
sql create table st_double_13_0 using mt_double tags ('1.5e-3')
sql select tagname from st_double_13_0
if $data00 != 0.001500000 then
sql show tags from st_double_13_0
if $data05 != 0.001500000 then
return -1
endi
sql create table st_double_14_0 using mt_double tags ('1.5E-3')
sql select tagname from st_double_14_0
if $data00 != 0.001500000 then
sql show tags from st_double_14_0
if $data05 != 0.001500000 then
return -1
endi
sql create table st_double_15_0 using mt_double tags (1.7976931348623157e+308)
sql select tagname from st_double_15_0
#if $data00 != 0.001500000 then
sql show tags from st_double_15_0
#if $data05 != 0.001500000 then
# return -1
#endi
sql create table st_double_16_0 using mt_double tags (-1.7976931348623157e+308)
sql select tagname from st_double_16_0
#if $data00 != 0.001500000 then
sql show tags from st_double_16_0
#if $data05 != 0.001500000 then
# return -1
#endi
......@@ -270,8 +277,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_double_16 using mt_double tags (NULL ) values (now, NULL )
sql select tagname from st_double_16
if $data00 != NULL then
sql show tags from st_double_16
if $data05 != NULL then
return -1
endi
sql select * from st_double_16
......@@ -280,8 +287,8 @@ if $data01 != NULL then
endi
sql insert into st_double_17 using mt_double tags (NULL) values (now, NULL)
sql select tagname from st_double_17
if $data00 != NULL then
sql show tags from st_double_17
if $data05 != NULL then
return -1
endi
sql select * from st_double_17
......@@ -289,8 +296,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_double_18 using mt_double tags ('NULL') values (now, 'NULL')
sql select tagname from st_double_18
if $data00 != NULL then
sql show tags from st_double_18
if $data05 != NULL then
return -1
endi
sql select * from st_double_18
......@@ -298,8 +305,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_double_19 using mt_double tags ('NULL') values (now, 'NULL')
sql select tagname from st_double_19
if $data00 != NULL then
sql show tags from st_double_19
if $data05 != NULL then
return -1
endi
sql select * from st_double_19
......@@ -307,8 +314,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_double_20 using mt_double tags ("NULL") values (now, "NULL")
sql select tagname from st_double_20
if $data00 != NULL then
sql show tags from st_double_20
if $data05 != NULL then
return -1
endi
sql select * from st_double_20
......@@ -316,8 +323,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_double_21 using mt_double tags ("NULL") values (now, "NULL")
sql select tagname from st_double_21
if $data00 != NULL then
sql show tags from st_double_21
if $data05 != NULL then
return -1
endi
sql select * from st_double_21
......@@ -325,8 +332,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_double_22 using mt_double tags (127) values (now, 1.7976931348623157e+308)
sql select tagname from st_double_22
#if $data00 != 127 then
sql show tags from st_double_22
#if $data05 != 127 then
# return -1
#endi
sql select * from st_double_22
......@@ -334,8 +341,8 @@ sql select * from st_double_22
# return -1
#endi
sql insert into st_double_23 using mt_double tags (-127) values (now, -1.7976931348623157e+308)
sql select tagname from st_double_23
#if $data00 != -127 then
sql show tags from st_double_23
#if $data05 != -127 then
# return -1
#endi
sql select * from st_double_23
......@@ -343,8 +350,8 @@ sql select * from st_double_23
# return -1
#endi
sql insert into st_double_24 using mt_double tags (10) values (now, 10)
sql select tagname from st_double_24
#if $data00 != 10 then
sql show tags from st_double_24
#if $data05 != 10 then
# return -1
#endi
sql select * from st_double_24
......@@ -352,8 +359,8 @@ sql select * from st_double_24
# return -1
#endi
sql insert into st_double_25 using mt_double tags ("-0") values (now, "-0")
sql select tagname from st_double_25
#if $data00 != 0 then
sql show tags from st_double_25
#if $data05 != 0 then
# return -1
#endi
sql select * from st_double_25
......@@ -361,8 +368,8 @@ sql select * from st_double_25
# return -1
#endi
sql insert into st_double_26 using mt_double tags ('123') values (now, '12.3')
sql select tagname from st_double_26
#if $data00 != 123 then
sql show tags from st_double_26
#if $data05 != 123 then
# return -1
#endi
sql select * from st_double_26
......@@ -370,8 +377,8 @@ sql select * from st_double_26
# return -1
#endi
sql insert into st_double_27 using mt_double tags (+056) values (now, +0005.6)
sql select tagname from st_double_27
#if $data00 != 56 then
sql show tags from st_double_27
#if $data05 != 56 then
# return -1
#endi
sql select * from st_double_27
......@@ -379,8 +386,8 @@ sql select * from st_double_27
# return -1
#endi
sql insert into st_double_28 using mt_double tags (-056) values (now, -005.6)
sql select tagname from st_double_28
#if $data00 != -56 then
sql show tags from st_double_28
#if $data05 != -56 then
# return -1
#endi
sql select * from st_double_28
......@@ -390,43 +397,43 @@ sql select * from st_double_28
### case 03: alter tag values
#sql alter table st_double_0 set tag tagname=1.7976931348623157e+308
#sql select tagname from st_double_0
##if $data00 != 127 then
#sql show tags from st_double_0
##if $data05 != 127 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname=-1.7976931348623157e+308
#sql select tagname from st_double_0
##if $data00 != -127 then
#sql show tags from st_double_0
##if $data05 != -127 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname=+10.340
#sql select tagname from st_double_0
##if $data00 != 100 then
#sql show tags from st_double_0
##if $data05 != 100 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname=-33.87
#sql select tagname from st_double_0
##if $data00 != -33 then
#sql show tags from st_double_0
##if $data05 != -33 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname='+9.8'
#sql select tagname from st_double_0
##if $data00 != 98 then
#sql show tags from st_double_0
##if $data05 != 98 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname='-07.6'
#sql select tagname from st_double_0
##if $data00 != -76 then
#sql show tags from st_double_0
##if $data05 != -76 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname=+0012.871
#sql select tagname from st_double_0
##if $data00 != 12 then
#sql show tags from st_double_0
##if $data05 != 12 then
## return -1
##endi
#sql alter table st_double_0 set tag tagname=-00063.582
#sql select tagname from st_double_0
##if $data00 != -63 then
#sql show tags from st_double_0
##if $data05 != -63 then
## return -1
##endi
......@@ -438,11 +445,11 @@ sql_error create table st_double_e0 using mt_double tags (-31.7976931348623157e+
#sql_error create table st_double_e0 using mt_double tags (12.80) truncate integer part
#sql_error create table st_double_e0 using mt_double tags (-11.80)
sql_error create table st_double_e0 using mt_double tags (123abc)
sql_error create table st_double_e0 using mt_double tags ("123abc")
sql create table st_double_e0_1 using mt_double tags ("123abc")
sql_error create table st_double_e0 using mt_double tags (abc)
sql_error create table st_double_e0 using mt_double tags ("abc")
sql_error create table st_double_e0 using mt_double tags (" ")
sql_error create table st_double_e0 using mt_double tags ('')
sql create table st_double_e0_2 using mt_double tags ("abc")
sql create table st_double_e0_3 using mt_double tags (" ")
sql create table st_double_e0_4 using mt_double tags ('')
sql create table st_double_e0 using mt_double tags (123)
sql create table st_double_e1 using mt_double tags (123)
......@@ -469,7 +476,7 @@ sql_error insert into st_double_e7 values (now, "123abc")
sql_error insert into st_double_e9 values (now, abc)
sql_error insert into st_double_e10 values (now, "abc")
sql_error insert into st_double_e11 values (now, " ")
sql_error insert into st_double_e12 values (now, '')
sql insert into st_double_e12 values (now, '')
sql_error insert into st_double_e13 using mt_double tags (033) values (now, 11.7976931348623157e+308)
sql_error insert into st_double_e14 using mt_double tags (033) values (now, -11.7976931348623157e+308)
......@@ -482,7 +489,7 @@ sql_error insert into st_double_e20 using mt_double tags (033) values (now, "123
sql_error insert into st_double_e22 using mt_double tags (033) values (now, abc)
sql_error insert into st_double_e23 using mt_double tags (033) values (now, "abc")
sql_error insert into st_double_e24 using mt_double tags (033) values (now, " ")
sql_error insert into st_double_e25 using mt_double tags (033) values (now, '')
sql insert into st_double_e25_1 using mt_double tags (033) values (now, '')
sql_error insert into st_double_e13 using mt_double tags (31.7976931348623157e+308) values (now, -033)
sql_error insert into st_double_e14 using mt_double tags (-31.7976931348623157e+308) values (now, -033)
......@@ -495,7 +502,7 @@ sql_error insert into st_double_e20 using mt_double tags ("123abc") values (now,
sql_error insert into st_double_e22 using mt_double tags (abc) values (now, -033)
sql_error insert into st_double_e23 using mt_double tags ("abc") values (now, -033)
sql_error insert into st_double_e24 using mt_double tags (" ") values (now, -033)
sql_error insert into st_double_e25 using mt_double tags ('') values (now, -033)
sql insert into st_double_e25 using mt_double tags ('') values (now, -033)
sql insert into st_double_e13 using mt_double tags (033) values (now, 00062)
sql insert into st_double_e14 using mt_double tags (033) values (now, 00062)
......@@ -516,8 +523,8 @@ sql_error alter table st_double_e14 set tag tagname=-1.8976931348623157e+308
sql_error alter table st_double_e15 set tag tagname=131.7976931348623157e+308
sql_error alter table st_double_e16 set tag tagname=-131.7976931348623157e+308
sql_error alter table st_double_e19 set tag tagname=123abc
sql_error alter table st_double_e20 set tag tagname="123abc"
sql alter table st_double_e20 set tag tagname="123abc"
sql_error alter table st_double_e22 set tag tagname=abc
sql_error alter table st_double_e23 set tag tagname="abc"
sql_error alter table st_double_e24 set tag tagname=" "
sql_error alter table st_double_e25 set tag tagname=''
sql alter table st_double_e23 set tag tagname="abc"
sql alter table st_double_e24 set tag tagname=" "
sql alter table st_double_e25 set tag tagname=''
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database if not exists db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
......@@ -10,152 +17,152 @@ sql create table mt_float (ts timestamp, c float) tags (tagname float)
## case 00: static create table for test tag values
sql create table st_float_0 using mt_float tags (NULL)
sql select tagname from st_float_0
if $data00 != NULL then
sql show tags from st_float_0
if $data05 != NULL then
return -1
endi
sql create table st_float_1 using mt_float tags (NULL)
sql select tagname from st_float_1
if $data00 != NULL then
sql show tags from st_float_1
if $data05 != NULL then
return -1
endi
sql create table st_float_2 using mt_float tags ('NULL')
sql select tagname from st_float_2
if $data00 != NULL then
sql show tags from st_float_2
if $data05 != 0.00000 then
return -1
endi
sql create table st_float_3 using mt_float tags ('NULL')
sql select tagname from st_float_3
if $data00 != NULL then
sql show tags from st_float_3
if $data05 != 0.00000 then
return -1
endi
sql create table st_float_4 using mt_float tags ("NULL")
sql select tagname from st_float_4
if $data00 != NULL then
sql show tags from st_float_4
if $data05 != 0.00000 then
return -1
endi
sql create table st_float_5 using mt_float tags ("NULL")
sql select tagname from st_float_5
if $data00 != NULL then
sql show tags from st_float_5
if $data05 != 0.00000 then
return -1
endi
sql create table st_float_6 using mt_float tags (-123.321)
sql select tagname from st_float_6
if $data00 != -123.32100 then
print expect -123.32100, actual: $data00
sql show tags from st_float_6
if $data05 != -123.32100 then
print expect -123.32100, actual: $data05
return -1
endi
sql create table st_float_7 using mt_float tags (+1.567)
sql select tagname from st_float_7
if $data00 != 1.56700 then
print expect 1.56700, actual: $data00
sql show tags from st_float_7
if $data05 != 1.56700 then
print expect 1.56700, actual: $data05
return -1
endi
sql create table st_float_8 using mt_float tags (379.001)
sql select tagname from st_float_8
if $data00 != 379.00101 then
print expect 379.00101, actual: $data00
sql show tags from st_float_8
if $data05 != 379.00101 then
print expect 379.00101, actual: $data05
return -1
endi
sql create table st_float_9 using mt_float tags (1.5e+3)
sql select tagname from st_float_9
if $data00 != 1500.00000 then
print expect 1500.00000, actual: $data00
sql show tags from st_float_9
if $data05 != 1500.00000 then
print expect 1500.00000, actual: $data05
return -1
endi
sql create table st_float_10 using mt_float tags (-1.5e-3)
sql select tagname from st_float_10
if $data00 != -0.00150 then
print expect -0.00150, actual: $data00
sql show tags from st_float_10
if $data05 != -0.00150 then
print expect -0.00150, actual: $data05
return -1
endi
sql create table st_float_11 using mt_float tags (+1.5e+3)
sql select tagname from st_float_11
if $data00 != 1500.00000 then
print expect 1500.00000, actual: $data00
sql show tags from st_float_11
if $data05 != 1500.00000 then
print expect 1500.00000, actual: $data05
return -1
endi
sql create table st_float_12 using mt_float tags (-1.5e+3)
sql select tagname from st_float_12
if $data00 != -1500.00000 then
print expect -1500.00000, actual: $data00
sql show tags from st_float_12
if $data05 != -1500.00000 then
print expect -1500.00000, actual: $data05
return -1
endi
sql create table st_float_13 using mt_float tags (1.5e-3)
sql select tagname from st_float_13
if $data00 != 0.00150 then
print expect 0.00150, actual: $data00
sql show tags from st_float_13
if $data05 != 0.00150 then
print expect 0.00150, actual: $data05
return -1
endi
sql create table st_float_14 using mt_float tags (1.5E-3)
sql select tagname from st_float_14
if $data00 != 0.00150 then
print expect 0.00150, actual: $data00
sql show tags from st_float_14
if $data05 != 0.00150 then
print expect 0.00150, actual: $data05
return -1
endi
sql create table st_float_6_0 using mt_float tags ('-123.321')
sql select tagname from st_float_6_0
if $data00 != -123.32100 then
print expect -123.32100, actual: $data00
sql show tags from st_float_6_0
if $data05 != -123.32100 then
print expect -123.32100, actual: $data05
return -1
endi
sql create table st_float_7_0 using mt_float tags ('+1.567')
sql select tagname from st_float_7_0
if $data00 != 1.56700 then
print expect 1.56700, actual: $data00
sql show tags from st_float_7_0
if $data05 != 1.56700 then
print expect 1.56700, actual: $data05
return -1
endi
sql create table st_float_8_0 using mt_float tags ('379.001')
sql select tagname from st_float_8_0
if $data00 != 379.00101 then
print expect 379.00101, actual: $data00
sql show tags from st_float_8_0
if $data05 != 379.00101 then
print expect 379.00101, actual: $data05
return -1
endi
sql create table st_float_9_0 using mt_float tags ('1.5e+3')
sql select tagname from st_float_9_0
if $data00 != 1500.00000 then
print expect 1500.00000, actual: $data00
sql show tags from st_float_9_0
if $data05 != 1500.00000 then
print expect 1500.00000, actual: $data05
return -1
endi
sql create table st_float_10_0 using mt_float tags ('-1.5e-3')
sql select tagname from st_float_10_0
if $data00 != -0.00150 then
print expect -0.00150, actual: $data00
sql show tags from st_float_10_0
if $data05 != -0.00150 then
print expect -0.00150, actual: $data05
return -1
endi
sql create table st_float_11_0 using mt_float tags ('+1.5e+3')
sql select tagname from st_float_11_0
if $data00 != 1500.00000 then
print expect 1500.00000, actual: $data00
sql show tags from st_float_11_0
if $data05 != 1500.00000 then
print expect 1500.00000, actual: $data05
return -1
endi
sql create table st_float_12_0 using mt_float tags ('-1.5e+3')
sql select tagname from st_float_12_0
if $data00 != -1500.00000 then
print expect -1500.00000, actual: $data00
sql show tags from st_float_12_0
if $data05 != -1500.00000 then
print expect -1500.00000, actual: $data05
return -1
endi
sql create table st_float_13_0 using mt_float tags ('1.5e-3')
sql select tagname from st_float_13_0
if $data00 != 0.00150 then
print expect 0.00150, actual: $data00
sql show tags from st_float_13_0
if $data05 != 0.00150 then
print expect 0.00150, actual: $data05
return -1
endi
sql create table st_float_14_0 using mt_float tags ('1.5E-3')
sql select tagname from st_float_14_0
if $data00 != 0.00150 then
print expect 0.00150, actual: $data00
sql show tags from st_float_14_0
if $data05 != 0.00150 then
print expect 0.00150, actual: $data05
return -1
endi
#sql create table st_float_15_0 using mt_float tags (3.40282347e+38)
#sql select tagname from st_float_15_0
#if $data00 != 0.001500 then
#sql show tags from st_float_15_0
#if $data05 != 0.001500 then
# return -1
#endi
#sql create table st_float_16_0 using mt_float tags (-3.40282347e+38)
#sql select tagname from st_float_16_0
#if $data00 != 0.001500 then
#sql show tags from st_float_16_0
#if $data05 != 0.001500 then
# return -1
#endi
......@@ -292,8 +299,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_float_16 using mt_float tags (NULL) values (now, NULL)
sql select tagname from st_float_16
if $data00 != NULL then
sql show tags from st_float_16
if $data05 != NULL then
return -1
endi
sql select * from st_float_16
......@@ -302,8 +309,8 @@ if $data01 != NULL then
endi
sql insert into st_float_17 using mt_float tags (NULL) values (now, NULL)
sql select tagname from st_float_17
if $data00 != NULL then
sql show tags from st_float_17
if $data05 != NULL then
return -1
endi
sql select * from st_float_17
......@@ -311,8 +318,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_float_18 using mt_float tags ('NULL') values (now, 'NULL')
sql select tagname from st_float_18
if $data00 != NULL then
sql show tags from st_float_18
if $data05 != NULL then
return -1
endi
sql select * from st_float_18
......@@ -320,8 +327,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_float_19 using mt_float tags ('NULL') values (now, 'NULL')
sql select tagname from st_float_19
if $data00 != NULL then
sql show tags from st_float_19
if $data05 != NULL then
return -1
endi
sql select * from st_float_19
......@@ -329,8 +336,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_float_20 using mt_float tags ("NULL") values (now, "NULL")
sql select tagname from st_float_20
if $data00 != NULL then
sql show tags from st_float_20
if $data05 != NULL then
return -1
endi
sql select * from st_float_20
......@@ -338,8 +345,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_float_21 using mt_float tags ("NULL") values (now, "NULL")
sql select tagname from st_float_21
if $data00 != NULL then
sql show tags from st_float_21
if $data05 != NULL then
return -1
endi
sql select * from st_float_21
......@@ -350,9 +357,9 @@ endi
sql_error insert into st_float_22 using mt_float tags (127) values (now, 3.40282347e+38)
sql insert into st_float_22 using mt_float tags (127) values (now, 340282346638528859811704183484516925440.00000)
sql select tagname from st_float_22
if $data00 != 127.00000 then
print expect 127.00000, actual: $data00
sql show tags from st_float_22
if $data05 != 127.00000 then
print expect 127.00000, actual: $data05
return -1
endi
......@@ -362,14 +369,14 @@ if $data01 != 127.00000 then
endi
sql insert into st_float_23 using mt_float tags (-127) values (now, -340282346638528859811704183484516925440.00000)
sql select tagname from st_float_23
if $data00 != -127.00000 then
sql show tags from st_float_23
if $data05 != -127.00000 then
return -1
endi
sql insert into st_float_24 using mt_float tags (10) values (now, 10)
sql select tagname from st_float_24
if $data00 != 10.00000 then
sql show tags from st_float_24
if $data05 != 10.00000 then
return -1
endi
sql select * from st_float_24
......@@ -378,9 +385,9 @@ if $data01 != 10.00000 then
endi
sql insert into st_float_25 using mt_float tags ("-0") values (now, "-0")
sql select tagname from st_float_25
if $data00 != -0.00000 then
print expect -0.00000, actual: $data00
sql show tags from st_float_25
if $data05 != -0.00000 then
print expect -0.00000, actual: $data05
return -1
endi
sql select * from st_float_25
......@@ -388,9 +395,9 @@ if $data01 != -0.00000 then
return -1
endi
sql insert into st_float_26 using mt_float tags ('123') values (now, '12.3')
sql select tagname from st_float_26
if $data00 != 123.00000 then
print expect 123.00000, actual: $data00
sql show tags from st_float_26
if $data05 != 123.00000 then
print expect 123.00000, actual: $data05
return -1
endi
sql select * from st_float_26
......@@ -398,9 +405,9 @@ if $data01 != 12.30000 then
return -1
endi
sql insert into st_float_27 using mt_float tags (+056) values (now, +0005.6)
sql select tagname from st_float_27
if $data00 != 56.00000 then
print expect 56.00000, actual:$data00
sql show tags from st_float_27
if $data05 != 56.00000 then
print expect 56.00000, actual:$data05
return -1
endi
sql select * from st_float_27
......@@ -408,8 +415,8 @@ if $data01 != 5.60000 then
return -1
endi
sql insert into st_float_28 using mt_float tags (-056) values (now, -005.6)
sql select tagname from st_float_28
if $data00 != -56.00000 then
sql show tags from st_float_28
if $data05 != -56.00000 then
return -1
endi
sql select * from st_float_28
......@@ -419,44 +426,44 @@ endi
### case 03: alter tag values
sql alter table st_float_0 set tag tagname=340282346638528859811704183484516925440.00000
sql select tagname from st_float_0
if $data00 != 340282346638528859811704183484516925440.00000 then
sql show tags from st_float_0
if $data05 != 340282346638528859811704183484516925440.00000 then
return -1
endi
sql alter table st_float_0 set tag tagname=-340282346638528859811704183484516925440.00000
sql select tagname from st_float_0
if $data00 != -340282346638528859811704183484516925440.00000 then
sql show tags from st_float_0
if $data05 != -340282346638528859811704183484516925440.00000 then
return -1
endi
sql alter table st_float_0 set tag tagname=+10.340
sql select tagname from st_float_0
if $data00 != 10.34000 then
sql show tags from st_float_0
if $data05 != 10.34000 then
return -1
endi
sql alter table st_float_0 set tag tagname=-33.87
sql select tagname from st_float_0
if $data00 != -33.87000 then
sql show tags from st_float_0
if $data05 != -33.87000 then
return -1
endi
sql alter table st_float_0 set tag tagname='+9.8'
sql select tagname from st_float_0
if $data00 != 9.80000 then
sql show tags from st_float_0
if $data05 != 9.80000 then
return -1
endi
sql alter table st_float_0 set tag tagname='-07.6'
sql select tagname from st_float_0
if $data00 != -7.60000 then
sql show tags from st_float_0
if $data05 != -7.60000 then
return -1
endi
sql alter table st_float_0 set tag tagname=+0012.871
sql select tagname from st_float_0
if $data00 != 12.87100 then
sql show tags from st_float_0
if $data05 != 12.87100 then
return -1
endi
sql alter table st_float_0 set tag tagname=-00063.582
sql select tagname from st_float_0
if $data00 != -63.58200 then
sql show tags from st_float_0
if $data05 != -63.58200 then
return -1
endi
......@@ -468,11 +475,11 @@ sql_error create table st_float_e0 using mt_float tags (-333.40282347e+38)
#sql_error create table st_float_e0 using mt_float tags (12.80) truncate integer part
#sql_error create table st_float_e0 using mt_float tags (-11.80)
sql_error create table st_float_e0 using mt_float tags (123abc)
sql_error create table st_float_e0 using mt_float tags ("123abc")
sql create table st_float_e0_1 using mt_float tags ("123abc")
sql_error create table st_float_e0 using mt_float tags (abc)
sql_error create table st_float_e0 using mt_float tags ("abc")
sql_error create table st_float_e0 using mt_float tags (" ")
sql_error create table st_float_e0 using mt_float tags ('')
sql create table st_float_e0_2 using mt_float tags ("abc")
sql create table st_float_e0_3 using mt_float tags (" ")
sql create table st_float_e0_4 using mt_float tags ('')
sql create table st_float_e0 using mt_float tags (123)
sql create table st_float_e1 using mt_float tags (123)
......@@ -499,7 +506,7 @@ sql_error insert into st_float_e7 values (now, "123abc")
sql_error insert into st_float_e9 values (now, abc)
sql_error insert into st_float_e10 values (now, "abc")
sql_error insert into st_float_e11 values (now, " ")
sql_error insert into st_float_e12 values (now, '')
sql insert into st_float_e12 values (now, '')
sql_error insert into st_float_e13 using mt_float tags (033) values (now, 3.50282347e+38)
sql_error insert into st_float_e14 using mt_float tags (033) values (now, -3.50282347e+38)
......@@ -512,7 +519,7 @@ sql_error insert into st_float_e20 using mt_float tags (033) values (now, "123ab
sql_error insert into st_float_e22 using mt_float tags (033) values (now, abc)
sql_error insert into st_float_e23 using mt_float tags (033) values (now, "abc")
sql_error insert into st_float_e24 using mt_float tags (033) values (now, " ")
sql_error insert into st_float_e25 using mt_float tags (033) values (now, '')
sql insert into st_float_e25_1 using mt_float tags (033) values (now, '')
sql_error insert into st_float_e13 using mt_float tags (3.50282347e+38) values (now, -033)
sql_error insert into st_float_e14 using mt_float tags (-3.50282347e+38) values (now, -033)
......@@ -525,7 +532,7 @@ sql_error insert into st_float_e20 using mt_float tags ("123abc") values (now, -
sql_error insert into st_float_e22 using mt_float tags (abc) values (now, -033)
sql_error insert into st_float_e23 using mt_float tags ("abc") values (now, -033)
sql_error insert into st_float_e24 using mt_float tags (" ") values (now, -033)
sql_error insert into st_float_e25 using mt_float tags ('') values (now, -033)
sql insert into st_float_e25_3 using mt_float tags ('') values (now, -033)
sql insert into st_float_e13 using mt_float tags (033) values (now, 00062)
sql insert into st_float_e14 using mt_float tags (033) values (now, 00062)
......@@ -546,8 +553,8 @@ sql_error alter table st_float_e14 set tag tagname=-3.50282347e+38
sql_error alter table st_float_e15 set tag tagname=13.40282347e+38
sql_error alter table st_float_e16 set tag tagname=-13.40282347e+38
sql_error alter table st_float_e19 set tag tagname=123abc
sql_error alter table st_float_e20 set tag tagname="123abc"
sql alter table st_float_e20 set tag tagname="123abc"
sql_error alter table st_float_e22 set tag tagname=abc
sql_error alter table st_float_e23 set tag tagname="abc"
sql_error alter table st_float_e24 set tag tagname=" "
sql_error alter table st_float_e25 set tag tagname=''
sql alter table st_float_e23 set tag tagname="abc"
sql alter table st_float_e24 set tag tagname=" "
sql alter table st_float_e25 set tag tagname=''
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
sql create database if not exists db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
......@@ -10,78 +17,64 @@ sql create table mt_int (ts timestamp, c int) tags (tagname int)
## case 00: static create table for test tag values
sql create table st_int_0 using mt_int tags (NULL)
sql select tagname from st_int_0
if $data00 != NULL then
sql show tags from st_int_0
if $data05 != NULL then
return -1
endi
sql create table st_int_1 using mt_int tags (NULL)
sql select tagname from st_int_1
if $data00 != NULL then
return -1
endi
sql create table st_int_2 using mt_int tags ('NULL')
sql select tagname from st_int_2
if $data00 != NULL then
return -1
endi
sql create table st_int_3 using mt_int tags ('NULL')
sql select tagname from st_int_3
if $data00 != NULL then
return -1
endi
sql create table st_int_4 using mt_int tags ("NULL")
sql select tagname from st_int_4
if $data00 != NULL then
return -1
endi
sql create table st_int_5 using mt_int tags ("NULL")
sql select tagname from st_int_5
if $data00 != NULL then
sql show tags from st_int_1
if $data05 != NULL then
return -1
endi
sql_error create table st_int_2 using mt_int tags ('NULL')
sql_error create table st_int_3 using mt_int tags ('NULL')
sql_error create table st_int_4 using mt_int tags ("NULL")
sql_error create table st_int_5 using mt_int tags ("NULL")
sql create table st_int_6 using mt_int tags (-2147483647)
sql select tagname from st_int_6
if $data00 != -2147483647 then
sql show tags from st_int_6
if $data05 != -2147483647 then
return -1
endi
sql create table st_int_7 using mt_int tags (2147483647)
sql select tagname from st_int_7
if $data00 != 2147483647 then
sql show tags from st_int_7
if $data05 != 2147483647 then
return -1
endi
sql create table st_int_8 using mt_int tags (37)
sql select tagname from st_int_8
if $data00 != 37 then
sql show tags from st_int_8
if $data05 != 37 then
return -1
endi
sql create table st_int_9 using mt_int tags (-100)
sql select tagname from st_int_9
if $data00 != -100 then
sql show tags from st_int_9
if $data05 != -100 then
return -1
endi
sql create table st_int_10 using mt_int tags (+113)
sql select tagname from st_int_10
if $data00 != 113 then
sql show tags from st_int_10
if $data05 != 113 then
return -1
endi
sql create table st_int_11 using mt_int tags ('-100')
sql select tagname from st_int_11
if $data00 != -100 then
sql show tags from st_int_11
if $data05 != -100 then
return -1
endi
sql create table st_int_12 using mt_int tags ("+78")
sql select tagname from st_int_12
if $data00 != 78 then
sql show tags from st_int_12
if $data05 != 78 then
return -1
endi
sql create table st_int_13 using mt_int tags (+0078)
sql select tagname from st_int_13
if $data00 != 78 then
sql show tags from st_int_13
if $data05 != 78 then
return -1
endi
sql create table st_int_14 using mt_int tags (-00078)
sql select tagname from st_int_14
if $data00 != -78 then
sql show tags from st_int_14
if $data05 != -78 then
return -1
endi
......@@ -102,38 +95,6 @@ endi
if $data01 != NULL then
return -1
endi
sql insert into st_int_2 values (now, 'NULL')
sql select * from st_int_2
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_int_3 values (now, 'NULL')
sql select * from st_int_3
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_int_4 values (now, "NULL")
sql select * from st_int_4
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_int_5 values (now, "NULL")
sql select * from st_int_5
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_int_6 values (now, 2147483647)
sql select * from st_int_6
if $rows != 1 then
......@@ -211,8 +172,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_int_16 using mt_int tags (NULL) values (now, NULL)
sql select tagname from st_int_16
if $data00 != NULL then
sql show tags from st_int_16
if $data05 != NULL then
return -1
endi
sql select * from st_int_16
......@@ -221,8 +182,8 @@ if $data01 != NULL then
endi
sql insert into st_int_17 using mt_int tags (NULL) values (now, NULL)
sql select tagname from st_int_17
if $data00 != NULL then
sql show tags from st_int_17
if $data05 != NULL then
return -1
endi
sql select * from st_int_17
......@@ -230,8 +191,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_int_18 using mt_int tags ('NULL') values (now, 'NULL')
sql select tagname from st_int_18
if $data00 != NULL then
sql show tags from st_int_18
if $data05 != NULL then
return -1
endi
sql select * from st_int_18
......@@ -239,8 +200,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_int_19 using mt_int tags ('NULL') values (now, 'NULL')
sql select tagname from st_int_19
if $data00 != NULL then
sql show tags from st_int_19
if $data05 != NULL then
return -1
endi
sql select * from st_int_19
......@@ -248,8 +209,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_int_20 using mt_int tags ("NULL") values (now, "NULL")
sql select tagname from st_int_20
if $data00 != NULL then
sql show tags from st_int_20
if $data05 != NULL then
return -1
endi
sql select * from st_int_20
......@@ -257,8 +218,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_int_21 using mt_int tags ("NULL") values (now, "NULL")
sql select tagname from st_int_21
if $data00 != NULL then
sql show tags from st_int_21
if $data05 != NULL then
return -1
endi
sql select * from st_int_21
......@@ -266,8 +227,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_int_22 using mt_int tags (2147483647) values (now, 2147483647)
sql select tagname from st_int_22
if $data00 != 2147483647 then
sql show tags from st_int_22
if $data05 != 2147483647 then
return -1
endi
sql select * from st_int_22
......@@ -275,8 +236,8 @@ if $data01 != 2147483647 then
return -1
endi
sql insert into st_int_23 using mt_int tags (-2147483647) values (now, -2147483647)
sql select tagname from st_int_23
if $data00 != -2147483647 then
sql show tags from st_int_23
if $data05 != -2147483647 then
return -1
endi
sql select * from st_int_23
......@@ -284,8 +245,8 @@ if $data01 != -2147483647 then
return -1
endi
sql insert into st_int_24 using mt_int tags (10) values (now, 10)
sql select tagname from st_int_24
if $data00 != 10 then
sql show tags from st_int_24
if $data05 != 10 then
return -1
endi
sql select * from st_int_24
......@@ -293,8 +254,8 @@ if $data01 != 10 then
return -1
endi
sql insert into st_int_25 using mt_int tags ("-0") values (now, "-0")
sql select tagname from st_int_25
if $data00 != 0 then
sql show tags from st_int_25
if $data05 != 0 then
return -1
endi
sql select * from st_int_25
......@@ -302,8 +263,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_int_26 using mt_int tags ('123') values (now, '123')
sql select tagname from st_int_26
if $data00 != 123 then
sql show tags from st_int_26
if $data05 != 123 then
return -1
endi
sql select * from st_int_26
......@@ -311,8 +272,8 @@ if $data01 != 123 then
return -1
endi
sql insert into st_int_27 using mt_int tags (+056) values (now, +00056)
sql select tagname from st_int_27
if $data00 != 56 then
sql show tags from st_int_27
if $data05 != 56 then
return -1
endi
sql select * from st_int_27
......@@ -320,8 +281,8 @@ if $data01 != 56 then
return -1
endi
sql insert into st_int_28 using mt_int tags (-056) values (now, -0056)
sql select tagname from st_int_28
if $data00 != -56 then
sql show tags from st_int_28
if $data05 != -56 then
return -1
endi
sql select * from st_int_28
......@@ -331,49 +292,49 @@ endi
### case 03: alter tag values
#sql alter table st_int_0 set tag tagname=2147483647
#sql select tagname from st_int_0
#if $data00 != 2147483647 then
#sql show tags from st_int_0
#if $data05 != 2147483647 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname=-2147483647
#sql select tagname from st_int_0
#if $data00 != -2147483647 then
#sql show tags from st_int_0
#if $data05 != -2147483647 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname=+100
#sql select tagname from st_int_0
#if $data00 != 100 then
#sql show tags from st_int_0
#if $data05 != 100 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname=-33
#sql select tagname from st_int_0
#if $data00 != -33 then
#sql show tags from st_int_0
#if $data05 != -33 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname='+98'
#sql select tagname from st_int_0
#if $data00 != 98 then
#sql show tags from st_int_0
#if $data05 != 98 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname='-076'
#sql select tagname from st_int_0
#if $data00 != -76 then
#sql show tags from st_int_0
#if $data05 != -76 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname=+0012
#sql select tagname from st_int_0
#if $data00 != 12 then
#sql show tags from st_int_0
#if $data05 != 12 then
# return -1
#endi
#sql alter table st_int_0 set tag tagname=-00063
#sql select tagname from st_int_0
#if $data00 != -63 then
#sql show tags from st_int_0
#if $data05 != -63 then
# return -1
#endi
## case 04: illegal input
sql_error create table st_int_e0 using mt_int tags (2147483648)
sql_error create table st_int_e0 using mt_int tags (-2147483648)
sql create table st_int_e0_err1 using mt_int tags (-2147483648)
sql_error create table st_int_e0 using mt_int tags (214748364800)
sql_error create table st_int_e0 using mt_int tags (-214748364800)
#sql_error create table st_int_e0 using mt_int tags (12.80) truncate integer part
......@@ -383,7 +344,7 @@ sql_error create table st_int_e0 using mt_int tags ("123abc")
sql_error create table st_int_e0 using mt_int tags (abc)
sql_error create table st_int_e0 using mt_int tags ("abc")
sql_error create table st_int_e0 using mt_int tags (" ")
sql_error create table st_int_e0 using mt_int tags ('')
sql create table st_int_e0_err2 using mt_int tags ('')
sql create table st_int_e0 using mt_int tags (123)
sql create table st_int_e1 using mt_int tags (123)
......@@ -400,7 +361,7 @@ sql create table st_int_e11 using mt_int tags (123)
sql create table st_int_e12 using mt_int tags (123)
sql_error insert into st_int_e0 values (now, 2147483648)
sql_error insert into st_int_e1 values (now, -2147483648)
sql insert into st_int_e1 values (now, -2147483648)
sql_error insert into st_int_e2 values (now, 3147483648)
sql_error insert into st_int_e3 values (now, -21474836481)
#sql_error insert into st_int_e4 values (now, 12.80)
......@@ -410,10 +371,10 @@ sql_error insert into st_int_e7 values (now, "123abc")
sql_error insert into st_int_e9 values (now, abc)
sql_error insert into st_int_e10 values (now, "abc")
sql_error insert into st_int_e11 values (now, " ")
sql_error insert into st_int_e12 values (now, '')
sql insert into st_int_e12 values (now, '')
sql_error insert into st_int_e13 using mt_int tags (033) values (now, 2147483648)
sql_error insert into st_int_e14 using mt_int tags (033) values (now, -2147483648)
sql insert into st_int_e14 using mt_int tags (033) values (now, -2147483648)
sql_error insert into st_int_e15 using mt_int tags (033) values (now, 5147483648)
sql_error insert into st_int_e16 using mt_int tags (033) values (now, -21474836481)
#sql_error insert into st_int_e17 using mt_int tags (033) values (now, 12.80)
......@@ -423,10 +384,10 @@ sql_error insert into st_int_e20 using mt_int tags (033) values (now, "123abc")
sql_error insert into st_int_e22 using mt_int tags (033) values (now, abc)
sql_error insert into st_int_e23 using mt_int tags (033) values (now, "abc")
sql_error insert into st_int_e24 using mt_int tags (033) values (now, " ")
sql_error insert into st_int_e25 using mt_int tags (033) values (now, '')
sql insert into st_int_e25 using mt_int tags (033) values (now, '')
sql_error insert into st_int_e13 using mt_int tags (2147483648) values (now, -033)
sql_error insert into st_int_e14 using mt_int tags (-2147483648) values (now, -033)
sql insert into st_int_e14_1 using mt_int tags (-2147483648) values (now, -033)
sql_error insert into st_int_e15 using mt_int tags (21474836480) values (now, -033)
sql_error insert into st_int_e16 using mt_int tags (-2147483649) values (now, -033)
#sql_error insert into st_int_e17 using mt_int tags (12.80) values (now, -033)
......@@ -436,7 +397,7 @@ sql_error insert into st_int_e20 using mt_int tags ("123abc") values (now, -033)
sql_error insert into st_int_e22 using mt_int tags (abc) values (now, -033)
sql_error insert into st_int_e23 using mt_int tags ("abc") values (now, -033)
sql_error insert into st_int_e24 using mt_int tags (" ") values (now, -033)
sql_error insert into st_int_e25 using mt_int tags ('') values (now, -033)
sql insert into st_int_e25_1 using mt_int tags ('') values (now, -033)
sql insert into st_int_e13 using mt_int tags (033) values (now, 00062)
sql insert into st_int_e14 using mt_int tags (033) values (now, 00062)
......@@ -453,7 +414,7 @@ sql insert into st_int_e24 using mt_int tags (033) values (now, 00062)
sql insert into st_int_e25 using mt_int tags (033) values (now, 00062)
sql_error alter table st_int_e13 set tag tagname=2147483648
sql_error alter table st_int_e14 set tag tagname=-2147483648
sql alter table st_int_e14 set tag tagname=-2147483648
sql_error alter table st_int_e15 set tag tagname=12147483648
sql_error alter table st_int_e16 set tag tagname=-3147483648
sql_error alter table st_int_e19 set tag tagname=123abc
......@@ -461,4 +422,4 @@ sql_error alter table st_int_e20 set tag tagname="123abc"
sql_error alter table st_int_e22 set tag tagname=abc
sql_error alter table st_int_e23 set tag tagname="abc"
sql_error alter table st_int_e24 set tag tagname=" "
sql_error alter table st_int_e25 set tag tagname=''
sql alter table st_int_e25 set tag tagname=''
sql create database if not exists db
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
print ========== columnValues.sim
sql drop database if exists db
sql create database db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
######## case 0: smallint
......@@ -9,78 +20,64 @@ sql create table mt_smallint (ts timestamp, c smallint) tags (tagname smallint)
## case 00: static create table for test tag values
sql create table st_smallint_0 using mt_smallint tags (NULL)
sql select tagname from st_smallint_0
if $data00 != NULL then
sql show tags from st_smallint_0
if $data05 != NULL then
return -1
endi
sql create table st_smallint_1 using mt_smallint tags (NULL)
sql select tagname from st_smallint_1
if $data00 != NULL then
return -1
endi
sql create table st_smallint_2 using mt_smallint tags ('NULL')
sql select tagname from st_smallint_2
if $data00 != NULL then
return -1
endi
sql create table st_smallint_3 using mt_smallint tags ('NULL')
sql select tagname from st_smallint_3
if $data00 != NULL then
return -1
endi
sql create table st_smallint_4 using mt_smallint tags ("NULL")
sql select tagname from st_smallint_4
if $data00 != NULL then
return -1
endi
sql create table st_smallint_5 using mt_smallint tags ("NULL")
sql select tagname from st_smallint_5
if $data00 != NULL then
sql show tags from st_smallint_1
if $data05 != NULL then
return -1
endi
sql_error create table st_smallint_2 using mt_smallint tags ('NULL')
sql_error create table st_smallint_3 using mt_smallint tags ('NULL')
sql_error create table st_smallint_4 using mt_smallint tags ("NULL")
sql_error create table st_smallint_5 using mt_smallint tags ("NULL")
sql create table st_smallint_6 using mt_smallint tags (-32767)
sql select tagname from st_smallint_6
if $data00 != -32767 then
sql show tags from st_smallint_6
if $data05 != -32767 then
return -1
endi
sql create table st_smallint_7 using mt_smallint tags (32767)
sql select tagname from st_smallint_7
if $data00 != 32767 then
sql show tags from st_smallint_7
if $data05 != 32767 then
return -1
endi
sql create table st_smallint_8 using mt_smallint tags (37)
sql select tagname from st_smallint_8
if $data00 != 37 then
sql show tags from st_smallint_8
if $data05 != 37 then
return -1
endi
sql create table st_smallint_9 using mt_smallint tags (-100)
sql select tagname from st_smallint_9
if $data00 != -100 then
sql show tags from st_smallint_9
if $data05 != -100 then
return -1
endi
sql create table st_smallint_10 using mt_smallint tags (+113)
sql select tagname from st_smallint_10
if $data00 != 113 then
sql show tags from st_smallint_10
if $data05 != 113 then
return -1
endi
sql create table st_smallint_11 using mt_smallint tags ('-100')
sql select tagname from st_smallint_11
if $data00 != -100 then
sql show tags from st_smallint_11
if $data05 != -100 then
return -1
endi
sql create table st_smallint_12 using mt_smallint tags ("+78")
sql select tagname from st_smallint_12
if $data00 != 78 then
sql show tags from st_smallint_12
if $data05 != 78 then
return -1
endi
sql create table st_smallint_13 using mt_smallint tags (+0078)
sql select tagname from st_smallint_13
if $data00 != 78 then
sql show tags from st_smallint_13
if $data05 != 78 then
return -1
endi
sql create table st_smallint_14 using mt_smallint tags (-00078)
sql select tagname from st_smallint_14
if $data00 != -78 then
sql show tags from st_smallint_14
if $data05 != -78 then
return -1
endi
......@@ -101,38 +98,6 @@ endi
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_2 values (now, 'NULL')
sql select * from st_smallint_2
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_3 values (now, 'NULL')
sql select * from st_smallint_3
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_4 values (now, "NULL")
sql select * from st_smallint_4
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_5 values (now, "NULL")
sql select * from st_smallint_5
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_6 values (now, 32767)
sql select * from st_smallint_6
if $rows != 1 then
......@@ -210,8 +175,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_smallint_16 using mt_smallint tags (NULL) values (now, NULL)
sql select tagname from st_smallint_16
if $data00 != NULL then
sql show tags from st_smallint_16
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_16
......@@ -220,8 +185,8 @@ if $data01 != NULL then
endi
sql insert into st_smallint_17 using mt_smallint tags (NULL) values (now, NULL)
sql select tagname from st_smallint_17
if $data00 != NULL then
sql show tags from st_smallint_17
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_17
......@@ -229,8 +194,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_smallint_18 using mt_smallint tags ('NULL') values (now, 'NULL')
sql select tagname from st_smallint_18
if $data00 != NULL then
sql show tags from st_smallint_18
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_18
......@@ -238,8 +203,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_smallint_19 using mt_smallint tags ('NULL') values (now, 'NULL')
sql select tagname from st_smallint_19
if $data00 != NULL then
sql show tags from st_smallint_19
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_19
......@@ -247,8 +212,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_smallint_20 using mt_smallint tags ("NULL") values (now, "NULL")
sql select tagname from st_smallint_20
if $data00 != NULL then
sql show tags from st_smallint_20
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_20
......@@ -256,8 +221,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_smallint_21 using mt_smallint tags ("NULL") values (now, "NULL")
sql select tagname from st_smallint_21
if $data00 != NULL then
sql show tags from st_smallint_21
if $data05 != NULL then
return -1
endi
sql select * from st_smallint_21
......@@ -265,8 +230,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_smallint_22 using mt_smallint tags (32767) values (now, 32767)
sql select tagname from st_smallint_22
if $data00 != 32767 then
sql show tags from st_smallint_22
if $data05 != 32767 then
return -1
endi
sql select * from st_smallint_22
......@@ -274,8 +239,8 @@ if $data01 != 32767 then
return -1
endi
sql insert into st_smallint_23 using mt_smallint tags (-32767) values (now, -32767)
sql select tagname from st_smallint_23
if $data00 != -32767 then
sql show tags from st_smallint_23
if $data05 != -32767 then
return -1
endi
sql select * from st_smallint_23
......@@ -283,8 +248,8 @@ if $data01 != -32767 then
return -1
endi
sql insert into st_smallint_24 using mt_smallint tags (10) values (now, 10)
sql select tagname from st_smallint_24
if $data00 != 10 then
sql show tags from st_smallint_24
if $data05 != 10 then
return -1
endi
sql select * from st_smallint_24
......@@ -292,8 +257,8 @@ if $data01 != 10 then
return -1
endi
sql insert into st_smallint_25 using mt_smallint tags ("-0") values (now, "-0")
sql select tagname from st_smallint_25
if $data00 != 0 then
sql show tags from st_smallint_25
if $data05 != 0 then
return -1
endi
sql select * from st_smallint_25
......@@ -301,8 +266,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_smallint_26 using mt_smallint tags ('123') values (now, '123')
sql select tagname from st_smallint_26
if $data00 != 123 then
sql show tags from st_smallint_26
if $data05 != 123 then
return -1
endi
sql select * from st_smallint_26
......@@ -310,8 +275,8 @@ if $data01 != 123 then
return -1
endi
sql insert into st_smallint_27 using mt_smallint tags (+056) values (now, +00056)
sql select tagname from st_smallint_27
if $data00 != 56 then
sql show tags from st_smallint_27
if $data05 != 56 then
return -1
endi
sql select * from st_smallint_27
......@@ -319,8 +284,8 @@ if $data01 != 56 then
return -1
endi
sql insert into st_smallint_28 using mt_smallint tags (-056) values (now, -0056)
sql select tagname from st_smallint_28
if $data00 != -56 then
sql show tags from st_smallint_28
if $data05 != -56 then
return -1
endi
sql select * from st_smallint_28
......@@ -330,49 +295,49 @@ endi
## case 03: alter tag values
#sql alter table st_smallint_0 set tag tagname=32767
#sql select tagname from st_smallint_0
#if $data00 != 32767 then
#sql show tags from st_smallint_0
#if $data05 != 32767 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname=-32767
#sql select tagname from st_smallint_0
#if $data00 != -32767 then
#sql show tags from st_smallint_0
#if $data05 != -32767 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname=+100
#sql select tagname from st_smallint_0
#if $data00 != 100 then
#sql show tags from st_smallint_0
#if $data05 != 100 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname=-33
#sql select tagname from st_smallint_0
#if $data00 != -33 then
#sql show tags from st_smallint_0
#if $data05 != -33 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname='+98'
#sql select tagname from st_smallint_0
#if $data00 != 98 then
#sql show tags from st_smallint_0
#if $data05 != 98 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname='-076'
#sql select tagname from st_smallint_0
#if $data00 != -76 then
#sql show tags from st_smallint_0
#if $data05 != -76 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname=+0012
#sql select tagname from st_smallint_0
#if $data00 != 12 then
#sql show tags from st_smallint_0
#if $data05 != 12 then
# return -1
#endi
#sql alter table st_smallint_0 set tag tagname=-00063
#sql select tagname from st_smallint_0
#if $data00 != -63 then
#sql show tags from st_smallint_0
#if $data05 != -63 then
# return -1
#endi
## case 04: illegal input
sql_error create table st_smallint_e0 using mt_smallint tags (32768)
sql_error create table st_smallint_e0 using mt_smallint tags (-32768)
sql create table st_smallint_e0_0 using mt_smallint tags (-32768)
sql_error create table st_smallint_e0 using mt_smallint tags (3276899)
sql_error create table st_smallint_e0 using mt_smallint tags (-3276833)
#sql_error create table st_smallint_e0 using mt_smallint tags (12.80) truncate integer part
......@@ -382,7 +347,7 @@ sql_error create table st_smallint_e0 using mt_smallint tags ("123abc")
sql_error create table st_smallint_e0 using mt_smallint tags (abc)
sql_error create table st_smallint_e0 using mt_smallint tags ("abc")
sql_error create table st_smallint_e0 using mt_smallint tags (" ")
sql_error create table st_smallint_e0 using mt_smallint tags ('')
sql create table st_smallint_e0_1 using mt_smallint tags ('')
sql create table st_smallint_e0 using mt_smallint tags (123)
sql create table st_smallint_e1 using mt_smallint tags (123)
......@@ -399,7 +364,7 @@ sql create table st_smallint_e11 using mt_smallint tags (123)
sql create table st_smallint_e12 using mt_smallint tags (123)
sql_error insert into st_smallint_e0 values (now, 32768)
sql_error insert into st_smallint_e1 values (now, -32768)
sql insert into st_smallint_e1 values (now, -32768)
sql_error insert into st_smallint_e2 values (now, 42768)
sql_error insert into st_smallint_e3 values (now, -32769)
#sql_error insert into st_smallint_e4 values (now, 12.80)
......@@ -409,10 +374,10 @@ sql_error insert into st_smallint_e7 values (now, "123abc")
sql_error insert into st_smallint_e9 values (now, abc)
sql_error insert into st_smallint_e10 values (now, "abc")
sql_error insert into st_smallint_e11 values (now, " ")
sql_error insert into st_smallint_e12 values (now, '')
sql insert into st_smallint_e12 values (now, '')
sql_error insert into st_smallint_e13 using mt_smallint tags (033) values (now, 32768)
sql_error insert into st_smallint_e14 using mt_smallint tags (033) values (now, -32768)
sql insert into st_smallint_e14_1 using mt_smallint tags (033) values (now, -32768)
sql_error insert into st_smallint_e15 using mt_smallint tags (033) values (now, 32968)
sql_error insert into st_smallint_e16 using mt_smallint tags (033) values (now, -33768)
#sql_error insert into st_smallint_e17 using mt_smallint tags (033) values (now, 12.80)
......@@ -422,10 +387,10 @@ sql_error insert into st_smallint_e20 using mt_smallint tags (033) values (now,
sql_error insert into st_smallint_e22 using mt_smallint tags (033) values (now, abc)
sql_error insert into st_smallint_e23 using mt_smallint tags (033) values (now, "abc")
sql_error insert into st_smallint_e24 using mt_smallint tags (033) values (now, " ")
sql_error insert into st_smallint_e25 using mt_smallint tags (033) values (now, '')
sql insert into st_smallint_e25_1 using mt_smallint tags (033) values (now, '')
sql_error insert into st_smallint_e13 using mt_smallint tags (32768) values (now, -033)
sql_error insert into st_smallint_e14 using mt_smallint tags (-32768) values (now, -033)
sql insert into st_smallint_e14 using mt_smallint tags (-32768) values (now, -033)
sql_error insert into st_smallint_e15 using mt_smallint tags (72768) values (now, -033)
sql_error insert into st_smallint_e16 using mt_smallint tags (-92768) values (now, -033)
#sql_error insert into st_smallint_e17 using mt_smallint tags (12.80) values (now, -033)
......@@ -435,7 +400,7 @@ sql_error insert into st_smallint_e20 using mt_smallint tags ("123abc") values (
sql_error insert into st_smallint_e22 using mt_smallint tags (abc) values (now, -033)
sql_error insert into st_smallint_e23 using mt_smallint tags ("abc") values (now, -033)
sql_error insert into st_smallint_e24 using mt_smallint tags (" ") values (now, -033)
sql_error insert into st_smallint_e25 using mt_smallint tags ('') values (now, -033)
sql insert into st_smallint_e25 using mt_smallint tags ('') values (now, -033)
sql insert into st_smallint_e13 using mt_smallint tags (033) values (now, 00062)
sql insert into st_smallint_e14 using mt_smallint tags (033) values (now, 00062)
......@@ -452,7 +417,7 @@ sql insert into st_smallint_e24 using mt_smallint tags (033) values (now, 00062)
sql insert into st_smallint_e25 using mt_smallint tags (033) values (now, 00062)
sql_error alter table st_smallint_e13 set tag tagname=32768
sql_error alter table st_smallint_e14 set tag tagname=-32768
sql alter table st_smallint_e14 set tag tagname=-32768
sql_error alter table st_smallint_e15 set tag tagname=52768
sql_error alter table st_smallint_e16 set tag tagname=-32778
sql_error alter table st_smallint_e19 set tag tagname=123abc
......@@ -460,4 +425,4 @@ sql_error alter table st_smallint_e20 set tag tagname="123abc"
sql_error alter table st_smallint_e22 set tag tagname=abc
sql_error alter table st_smallint_e23 set tag tagname="abc"
sql_error alter table st_smallint_e24 set tag tagname=" "
sql_error alter table st_smallint_e25 set tag tagname=''
sql alter table st_smallint_e25 set tag tagname=''
sql create database if not exists db
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
......@@ -9,79 +17,65 @@ sql create table mt_tinyint (ts timestamp, c tinyint) tags (tagname tinyint)
## case 00: static create table for test tag values
sql create table st_tinyint_0 using mt_tinyint tags (NULL)
sql select tagname from st_tinyint_0
if $data00 != NULL then
print expect NULL, actually: $data00
sql show tags from st_tinyint_0
if $data05 != NULL then
print expect NULL, actually: $data05
return -1
endi
sql create table st_tinyint_1 using mt_tinyint tags (NULL)
sql select tagname from st_tinyint_1
if $data00 != NULL then
return -1
endi
sql create table st_tinyint_2 using mt_tinyint tags ('NULL')
sql select tagname from st_tinyint_2
if $data00 != NULL then
return -1
endi
sql create table st_tinyint_3 using mt_tinyint tags ('NULL')
sql select tagname from st_tinyint_3
if $data00 != NULL then
return -1
endi
sql create table st_tinyint_4 using mt_tinyint tags ("NULL")
sql select tagname from st_tinyint_4
if $data00 != NULL then
return -1
endi
sql create table st_tinyint_5 using mt_tinyint tags ("NULL")
sql select tagname from st_tinyint_5
if $data00 != NULL then
sql show tags from st_tinyint_1
if $data05 != NULL then
return -1
endi
sql_error create table st_tinyint_2 using mt_tinyint tags ('NULL')
sql_error create table st_tinyint_3 using mt_tinyint tags ('NULL')
sql_error create table st_tinyint_4 using mt_tinyint tags ("NULL")
sql_error create table st_tinyint_5 using mt_tinyint tags ("NULL")
sql create table st_tinyint_6 using mt_tinyint tags (-127)
sql select tagname from st_tinyint_6
if $data00 != -127 then
sql show tags from st_tinyint_6
if $data05 != -127 then
return -1
endi
sql create table st_tinyint_7 using mt_tinyint tags (127)
sql select tagname from st_tinyint_7
if $data00 != 127 then
sql show tags from st_tinyint_7
if $data05 != 127 then
return -1
endi
sql create table st_tinyint_8 using mt_tinyint tags (37)
sql select tagname from st_tinyint_8
if $data00 != 37 then
sql show tags from st_tinyint_8
if $data05 != 37 then
return -1
endi
sql create table st_tinyint_9 using mt_tinyint tags (-100)
sql select tagname from st_tinyint_9
if $data00 != -100 then
sql show tags from st_tinyint_9
if $data05 != -100 then
return -1
endi
sql create table st_tinyint_10 using mt_tinyint tags (+113)
sql select tagname from st_tinyint_10
if $data00 != 113 then
sql show tags from st_tinyint_10
if $data05 != 113 then
return -1
endi
sql create table st_tinyint_11 using mt_tinyint tags ('-100')
sql select tagname from st_tinyint_11
if $data00 != -100 then
sql show tags from st_tinyint_11
if $data05 != -100 then
return -1
endi
sql create table st_tinyint_12 using mt_tinyint tags ("+78")
sql select tagname from st_tinyint_12
if $data00 != 78 then
sql show tags from st_tinyint_12
if $data05 != 78 then
return -1
endi
sql create table st_tinyint_13 using mt_tinyint tags (+0078)
sql select tagname from st_tinyint_13
if $data00 != 78 then
sql show tags from st_tinyint_13
if $data05 != 78 then
return -1
endi
sql create table st_tinyint_14 using mt_tinyint tags (-00078)
sql select tagname from st_tinyint_14
if $data00 != -78 then
sql show tags from st_tinyint_14
if $data05 != -78 then
return -1
endi
......@@ -102,38 +96,6 @@ endi
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_2 values (now, 'NULL')
sql select * from st_tinyint_2
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_3 values (now, 'NULL')
sql select * from st_tinyint_3
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_4 values (now, "NULL")
sql select * from st_tinyint_4
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_5 values (now, "NULL")
sql select * from st_tinyint_5
if $rows != 1 then
return -1
endi
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_6 values (now, 127)
sql select * from st_tinyint_6
if $rows != 1 then
......@@ -211,8 +173,8 @@ endi
## case 02: dynamic create table for test tag values
sql insert into st_tinyint_16 using mt_tinyint tags (NULL) values (now, NULL)
sql select tagname from st_tinyint_16
if $data00 != NULL then
sql show tags from st_tinyint_16
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_16
......@@ -221,8 +183,8 @@ if $data01 != NULL then
endi
sql insert into st_tinyint_17 using mt_tinyint tags (NULL) values (now, NULL)
sql select tagname from st_tinyint_17
if $data00 != NULL then
sql show tags from st_tinyint_17
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_17
......@@ -230,8 +192,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_18 using mt_tinyint tags ('NULL') values (now, 'NULL')
sql select tagname from st_tinyint_18
if $data00 != NULL then
sql show tags from st_tinyint_18
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_18
......@@ -239,8 +201,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_19 using mt_tinyint tags ('NULL') values (now, 'NULL')
sql select tagname from st_tinyint_19
if $data00 != NULL then
sql show tags from st_tinyint_19
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_19
......@@ -248,8 +210,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_20 using mt_tinyint tags ("NULL") values (now, "NULL")
sql select tagname from st_tinyint_20
if $data00 != NULL then
sql show tags from st_tinyint_20
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_20
......@@ -257,8 +219,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_21 using mt_tinyint tags ("NULL") values (now, "NULL")
sql select tagname from st_tinyint_21
if $data00 != NULL then
sql show tags from st_tinyint_21
if $data05 != NULL then
return -1
endi
sql select * from st_tinyint_21
......@@ -266,8 +228,8 @@ if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_22 using mt_tinyint tags (127) values (now, 127)
sql select tagname from st_tinyint_22
if $data00 != 127 then
sql show tags from st_tinyint_22
if $data05 != 127 then
return -1
endi
sql select * from st_tinyint_22
......@@ -275,8 +237,8 @@ if $data01 != 127 then
return -1
endi
sql insert into st_tinyint_23 using mt_tinyint tags (-127) values (now, -127)
sql select tagname from st_tinyint_23
if $data00 != -127 then
sql show tags from st_tinyint_23
if $data05 != -127 then
return -1
endi
sql select * from st_tinyint_23
......@@ -284,8 +246,8 @@ if $data01 != -127 then
return -1
endi
sql insert into st_tinyint_24 using mt_tinyint tags (10) values (now, 10)
sql select tagname from st_tinyint_24
if $data00 != 10 then
sql show tags from st_tinyint_24
if $data05 != 10 then
return -1
endi
sql select * from st_tinyint_24
......@@ -293,8 +255,8 @@ if $data01 != 10 then
return -1
endi
sql insert into st_tinyint_25 using mt_tinyint tags ("-0") values (now, "-0")
sql select tagname from st_tinyint_25
if $data00 != 0 then
sql show tags from st_tinyint_25
if $data05 != 0 then
return -1
endi
sql select * from st_tinyint_25
......@@ -302,8 +264,8 @@ if $data01 != 0 then
return -1
endi
sql insert into st_tinyint_26 using mt_tinyint tags ('123') values (now, '123')
sql select tagname from st_tinyint_26
if $data00 != 123 then
sql show tags from st_tinyint_26
if $data05 != 123 then
return -1
endi
sql select * from st_tinyint_26
......@@ -311,8 +273,8 @@ if $data01 != 123 then
return -1
endi
sql insert into st_tinyint_27 using mt_tinyint tags (+056) values (now, +00056)
sql select tagname from st_tinyint_27
if $data00 != 56 then
sql show tags from st_tinyint_27
if $data05 != 56 then
return -1
endi
sql select * from st_tinyint_27
......@@ -320,8 +282,8 @@ if $data01 != 56 then
return -1
endi
sql insert into st_tinyint_28 using mt_tinyint tags (-056) values (now, -0056)
sql select tagname from st_tinyint_28
if $data00 != -56 then
sql show tags from st_tinyint_28
if $data05 != -56 then
return -1
endi
sql select * from st_tinyint_28
......@@ -331,49 +293,49 @@ endi
## case 03: alter tag values
#sql alter table st_tinyint_0 set tag tagname=127
#sql select tagname from st_tinyint_0
#if $data00 != 127 then
#sql show tags from st_tinyint_0
#if $data05 != 127 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname=-127
#sql select tagname from st_tinyint_0
#if $data00 != -127 then
#sql show tags from st_tinyint_0
#if $data05 != -127 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname=+100
#sql select tagname from st_tinyint_0
#if $data00 != 100 then
#sql show tags from st_tinyint_0
#if $data05 != 100 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname=-33
#sql select tagname from st_tinyint_0
#if $data00 != -33 then
#sql show tags from st_tinyint_0
#if $data05 != -33 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname='+98'
#sql select tagname from st_tinyint_0
#if $data00 != 98 then
#sql show tags from st_tinyint_0
#if $data05 != 98 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname='-076'
#sql select tagname from st_tinyint_0
#if $data00 != -76 then
#sql show tags from st_tinyint_0
#if $data05 != -76 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname=+0012
#sql select tagname from st_tinyint_0
#if $data00 != 12 then
#sql show tags from st_tinyint_0
#if $data05 != 12 then
# return -1
#endi
#sql alter table st_tinyint_0 set tag tagname=-00063
#sql select tagname from st_tinyint_0
#if $data00 != -63 then
#sql show tags from st_tinyint_0
#if $data05 != -63 then
# return -1
#endi
## case 04: illegal input
sql_error create table st_tinyint_e0 using mt_tinyint tags (128)
sql_error create table st_tinyint_e0 using mt_tinyint tags (-128)
sql create table st_tinyint_e0_1 using mt_tinyint tags (-128)
sql_error create table st_tinyint_e0 using mt_tinyint tags (1280)
sql_error create table st_tinyint_e0 using mt_tinyint tags (-1280)
#sql_error create table st_tinyint_e0 using mt_tinyint tags (12.80) truncate integer part
......@@ -383,7 +345,7 @@ sql_error create table st_tinyint_e0 using mt_tinyint tags ("123abc")
sql_error create table st_tinyint_e0 using mt_tinyint tags (abc)
sql_error create table st_tinyint_e0 using mt_tinyint tags ("abc")
sql_error create table st_tinyint_e0 using mt_tinyint tags (" ")
sql_error create table st_tinyint_e0 using mt_tinyint tags ('')
sql create table st_tinyint_e0_2 using mt_tinyint tags ('')
sql create table st_tinyint_e0 using mt_tinyint tags (123)
sql create table st_tinyint_e1 using mt_tinyint tags (123)
......@@ -400,7 +362,7 @@ sql create table st_tinyint_e11 using mt_tinyint tags (123)
sql create table st_tinyint_e12 using mt_tinyint tags (123)
sql_error insert into st_tinyint_e0 values (now, 128)
sql_error insert into st_tinyint_e1 values (now, -128)
sql insert into st_tinyint_e1 values (now, -128)
sql_error insert into st_tinyint_e2 values (now, 1280)
sql_error insert into st_tinyint_e3 values (now, -1280)
#sql_error insert into st_tinyint_e4 values (now, 12.80)
......@@ -410,10 +372,10 @@ sql_error insert into st_tinyint_e7 values (now, "123abc")
sql_error insert into st_tinyint_e9 values (now, abc)
sql_error insert into st_tinyint_e10 values (now, "abc")
sql_error insert into st_tinyint_e11 values (now, " ")
sql_error insert into st_tinyint_e12 values (now, '')
sql insert into st_tinyint_e12 values (now, '')
sql_error insert into st_tinyint_e13 using mt_tinyint tags (033) values (now, 128)
sql_error insert into st_tinyint_e14 using mt_tinyint tags (033) values (now, -128)
sql insert into st_tinyint_e14_1 using mt_tinyint tags (033) values (now, -128)
sql_error insert into st_tinyint_e15 using mt_tinyint tags (033) values (now, 1280)
sql_error insert into st_tinyint_e16 using mt_tinyint tags (033) values (now, -1280)
#sql_error insert into st_tinyint_e17 using mt_tinyint tags (033) values (now, 12.80)
......@@ -423,10 +385,10 @@ sql_error insert into st_tinyint_e20 using mt_tinyint tags (033) values (now, "1
sql_error insert into st_tinyint_e22 using mt_tinyint tags (033) values (now, abc)
sql_error insert into st_tinyint_e23 using mt_tinyint tags (033) values (now, "abc")
sql_error insert into st_tinyint_e24 using mt_tinyint tags (033) values (now, " ")
sql_error insert into st_tinyint_e25 using mt_tinyint tags (033) values (now, '')
sql insert into st_tinyint_e25_2 using mt_tinyint tags (033) values (now, '')
sql_error insert into st_tinyint_e13 using mt_tinyint tags (128) values (now, -033)
sql_error insert into st_tinyint_e14 using mt_tinyint tags (-128) values (now, -033)
sql insert into st_tinyint_e14 using mt_tinyint tags (-128) values (now, -033)
sql_error insert into st_tinyint_e15 using mt_tinyint tags (1280) values (now, -033)
sql_error insert into st_tinyint_e16 using mt_tinyint tags (-1280) values (now, -033)
#sql_error insert into st_tinyint_e17 using mt_tinyint tags (12.80) values (now, -033)
......@@ -436,7 +398,7 @@ sql_error insert into st_tinyint_e20 using mt_tinyint tags ("123abc") values (no
sql_error insert into st_tinyint_e22 using mt_tinyint tags (abc) values (now, -033)
sql_error insert into st_tinyint_e23 using mt_tinyint tags ("abc") values (now, -033)
sql_error insert into st_tinyint_e24 using mt_tinyint tags (" ") values (now, -033)
sql_error insert into st_tinyint_e25 using mt_tinyint tags ('') values (now, -033)
sql insert into st_tinyint_e25 using mt_tinyint tags ('') values (now, -033)
sql insert into st_tinyint_e13 using mt_tinyint tags (033) values (now, 00062)
sql insert into st_tinyint_e14 using mt_tinyint tags (033) values (now, 00062)
......@@ -453,7 +415,7 @@ sql insert into st_tinyint_e24 using mt_tinyint tags (033) values (now, 00062)
sql insert into st_tinyint_e25 using mt_tinyint tags (033) values (now, 00062)
sql_error alter table st_tinyint_e13 set tag tagname=128
sql_error alter table st_tinyint_e14 set tag tagname=-128
sql alter table st_tinyint_e14 set tag tagname=-128
sql_error alter table st_tinyint_e15 set tag tagname=1280
sql_error alter table st_tinyint_e16 set tag tagname=-1280
sql_error alter table st_tinyint_e19 set tag tagname=123abc
......@@ -461,4 +423,4 @@ sql_error alter table st_tinyint_e20 set tag tagname="123abc"
sql_error alter table st_tinyint_e22 set tag tagname=abc
sql_error alter table st_tinyint_e23 set tag tagname="abc"
sql_error alter table st_tinyint_e24 set tag tagname=" "
sql_error alter table st_tinyint_e25 set tag tagname=''
sql alter table st_tinyint_e25 set tag tagname=''
sql create database if not exists db
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ========== columnValues.sim
sql drop database if exists db
sql create database db
sql use db
sql drop table if exists mt_unsigned;
......@@ -10,28 +18,21 @@ sql alter table mt_unsigned_1 set tag t1=138;
sql alter table mt_unsigned_1 set tag t2=32769;
sql alter table mt_unsigned_1 set tag t3=294967295;
sql alter table mt_unsigned_1 set tag t4=446744073709551615;
sql insert into mt_unsigned_1 values (now, 0, 0, 0, 0, 0, 0, 0, 0, 0)
sql select t1,t2,t3,t4 from mt_unsigned_1
if $rows != 1 then
return -1
endi
print $data00, $data01, $data02, $data03
if $data00 != 138 then
print expect 138, actual: $data00
return -1
endi
print $data01, $data02, $data03
if $data01 != 32769 then
return -1
return -1
endi
if $data02 != 294967295 then
return -1
return -1
endi
if $data03 != 446744073709551615 then
return -1
return -1
endi
sql_error sql alter table mt_unsigned_1 set tag t1 = 999;
......@@ -44,10 +45,10 @@ sql_error create table mt_unsigned_3 using mt_unsigned tags(0, -1, 0, 0, 0, 0, 0
sql_error create table mt_unsigned_4 using mt_unsigned tags(0, 0, -1, 0, 0, 0, 0, 0);
sql_error create table mt_unsigned_5 using mt_unsigned tags(0, 0, 0, -1, 0, 0, 0, 0);
sql_error create table mt_unsigned_2 using mt_unsigned tags(255, 0, 0, 0, 0, 0, 0, 0);
sql_error create table mt_unsigned_3 using mt_unsigned tags(0, 65535, 0, 0, 0, 0, 0, 0);
sql_error create table mt_unsigned_4 using mt_unsigned tags(0, 0, 4294967295, 0, 0, 0, 0, 0);
sql_error create table mt_unsigned_5 using mt_unsigned tags(0, 0, 0, 18446744073709551615, 0, 0, 0, 0);
sql create table mt_unsigned_21 using mt_unsigned tags(255, 0, 0, 0, 0, 0, 0, 0);
sql create table mt_unsigned_31 using mt_unsigned tags(0, 65535, 0, 0, 0, 0, 0, 0);
sql create table mt_unsigned_41 using mt_unsigned tags(0, 0, 4294967295, 0, 0, 0, 0, 0);
sql create table mt_unsigned_51 using mt_unsigned tags(0, 0, 0, 18446744073709551615, 0, 0, 0, 0);
sql_error create table mt_unsigned_2 using mt_unsigned tags(999, 0, 0, 0, 0, 0, 0, 0);
sql_error create table mt_unsigned_3 using mt_unsigned tags(0, 95535, 0, 0, 0, 0, 0, 0);
......@@ -63,11 +64,6 @@ if $rows != 1 then
return -1;
endi
if $data00 != NULL then
print expect NULL, actual: $data00
return -1
endi
if $data01 != NULL then
return -1
endi
......@@ -87,82 +83,44 @@ sql_error insert into mt_unsigned_1 values(now, -1, NULL, NULL, NULL, NULL, NULL
sql_error insert into mt_unsigned_1 values(now, NULL, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, NULL, NULL, -1, NULL, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, NULL, NULL, NULL, -1, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, NULL, 65535, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, NULL, NULL, 4294967295, NULL, NULL, NULL, NULL, NULL, NULL);
sql_error insert into mt_unsigned_1 values(now, NULL, NULL, NULL, 18446744073709551615, NULL, NULL, NULL, NULL, NULL);
sql insert into mt_unsigned_1 values(now, 255, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
sql insert into mt_unsigned_1 values(now, NULL, 65535, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
sql insert into mt_unsigned_1 values(now, NULL, NULL, 4294967295, NULL, NULL, NULL, NULL, NULL, NULL);
sql insert into mt_unsigned_1 values(now, NULL, NULL, NULL, 18446744073709551615, NULL, NULL, NULL, NULL, NULL);
sql select count(a),count(b),count(c),count(d), count(e) from mt_unsigned_1
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
if $data01 != 3 then
return -1
endi
sql select a+b+c from mt_unsigned_1 where a is null;
if $rows != 1 then
return -1
endi
if $data00 != NULL then
print expect NULL, actual:$data00
if $rows != 4 then
return -1
endi
sql select count(*), a from mt_unsigned_1 group by a;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 1 then
if $rows != 4 then
return -1
endi
sql select count(*), b from mt_unsigned_1 group by b;
if $rows != 1 then
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 2 then
return -1
endi
sql select count(*), c from mt_unsigned_1 group by c;
if $rows != 1 then
if $rows != 4 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 3 then
return -1
endi
sql select count(*), d from mt_unsigned_1 group by d;
if $rows != 1 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data01 != 4 then
if $rows != 4 then
return -1
endi
......
......@@ -243,9 +243,6 @@ if $rows != $val then
return -1
endi
#TODO
return
#===========================aggregation===================================
#select + where condition
sql select count(join_tb1.*), count(join_tb0.*) from $tb1 , $tb2 where $ts1 = $ts2 and join_tb1.ts >= 100000 and join_tb0.c7 = false;
......
......@@ -41,12 +41,10 @@ sql_error insert into tb17 (ts, c1, c3) using stb (t1, t3) tags ('tag5', 11.11,
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.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
sql select * from stbx order by t1
if $rows != 3 then
return -1
endi
......
......@@ -100,7 +100,7 @@ endi
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 2 then
return -1
endi
......
......@@ -25,11 +25,5 @@ sql (select database()) union all (select database())
if $rows != 2 then
return -1
endi
if $data00 != @union_db0@ then
return -1
endi
if $data10 != @union_db0@ then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -77,12 +77,12 @@ if $rows != $val then
return -1
endi
sql select tbname from $mt
sql select distinct tbname from $mt
if $rows != $tbNum then
return -1
endi
sql select tbname from $mt where t1 < 2
sql select distinct tbname from $mt where t1 < 2
if $rows != 2 then
return -1
endi
......@@ -249,14 +249,14 @@ sql_error insert into tb_where_NULL values(now, ?, '12')
sql insert into tb_where_NULL values ('2019-01-01 09:00:00.000', 1, 'val1')
sql insert into tb_where_NULL values ('2019-01-01 09:00:01.000', NULL, NULL)
sql insert into tb_where_NULL values ('2019-01-01 09:00:02.000', 2, 'val2')
sql_error select * from tb_where_NULL where c1 = NULL
sql_error select * from tb_where_NULL where c1 <> NULL
sql_error select * from tb_where_NULL where c1 < NULL
sql_error select * from tb_where_NULL where c1 = "NULL"
sql_error select * from tb_where_NULL where c1 <> "NULL"
sql_error select * from tb_where_NULL where c1 <> "nulL"
sql_error select * from tb_where_NULL where c1 > "NULL"
sql_error select * from tb_where_NULL where c1 >= "NULL"
sql select * from tb_where_NULL where c1 = NULL
sql select * from tb_where_NULL where c1 <> NULL
sql select * from tb_where_NULL where c1 < NULL
sql select * from tb_where_NULL where c1 = "NULL"
sql select * from tb_where_NULL where c1 <> "NULL"
sql select * from tb_where_NULL where c1 <> "nulL"
sql select * from tb_where_NULL where c1 > "NULL"
sql select * from tb_where_NULL where c1 >= "NULL"
sql select * from tb_where_NULL where c2 = "NULL"
if $rows != 0 then
return -1
......@@ -300,15 +300,17 @@ endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
sql_error select * from wh_mt0 where c3 = 'abc' and tbname in ('test_null_filter');
sql select * from wh_mt0 where c3 = 'abc' and tbname in ('test_null_filter');
sql select * from wh_mt0 where c3 = '1' and tbname in ('test_null_filter');
if $row != 0 then
return -1
endi
sql select * from wh_mt0 where c3 = '1';
if $row == 0 then
sql select * from wh_mt0 where c3 = 1;
print $rows -> 1000
print $data00 $data01 $data02
if $row != 1000 then
return -1
endi
......@@ -336,7 +338,7 @@ sql insert into where_ts values('2021-06-19 16:22:00', 1);
sql insert into where_ts values('2021-06-19 16:23:00', 2);
sql insert into where_ts values('2021-06-19 16:24:00', 3);
sql insert into where_ts values('2021-06-19 16:25:00', 1);
sql select * from (select * from where_ts) where ts<'2021-06-19 16:25:00' and ts>'2021-06-19 16:22:00'
sql select * from (select * from where_ts) where ts<'2021-06-19 16:25:00' and ts>'2021-06-19 16:22:00' order by ts;
if $rows != 2 then
return -1
endi
......
......@@ -311,7 +311,7 @@ sql select * from $mt where tgcol2 = 1 -x step52
return -1
step52:
sql select * from $mt where tgcol3 = 1
sql select * from $mt where tgcol3 < 2
print $data01 $data02 $data03
if $rows != 1 then
return -1
......
......@@ -97,10 +97,10 @@ if $data23 != TAG then
return -1
endi
sql alter table $mt drop tag tgcol2
sql alter table $mt drop tag tgcol1 -x step40
return -1
step40:
sql alter table $mt drop tag tgcol2
print =============== step5
$i = 5
......@@ -123,11 +123,11 @@ if $data03 != 2 then
return -1
endi
sql alter table $mt drop tag tgcol2
sql alter table $mt drop tag tgcol1 -x step50
return -1
step50:
sql alter table $mt drop tag tgcol2
print =============== step6
$i = 6
$mt = $mtPrefix . $i
......@@ -186,7 +186,7 @@ endi
if $data31 != TINYINT then
return -1
endi
if $data41 != BINARY then
if $data41 != VARCHAR then
return -1
endi
if $data22 != 2 then
......@@ -405,8 +405,6 @@ sql alter table $mt drop tag tgcol3
sql alter table $mt drop tag tgcol4
sql alter table $mt drop tag tgcol6
sleep 3000
print =============== step2
$i = 2
$mt = $mtPrefix . $i
......
......@@ -32,7 +32,7 @@ if $data(2)[4] != ready then
endi
print =============== kill dnode2
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGKILL
print =============== create database
sql show transactions
......@@ -88,7 +88,7 @@ endi
sql show transactions
if $rows != 0 then
return -1
goto step2
endi
sql_error create database d1 vgroups 2;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册