提交 81a846ed 编写于 作者: S shenglian zhou

add test case and modify error message

上级 a713d367
......@@ -1892,7 +1892,7 @@ static int32_t handleAggTypeExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t
}
static int32_t handleSQLExprItem(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t exprIndex, tSqlExprItem* pItem) {
const char* msg1 = "invalid column name, illegal column type, or columns in arithmetic expression from two tables";
const char* msg1 = "invalid column name, illegal column type, illegal function combination or columns in expression from two tables";
SColumnList columnList = {0};
int32_t sqlExprType = SQLEXPR_TYPE_UNASSIGNED;
......
......@@ -39,6 +39,7 @@ run general/compute/sum.sim
run general/compute/top.sim
run general/compute/block_dist.sim
run general/compute/scalar_pow.sim
run general/compute/scalar_triangle.sim
run general/db/alter_option.sim
run general/db/alter_tables_d2.sim
run general/db/alter_tables_v1.sim
......@@ -140,6 +141,7 @@ run general/parser/groupby.sim
run general/parser/top_groupby.sim
run general/parser/tags_dynamically_specifiy.sim
run general/parser/set_tag_vals.sim
run general/parser/scalar_expression.sim
#unsupport run general/parser/repeatAlter.sim
#unsupport run general/parser/slimit_alter_tags.sim
run general/parser/precision_ns.sim
......
......@@ -21,3 +21,4 @@ run general/compute/sum.sim
run general/compute/top.sim
run general/compute/block_dist.sim
run general/compute/scalar_pow.sim
run general/compute/scalar_triangle.sim
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 500
sql connect
$dbPrefix = db
$tbPrefix = ct
$mtPrefix = st
$tbNum = 2
$rowNum = 50
print =============== step1 create stable/table
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 nchar(5), c9 binary(10)) TAGS (tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
$y = 0.25
while $x < $rowNum
$cc = $x * 60000
$ms = 1601481600000 + $cc
sql insert into $tb values ($ms , $x , $y , $x , $x , $x , $y , $x , $x , $x )
$x = $x + 1
$y = $y + 1
endw
$i = $i + 1
endw
print ================= step2
$stb = $mtPrefix . 0
$tb = $tbPrefix . 0
print execute sql select floor(3.0)+ceil(4.0) from $tb
sql select floor(3.0)+ceil(4.0) from $tb
if $rows != 50 then
return -1
endi
if $data00 != 7.000000000 then
return -1
endi
if $data10 != 7.000000000 then
return -1
endi
if $data20 != 7.000000000 then
return -1
endi
if $data30 != 7.000000000 then
return -1
endi
if $data40 != 7.000000000 then
return -1
endi
if $data50 != 7.000000000 then
return -1
endi
if $data60 != 7.000000000 then
return -1
endi
if $data70 != 7.000000000 then
return -1
endi
if $data80 != 7.000000000 then
return -1
endi
if $data90 != 7.000000000 then
return -1
endi
print execute sql select sum(c1)+3.0+4.0 from $stb
sql select sum(c1)+3.0+4.0 from $stb
if $rows != 1 then
return -1
endi
if $data00 != 2457.000000000 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -39,6 +39,7 @@ run general/compute/sum.sim
run general/compute/top.sim
run general/compute/block_dist.sim
run general/compute/scalar_pow.sim
run general/compute/scalar_triangle.sim
run general/db/alter_option.sim
run general/db/alter_tables_d2.sim
run general/db/alter_tables_v1.sim
......@@ -141,6 +142,7 @@ run general/parser/tags_dynamically_specifiy.sim
run general/parser/set_tag_vals.sim
run general/parser/repeatAlter.sim
run general/parser/precision_ns.sim
run general/parser/scalar_expression.sim
##unsupport run general/parser/slimit_alter_tags.sim
run general/stable/disk.sim
run general/stable/dnode3.sim
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册