未验证 提交 37080a36 编写于 作者: G Ganlin Zhao 提交者: GitHub

Merge pull request #15988 from taosdata/fix/TD-18331

fix(query): forbid interp in super table query
......@@ -199,6 +199,7 @@ bool fmIsUserDefinedFunc(int32_t funcId);
bool fmIsDistExecFunc(int32_t funcId);
bool fmIsForbidFillFunc(int32_t funcId);
bool fmIsForbidStreamFunc(int32_t funcId);
bool fmIsForbidSuperTableFunc(int32_t funcId);
bool fmIsIntervalInterpoFunc(int32_t funcId);
bool fmIsInterpFunc(int32_t funcId);
bool fmIsLastRowFunc(int32_t funcId);
......
......@@ -49,6 +49,7 @@ extern "C" {
#define FUNC_MGT_MULTI_ROWS_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(20)
#define FUNC_MGT_KEEP_ORDER_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(21)
#define FUNC_MGT_CUMULATIVE_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(22)
#define FUNC_MGT_FORBID_STABLE_FUNC FUNC_MGT_FUNC_CLASSIFICATION_MASK(23)
#define FUNC_MGT_TEST_MASK(val, mask) (((val) & (mask)) != 0)
......
......@@ -2287,7 +2287,8 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
{
.name = "interp",
.type = FUNCTION_TYPE_INTERP,
.classification = FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_INTERVAL_INTERPO_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC | FUNC_MGT_FORBID_STREAM_FUNC,
.classification = FUNC_MGT_TIMELINE_FUNC | FUNC_MGT_INTERVAL_INTERPO_FUNC | FUNC_MGT_IMPLICIT_TS_FUNC |
FUNC_MGT_FORBID_STREAM_FUNC | FUNC_MGT_FORBID_STABLE_FUNC,
.translateFunc = translateInterp,
.getEnvFunc = getSelectivityFuncEnv,
.initFunc = functionSetup,
......
......@@ -212,6 +212,8 @@ bool fmIsKeepOrderFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, F
bool fmIsCumulativeFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_CUMULATIVE_FUNC); }
bool fmIsForbidSuperTableFunc(int32_t funcId) { return isSpecificClassifyFunc(funcId, FUNC_MGT_FORBID_STABLE_FUNC); }
bool fmIsInterpFunc(int32_t funcId) {
if (funcId < 0 || funcId >= funcMgtBuiltinsNum) {
return false;
......
......@@ -1270,6 +1270,25 @@ static int32_t translateRepeatScanFunc(STranslateContext* pCxt, SFunctionNode* p
return TSDB_CODE_SUCCESS;
}
static int32_t translateForbidSuperTableFunc(STranslateContext* pCxt, SFunctionNode* pFunc) {
if (!fmIsForbidSuperTableFunc(pFunc->funcId)) {
return TSDB_CODE_SUCCESS;
}
if (!isSelectStmt(pCxt->pCurrStmt)) {
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_ONLY_SUPPORT_SINGLE_TABLE,
"%s is only supported in single table query", pFunc->functionName);
}
SSelectStmt* pSelect = (SSelectStmt*)pCxt->pCurrStmt;
SNode* pTable = pSelect->pFromTable;
if ((NULL != pTable && (QUERY_NODE_REAL_TABLE != nodeType(pTable) ||
(TSDB_CHILD_TABLE != ((SRealTableNode*)pTable)->pMeta->tableType &&
TSDB_NORMAL_TABLE != ((SRealTableNode*)pTable)->pMeta->tableType)))) {
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_ONLY_SUPPORT_SINGLE_TABLE,
"%s is only supported in single table query", pFunc->functionName);
}
return TSDB_CODE_SUCCESS;
}
static bool isStar(SNode* pNode) {
return (QUERY_NODE_COLUMN == nodeType(pNode)) && ('\0' == ((SColumnNode*)pNode)->tableAlias[0]) &&
(0 == strcmp(((SColumnNode*)pNode)->colName, "*"));
......@@ -1426,6 +1445,9 @@ static int32_t rewriteSystemInfoFunc(STranslateContext* pCxt, SNode** pNode) {
static int32_t translateNoramlFunction(STranslateContext* pCxt, SFunctionNode* pFunc) {
int32_t code = translateAggFunc(pCxt, pFunc);
if (TSDB_CODE_SUCCESS == code) {
code = translateForbidSuperTableFunc(pCxt, pFunc);
}
if (TSDB_CODE_SUCCESS == code) {
code = translateScanPseudoColumnFunc(pCxt, pFunc);
}
......
......@@ -2,7 +2,7 @@ This file contains a brief info about the parser test scripts directory.
The directory contains scripts for TDengine parser testing, mainly focus on syntax parsing and datatype support. The tests are organized in the way database languages are catagorized.
DML:
DML:
{
SELECT
INSERT
......
......@@ -40,7 +40,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 30240m,30240m,30240m then
if $data27 != 30240m,30240m,30240m then
return -1
endi
sql alter database $db keep 11,12
......@@ -48,7 +48,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 15840m,17280m,17280m then
if $data27 != 15840m,17280m,17280m then
return -1
endi
sql alter database $db keep 20,20,20
......@@ -56,7 +56,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 28800m,28800m,28800m then
if $data27 != 28800m,28800m,28800m then
return -1
endi
sql alter database $db keep 10,10,10
......@@ -64,7 +64,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 14400m,14400m,14400m then
if $data27 != 14400m,14400m,14400m then
return -1
endi
sql alter database $db keep 10,10,11
......@@ -72,7 +72,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 14400m,14400m,15840m then
if $data27 != 14400m,14400m,15840m then
return -1
endi
sql alter database $db keep 11,12,13
......@@ -80,7 +80,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 15840m,17280m,18720m then
if $data27 != 15840m,17280m,18720m then
return -1
endi
sql alter database $db keep 365000,365000,365000
......@@ -88,7 +88,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 525600000m,525600000m,525600000m then
if $data27 != 525600000m,525600000m,525600000m then
return -1
endi
......@@ -100,11 +100,11 @@ if $rows != 1 then
return -1
endi
sql alter table tb drop column c3
sql select * from tb order by ts desc
sql select * from tb order by ts desc
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
if $data02 != 1 then
return -1
endi
if $data03 != null then
......@@ -136,10 +136,10 @@ sql create table tb using mt tags(1)
sql insert into tb values (now, 1, 1, 1)
sql alter table mt drop column c3
sql select * from tb order by ts desc
if $data01 != 1 then
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
if $data02 != 1 then
return -1
endi
if $data03 != null then
......@@ -243,7 +243,7 @@ if $data02 != null then
endi
sql alter table mt add column c2 int
sql insert into tb (ts, c2) values (now, 3)
sql select * from tb order by ts desc
sql select * from tb order by ts desc
if $data02 != 3 then
return -1
endi
......@@ -268,7 +268,7 @@ if $data02 != insert then
return -1
endi
sql alter table mt add column c3 nchar(4)
sql select * from tb order by ts desc
sql select * from tb order by ts desc
if $data03 != NULL then
return -1
endi
......@@ -283,7 +283,7 @@ sql insert into tb(ts, c1, c3) using mt(t1) tags(123) values('2018-11-01 16:29:5
sql insert into tb values ('2018-11-01 16:29:58.000', 2, 'import', 3)
sql import into tb values ('2018-11-01 16:29:58.000', 2, 'import', 3)
sql import into tb values ('2018-11-01 16:39:58.000', 2, 'import', 3)
sql select * from tb order by ts desc
sql select * from tb order by ts desc
if $rows != 4 then
return -1
endi
......
......@@ -23,7 +23,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 28800m,28800m,28800m then
if $data27 != 28800m,28800m,28800m then
return -1
endi
......@@ -49,7 +49,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 28800m,28800m,28800m then
if $data27 != 28800m,28800m,28800m then
return -1
endi
sql alter database $db keep 10
......@@ -57,7 +57,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 14400m,14400m,14400m then
if $data27 != 14400m,14400m,14400m then
return -1
endi
sql alter database $db keep 11
......@@ -65,7 +65,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 15840m,15840m,15840m then
if $data27 != 15840m,15840m,15840m then
return -1
endi
sql alter database $db keep 13
......@@ -73,7 +73,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 18720m,18720m,18720m then
if $data27 != 18720m,18720m,18720m then
return -1
endi
sql alter database $db keep 365000
......@@ -81,7 +81,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 525600000m,525600000m,525600000m then
if $data27 != 525600000m,525600000m,525600000m then
return -1
endi
......@@ -94,11 +94,11 @@ if $rows != 1 then
return -1
endi
sql alter table tb drop column c3
sql select * from tb order by ts desc
sql select * from tb order by ts desc
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
if $data02 != 1 then
return -1
endi
if $data03 != null then
......@@ -130,10 +130,10 @@ sql create table tb using mt tags(1)
sql insert into tb values (now, 1, 1, 1)
sql alter table mt drop column c3
sql select * from tb order by ts desc
if $data01 != 1 then
if $data01 != 1 then
return -1
endi
if $data02 != 1 then
if $data02 != 1 then
return -1
endi
if $data03 != null then
......@@ -231,7 +231,7 @@ if $data02 != null then
endi
sql alter table mt add column c2 int
sql insert into tb (ts, c2) values (now, 3)
sql select * from tb order by ts desc
sql select * from tb order by ts desc
if $data02 != 3 then
return -1
endi
......@@ -255,7 +255,7 @@ if $data02 != insert then
return -1
endi
sql alter table mt add column c3 nchar(4)
sql select * from tb order by ts desc
sql select * from tb order by ts desc
if $data03 != NULL then
return -1
endi
......@@ -270,7 +270,7 @@ sql insert into tb(ts, c1, c3) using mt(t1) tags(123) values('2018-11-01 16:29:5
sql insert into tb values ('2018-11-01 16:29:58.000', 2, 'import', 3)
sql import into tb values ('2018-11-01 16:29:58.000', 2, 'import', 3)
sql import into tb values ('2018-11-01 16:39:58.000', 2, 'import', 3)
sql select * from tb order by ts desc
sql select * from tb order by ts desc
if $rows != 4 then
return -1
endi
......
......@@ -35,7 +35,7 @@ sql alter table tb1 set tag len = 379
# case TD-5594
sql create stable st5520(ts timestamp, f int) tags(t0 bool, t1 nchar(4093), t2 nchar(1))
sql alter stable st5520 modify tag t2 nchar(2);
# test end
# test end
sql drop database $db
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -30,12 +30,12 @@ sql show stables
if $rows != 1 then
return -1
endi
if $data00 != $stb then
if $data00 != $stb then
return -1
endi
### create table on the fly
sql insert into tb1 using $stb tags (1) values ( $ts0 , 1,1,1,1,'bin',1,1,1,'涛思数据')
sql insert into tb1 using $stb tags (1) values ( $ts0 , 1,1,1,1,'bin',1,1,1,'涛思数据')
sql select * from tb1
if $rows != 1 then
return -1
......@@ -184,7 +184,7 @@ if $data(3)[8] != 涛思数据3 then
return -1
endi
sql select t1, count(*), first(c9) from $stb partition by t1 order by t1 asc slimit 3
sql select t1, count(*), first(c9) from $stb partition by t1 order by t1 asc slimit 3
if $rows != 3 then
return -1
endi
......@@ -251,7 +251,7 @@ if $data(3)[8] != 涛思数据3 then
return -1
endi
sql select t1, count(*), first(c9) from $stb partition by t1 order by t1 asc slimit 3
sql select t1, count(*), first(c9) from $stb partition by t1 order by t1 asc slimit 3
if $rows != 3 then
return -1
endi
......@@ -290,7 +290,7 @@ endi
#sql drop database $db
#sql show databases
#if $rows != 0 then
#if $rows != 0 then
# return -1
#endi
......@@ -305,4 +305,4 @@ if $rows != 2 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -37,9 +37,9 @@ while $t < $tbNum
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
sql insert into $tbname using $stb tags( $t1 ) values ( $ts , $x )
sql insert into $tbname using $stb tags( $t1 ) values ( $ts , $x )
$x = $x + 1
endw
endw
$t = $t + 1
$x = 0
endw
......@@ -47,11 +47,11 @@ print ====== tables created
sql drop table tb2
$x = 0
while $x < $rowNum
while $x < $rowNum
$ts = $ts + $delta
$t1 = 'tb . $t
$t1 = $t1 . '
sql insert into tb1 using $stb tags( $t1 ) values ( $ts , $x )
sql insert into tb1 using $stb tags( $t1 ) values ( $ts , $x )
$x = $x + 1
endw
......@@ -62,7 +62,7 @@ $x = 0
while $x < 100
$ts = $ts + $delta
sql insert into tb2 using stb0 tags('tb2') values ( $ts , 1)
sql select * from tb2
sql select * from tb2
$res = $x + 1
if $rows != $res then
return -1
......@@ -74,4 +74,4 @@ while $x < 100
print loop $x
endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -13,7 +13,7 @@ sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1");
sql create table tb2 using st2 tags (2,2.0,"2",2.0,2,2,"2");
sql create table tb3 using st2 tags (3,3.0,"3",3.0,3,3,"3");
sql create table tb4 using st2 tags (4,4.0,"4",4.0,4,4,"4");
sql insert into tb1 values (now-200s,1,1.0,1.0,1,1,1,true,"1","1")
sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true,"2","2")
sql insert into tb1 values (now,3,3.0,3.0,3,3,3,true,"3","3")
......@@ -47,16 +47,16 @@ sql select tbname, id2 from st2 where id2 between 0.0 and 3.0;
if $rows != 7 then
return -1
endi
if $data(tb2)[0] != tb2 then
if $data(tb2)[0] != tb2 then
return -1
endi
if $data(tb2)[1] != 2.00000 then
if $data(tb2)[1] != 2.00000 then
return -1
endi
if $data(tb3)[0] != tb3 then
if $data(tb3)[0] != tb3 then
return -1
endi
if $data(tb3)[1] != 3.00000 then
if $data(tb3)[1] != 3.00000 then
return -1
endi
......@@ -64,16 +64,16 @@ sql select tbname, id4 from st2 where id2 between 2.0 and 3.0;
if $rows != 2 then
return -1
endi
if $data(tb2)[0] != tb2 then
if $data(tb2)[0] != tb2 then
return -1
endi
if $data(tb2)[1] != 2.000000000 then
if $data(tb2)[1] != 2.000000000 then
return -1
endi
if $data(tb3)[0] != tb3 then
if $data(tb3)[0] != tb3 then
return -1
endi
if $data(tb3)[1] != 3.000000000 then
if $data(tb3)[1] != 3.000000000 then
return -1
endi
......@@ -81,16 +81,16 @@ sql select tbname, id5 from st2 where id5 between 2.0 and 3.0;
if $rows != 2 then
return -1
endi
if $data(tb2)[0] != tb2 then
if $data(tb2)[0] != tb2 then
return -1
endi
if $data(tb2)[1] != 2 then
if $data(tb2)[1] != 2 then
return -1
endi
if $data(tb3)[0] != tb3 then
if $data(tb3)[0] != tb3 then
return -1
endi
if $data(tb3)[1] != 3 then
if $data(tb3)[1] != 3 then
return -1
endi
......@@ -98,16 +98,16 @@ sql select tbname,id6 from st2 where id6 between 2.0 and 3.0;
if $rows != 2 then
return -1
endi
if $data(tb2)[0] != tb2 then
if $data(tb2)[0] != tb2 then
return -1
endi
if $data(tb2)[1] != 2 then
if $data(tb2)[1] != 2 then
return -1
endi
if $data(tb3)[0] != tb3 then
if $data(tb3)[0] != tb3 then
return -1
endi
if $data(tb3)[1] != 3 then
if $data(tb3)[1] != 3 then
return -1
endi
......@@ -115,10 +115,10 @@ sql select * from st2 where f1 between 2 and 3 and f2 between 2.0 and 3.0 and f3
if $rows != 2 then
return -1
endi
if $data01 != 2 then
if $data01 != 2 then
return -1
endi
if $data11 != 3 then
if $data11 != 3 then
return -1
endi
......
......@@ -12,7 +12,7 @@ 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
######## case 0: bigint
print ========== bigint
print ========== bigint
sql create table mt_bigint (ts timestamp, c bigint) tags (tagname bigint)
## case 00: static create table for test tag values
......@@ -86,7 +86,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_bigint_1 values (now, NULL)
sql select * from st_bigint_1
if $rows != 1 then
......@@ -94,7 +94,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_bigint_6 values (now, 9223372036854775807)
sql select * from st_bigint_6
......@@ -103,7 +103,7 @@ if $rows != 1 then
endi
if $data01 != 9223372036854775807 then
return -1
endi
endi
sql insert into st_bigint_7 values (now, -9223372036854775807)
sql select * from st_bigint_7
if $rows != 1 then
......@@ -111,15 +111,15 @@ if $rows != 1 then
endi
if $data01 != -9223372036854775807 then
return -1
endi
sql insert into st_bigint_8 values (now, +100)
endi
sql insert into st_bigint_8 values (now, +100)
sql select * from st_bigint_8
if $rows != 1 then
return -1
endi
if $data01 != 100 then
return -1
endi
endi
sql insert into st_bigint_9 values (now, "-098")
sql select * from st_bigint_9
if $rows != 1 then
......@@ -127,7 +127,7 @@ if $rows != 1 then
endi
if $data01 != -98 then
return -1
endi
endi
sql insert into st_bigint_10 values (now, '0')
sql select * from st_bigint_10
if $rows != 1 then
......@@ -135,15 +135,15 @@ if $rows != 1 then
endi
if $data01 != 0 then
return -1
endi
sql insert into st_bigint_11 values (now, -0)
endi
sql insert into st_bigint_11 values (now, -0)
sql select * from st_bigint_11
if $rows != 1 then
return -1
endi
if $data01 != 0 then
return -1
endi
endi
sql insert into st_bigint_12 values (now, "+056")
sql select * from st_bigint_12
if $rows != 1 then
......@@ -151,7 +151,7 @@ if $rows != 1 then
endi
if $data01 != 56 then
return -1
endi
endi
sql insert into st_bigint_13 values (now, +056)
sql select * from st_bigint_13
......@@ -160,7 +160,7 @@ if $rows != 1 then
endi
if $data01 != 56 then
return -1
endi
endi
sql insert into st_bigint_14 values (now, -056)
sql select * from st_bigint_14
......@@ -169,7 +169,7 @@ if $rows != 1 then
endi
if $data01 != -56 then
return -1
endi
endi
## case 02: dynamic create table for test tag values
sql insert into st_bigint_16 using mt_bigint tags (NULL) values (now, NULL)
......@@ -181,7 +181,7 @@ sql select * from st_bigint_16
if $data01 != NULL then
return -1
endi
sql insert into st_bigint_17 using mt_bigint tags (NULL) values (now, NULL)
sql show tags from st_bigint_17
if $data05 != NULL then
......@@ -190,7 +190,7 @@ endi
sql select * from st_bigint_17
if $data01 != NULL then
return -1
endi
endi
sql insert into st_bigint_18 using mt_bigint tags ('NULL') values (now, 'NULL')
sql show tags from st_bigint_18
if $data05 != NULL then
......@@ -235,7 +235,7 @@ endi
sql select * from st_bigint_22
if $data01 != 9223372036854775807 then
return -1
endi
endi
sql insert into st_bigint_23 using mt_bigint tags (-9223372036854775807) values (now, -9223372036854775807)
sql show tags from st_bigint_23
if $data05 != -9223372036854775807 then
......@@ -244,7 +244,7 @@ endi
sql select * from st_bigint_23
if $data01 != -9223372036854775807 then
return -1
endi
endi
sql insert into st_bigint_24 using mt_bigint tags (10) values (now, 10)
sql show tags from st_bigint_24
if $data05 != 10 then
......@@ -253,7 +253,7 @@ endi
sql select * from st_bigint_24
if $data01 != 10 then
return -1
endi
endi
sql insert into st_bigint_25 using mt_bigint tags ("-0") values (now, "-0")
sql show tags from st_bigint_25
if $data05 != 0 then
......@@ -262,7 +262,7 @@ endi
sql select * from st_bigint_25
if $data01 != 0 then
return -1
endi
endi
sql insert into st_bigint_26 using mt_bigint tags ('123') values (now, '123')
sql show tags from st_bigint_26
if $data05 != 123 then
......@@ -271,7 +271,7 @@ endi
sql select * from st_bigint_26
if $data01 != 123 then
return -1
endi
endi
sql insert into st_bigint_27 using mt_bigint tags (+056) values (now, +00056)
sql show tags from st_bigint_27
if $data05 != 56 then
......@@ -280,7 +280,7 @@ endi
sql select * from st_bigint_27
if $data01 != 56 then
return -1
endi
endi
sql insert into st_bigint_28 using mt_bigint tags (-056) values (now, -0056)
sql show tags from st_bigint_28
if $data05 != -56 then
......@@ -289,7 +289,7 @@ endi
sql select * from st_bigint_28
if $data01 != -56 then
return -1
endi
endi
### case 03: alter tag values
#sql alter table st_bigint_0 set tag tagname=9223372036854775807
......@@ -341,12 +341,12 @@ 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
#sql_error create table st_bigint_e0 using mt_bigint tags (-11.80)
sql_error create table st_bigint_e0 using mt_bigint tags (123abc)
sql_error create table st_bigint_e0 using mt_bigint tags (123abc)
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 create table st_bigint_e0_error using mt_bigint tags ('')
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 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)
......@@ -362,31 +362,31 @@ sql create table st_bigint_e10 using mt_bigint tags (123)
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 insert into st_bigint_e1 values (now, -9223372036854775808)
sql_error insert into st_bigint_e2 values (now, 9223372036854775809)
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)
sql_error insert into st_bigint_e0 values (now, 9223372036854775808)
sql insert into st_bigint_e1 values (now, -9223372036854775808)
sql_error insert into st_bigint_e2 values (now, 9223372036854775809)
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)
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 insert into st_bigint_e12 values (now, '')
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 insert into st_bigint_e12 values (now, '')
sql_error insert into st_bigint_e13 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)
#sql_error insert into st_bigint_e18 using mt_bigint tags (033) values (now, -92233720368547.75808)
sql_error insert into st_bigint_e19 using mt_bigint tags (033) values (now, 123abc)
sql_error insert into st_bigint_e13 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)
#sql_error insert into st_bigint_e18 using mt_bigint tags (033) values (now, -92233720368547.75808)
sql_error insert into st_bigint_e19 using mt_bigint tags (033) values (now, 123abc)
sql_error insert into st_bigint_e20 using mt_bigint tags (033) values (now, "123abc")
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 insert into st_bigint_e25 using mt_bigint tags (033) values (now, '')
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 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 insert into st_bigint_e14_0 using mt_bigint tags (-9223372036854775808) values (now, -033)
......@@ -426,4 +426,4 @@ sql insert into st_bigint_e25 using mt_bigint tags (033) values (now, 00062)
#sql_error alter table st_bigint_e24 set tag tagname=" "
#sql_error alter table st_bigint_e25 set tag tagname=''
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -12,7 +12,7 @@ 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
######## case 0: bool
print ========== bool
print ========== bool
sql create table mt_bool (ts timestamp, c bool) tags (tagname bool)
## case 00: static create table for test tag values
......@@ -134,7 +134,7 @@ endi
if $data01 != NULL then
print ==17== expect: NULL, actually: $data01
return -1
endi
endi
sql insert into st_bool_1 values (now, NULL)
sql select * from st_bool_1
if $rows != 1 then
......@@ -143,7 +143,7 @@ endi
if $data01 != NULL then
print ==18== expect: NULL, actually: $data01
return -1
endi
endi
sql insert into st_bool_2 values (now, 'NULL')
sql select * from st_bool_2
if $rows != 1 then
......@@ -188,7 +188,7 @@ endi
if $data01 != 1 then
print ==23== expect: 1, actually: $data01
return -1
endi
endi
sql insert into st_bool_7 values (now, 'true')
sql select * from st_bool_7
if $rows != 1 then
......@@ -197,8 +197,8 @@ endi
if $data01 != 1 then
print ==24== expect: 1, actually: $data01
return -1
endi
sql insert into st_bool_8 values (now, true)
endi
sql insert into st_bool_8 values (now, true)
sql select * from st_bool_8
if $rows != 1 then
return -1
......@@ -206,7 +206,7 @@ endi
if $data01 != 1 then
print ==25== expect: 1, actually: $data01
return -1
endi
endi
sql insert into st_bool_9 values (now, "false")
sql select * from st_bool_9
if $rows != 1 then
......@@ -215,7 +215,7 @@ endi
if $data01 != 0 then
print ==26== expect: false, actually: $data01
return -1
endi
endi
sql insert into st_bool_10 values (now, 'false')
sql select * from st_bool_10
if $rows != 1 then
......@@ -224,8 +224,8 @@ endi
if $data01 != 0 then
print ==27== expect: false, actually: $data01
return -1
endi
sql insert into st_bool_11 values (now, false)
endi
sql insert into st_bool_11 values (now, false)
sql select * from st_bool_11
if $rows != 1 then
return -1
......@@ -233,7 +233,7 @@ endi
if $data01 != 0 then
print ==28== expect: false, actually: $data01
return -1
endi
endi
sql insert into st_bool_12 values (now, 0)
sql select * from st_bool_12
if $rows != 1 then
......@@ -242,7 +242,7 @@ endi
if $data01 != 0 then
print ==29== expect: false, actually: $data01
return -1
endi
endi
sql insert into st_bool_13 values (now, 1)
sql select * from st_bool_13
if $rows != 1 then
......@@ -251,7 +251,7 @@ endi
if $data01 != 1 then
print ==30== expect: 1, actually: $data01
return -1
endi
endi
sql insert into st_bool_14 values (now, 6.9)
sql select * from st_bool_14
if $rows != 1 then
......@@ -260,8 +260,8 @@ endi
if $data01 != 1 then
print ==31== expect: 1, actually: $data01
return -1
endi
sql insert into st_bool_15 values (now, -3)
endi
sql insert into st_bool_15 values (now, -3)
sql select * from st_bool_15
if $rows != 1 then
return -1
......@@ -269,8 +269,8 @@ endi
if $data01 != 1 then
print ==32== expect: true, actually: $data01
return -1
endi
sql insert into st_bool_15_0 values (now, +300)
endi
sql insert into st_bool_15_0 values (now, +300)
sql select * from st_bool_15_0
if $rows != 1 then
return -1
......@@ -278,8 +278,8 @@ endi
if $data01 != 1 then
print ==32== expect: true, actually: $data01
return -1
endi
sql insert into st_bool_15_1 values (now, -3.15)
endi
sql insert into st_bool_15_1 values (now, -3.15)
sql select * from st_bool_15_1
if $rows != 1 then
return -1
......@@ -287,7 +287,7 @@ endi
if $data01 != 1 then
print ==32== expect: true, actually: $data01
return -1
endi
endi
## case 02: dynamic create table for test tag values
sql insert into st_bool_16 using mt_bool tags (NULL) values (now, NULL)
......@@ -301,7 +301,7 @@ if $data01 != NULL then
print ==34== expect: NULL, actually: $data01
return -1
endi
sql insert into st_bool_17 using mt_bool tags (NULL) values (now, NULL)
sql show tags from st_bool_17
if $data05 != NULL then
......@@ -312,7 +312,7 @@ sql select * from st_bool_17
if $data01 != NULL then
print ==36== expect: NULL, actually: $data01
return -1
endi
endi
sql insert into st_bool_18 using mt_bool tags ('NULL') values (now, 'NULL')
sql show tags from st_bool_18
if $data05 != NULL then
......@@ -367,7 +367,7 @@ sql select * from st_bool_22
if $data01 != 1 then
print ==46== expect: 1, actually: $data01
return -1
endi
endi
sql insert into st_bool_23 using mt_bool tags ('true') values (now, 'true')
sql show tags from st_bool_23
if $data05 != true then
......@@ -378,7 +378,7 @@ sql select * from st_bool_23
if $data01 != 1 then
print ==48== expect: 1, actually: $data01
return -1
endi
endi
sql insert into st_bool_24 using mt_bool tags (true) values (now, true)
sql show tags from st_bool_24
if $data05 != true then
......@@ -389,7 +389,7 @@ sql select * from st_bool_24
if $data01 != 1 then
print ==50== expect: 1, actually: $data01
return -1
endi
endi
sql insert into st_bool_25 using mt_bool tags ("false") values (now, "false")
sql show tags from st_bool_25
if $data05 != false then
......@@ -400,7 +400,7 @@ sql select * from st_bool_25
if $data01 != 0 then
print ==52== expect: 0, actually: $data01
return -1
endi
endi
sql insert into st_bool_26 using mt_bool tags ('false') values (now, 'false')
sql show tags from st_bool_26
if $data05 != false then
......@@ -411,7 +411,7 @@ sql select * from st_bool_26
if $data01 != 0 then
print ==54== expect: 0, actually: $data01
return -1
endi
endi
sql insert into st_bool_27 using mt_bool tags (false) values (now, false)
sql show tags from st_bool_27
if $data05 != false then
......@@ -422,7 +422,7 @@ sql select * from st_bool_27
if $data01 != 0 then
print ==56== expect: 0, actually: $data01
return -1
endi
endi
sql insert into st_bool_28 using mt_bool tags (0) values (now, 0)
sql show tags from st_bool_28
if $data05 != false then
......@@ -433,8 +433,8 @@ sql select * from st_bool_28
if $data01 != 0 then
print ==58== expect: 0, actually: $data01
return -1
endi
sql insert into st_bool_29 using mt_bool tags (1) values (now, 1)
endi
sql insert into st_bool_29 using mt_bool tags (1) values (now, 1)
sql show tags from st_bool_29
if $data05 != true then
print ==59== expect: 1, actually: $data00
......@@ -444,7 +444,7 @@ sql select * from st_bool_29
if $data01 != 1 then
print ==60== expect: 1, actually: $data01
return -1
endi
endi
sql insert into st_bool_30 using mt_bool tags (6.9) values (now, 6.9)
sql show tags from st_bool_30
if $data05 != true then
......@@ -455,7 +455,7 @@ sql select * from st_bool_30
if $data01 != 1 then
print ==62== expect: 1, actually: $data01
return -1
endi
endi
sql insert into st_bool_31 using mt_bool tags (-3) values (now, -3)
sql show tags from st_bool_31
if $data05 != true then
......@@ -466,7 +466,7 @@ sql select * from st_bool_31
if $data01 != 1 then
print ==64== expect: 1, actually: $data01
return -1
endi
endi
sql insert into st_bool_32 using mt_bool tags (+300) values (now, +300)
sql show tags from st_bool_32
if $data05 != true then
......@@ -477,7 +477,7 @@ sql select * from st_bool_32
if $data01 != 1 then
print ==64== expect: 1, actually: $data01
return -1
endi
endi
sql insert into st_bool_33 using mt_bool tags (+30.890) values (now, +30.890)
sql show tags from st_bool_33
if $data05 != true then
......@@ -488,7 +488,7 @@ sql select * from st_bool_33
if $data01 != 1 then
print ==64== expect: 1, actually: $data01
return -1
endi
endi
......@@ -610,13 +610,13 @@ 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_h0 using mt_bool tags (1) values (now, 123abc)
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_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_i0 using mt_bool tags (1) values (now, 1)
sql insert into st_bool_i1 using mt_bool tags (1) values (now, 1)
......@@ -626,12 +626,12 @@ 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_i0 set tag tagname=123abc
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=''
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/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -12,7 +12,7 @@ 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
######## case 0: double
print ========== double
print ========== double
sql create table mt_double (ts timestamp, c double) tags (tagname double)
## case 00: static create table for test tag values
......@@ -157,7 +157,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_double_1 values (now, NULL)
sql select * from st_double_1
if $rows != 1 then
......@@ -165,7 +165,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_double_2 values (now, 'NULL')
sql select * from st_double_2
if $rows != 1 then
......@@ -204,10 +204,10 @@ sql select * from st_double_6
if $rows != 1 then
return -1
endi
#if $data01 != 340282346638528859811704183484516925440.00000 then
#if $data01 != 340282346638528859811704183484516925440.00000 then
# print ==== data01:$data01, expect:340282346638528859811704183484516925440.00000
# return -1
#endi
#endi
sql insert into st_double_7 values (now, -1.7976931348623157e+308)
sql select * from st_double_7
if $rows != 1 then
......@@ -215,15 +215,15 @@ if $rows != 1 then
endi
#if $data01 != -340282346638528859811704183484516925440.00000 then
# return -1
#endi
sql insert into st_double_8 values (now, +100.89)
#endi
sql insert into st_double_8 values (now, +100.89)
sql select * from st_double_8
if $rows != 1 then
return -1
endi
#if $data01 != 100.89000000 then
# return -1
#endi
#endi
sql insert into st_double_9 values (now, "-0.98")
sql select * from st_double_9
if $rows != 1 then
......@@ -231,7 +231,7 @@ if $rows != 1 then
endi
#if $data01 != -0.980000000 then
# return -1
#endi
#endi
sql insert into st_double_10 values (now, '0')
sql select * from st_double_10
if $rows != 1 then
......@@ -239,15 +239,15 @@ if $rows != 1 then
endi
#if $data01 != 0.00000000 then # tsim only print 4 bits after dot
# return -1
#endi
sql insert into st_double_11 values (now, -0)
#endi
sql insert into st_double_11 values (now, -0)
sql select * from st_double_11
if $rows != 1 then
return -1
endi
#if $data01 != 0.000000000 then
# return -1
#endi
#endi
sql insert into st_double_12 values (now, "+056")
sql select * from st_double_12
if $rows != 1 then
......@@ -255,7 +255,7 @@ if $rows != 1 then
endi
#if $data01 != 56.000000 then
# return -1
#endi
#endi
sql insert into st_double_13 values (now, +056)
sql select * from st_double_13
......@@ -264,7 +264,7 @@ if $rows != 1 then
endi
#if $data01 != 56.000000000 then
# return -1
#endi
#endi
sql insert into st_double_14 values (now, -056)
sql select * from st_double_14
......@@ -273,7 +273,7 @@ if $rows != 1 then
endi
#if $data01 != -56 then
# return -1
#endi
#endi
## case 02: dynamic create table for test tag values
sql insert into st_double_16 using mt_double tags (NULL ) values (now, NULL )
......@@ -285,7 +285,7 @@ sql select * from st_double_16
if $data01 != NULL then
return -1
endi
sql insert into st_double_17 using mt_double tags (NULL) values (now, NULL)
sql show tags from st_double_17
if $data05 != NULL then
......@@ -294,7 +294,7 @@ endi
sql select * from st_double_17
if $data01 != NULL then
return -1
endi
endi
sql insert into st_double_18 using mt_double tags ('NULL') values (now, 'NULL')
sql show tags from st_double_18
if $data05 != NULL then
......@@ -339,7 +339,7 @@ sql show tags from st_double_22
sql select * from st_double_22
#if $data01 != 127 then
# return -1
#endi
#endi
sql insert into st_double_23 using mt_double tags (-127) values (now, -1.7976931348623157e+308)
sql show tags from st_double_23
#if $data05 != -127 then
......@@ -348,7 +348,7 @@ sql show tags from st_double_23
sql select * from st_double_23
#if $data01 != -127 then
# return -1
#endi
#endi
sql insert into st_double_24 using mt_double tags (10) values (now, 10)
sql show tags from st_double_24
#if $data05 != 10 then
......@@ -357,7 +357,7 @@ sql show tags from st_double_24
sql select * from st_double_24
#if $data01 != 10 then
# return -1
#endi
#endi
sql insert into st_double_25 using mt_double tags ("-0") values (now, "-0")
sql show tags from st_double_25
#if $data05 != 0 then
......@@ -366,7 +366,7 @@ sql show tags from st_double_25
sql select * from st_double_25
#if $data01 != 0 then
# return -1
#endi
#endi
sql insert into st_double_26 using mt_double tags ('123') values (now, '12.3')
sql show tags from st_double_26
#if $data05 != 123 then
......@@ -375,7 +375,7 @@ sql show tags from st_double_26
sql select * from st_double_26
#if $data01 != 123 then
# return -1
#endi
#endi
sql insert into st_double_27 using mt_double tags (+056) values (now, +0005.6)
sql show tags from st_double_27
#if $data05 != 56 then
......@@ -384,7 +384,7 @@ sql show tags from st_double_27
sql select * from st_double_27
#if $data01 != 56 then
# return -1
#endi
#endi
sql insert into st_double_28 using mt_double tags (-056) values (now, -005.6)
sql show tags from st_double_28
#if $data05 != -56 then
......@@ -393,7 +393,7 @@ sql show tags from st_double_28
sql select * from st_double_28
#if $data01 != -56 then
# return -1
#endi
#endi
### case 03: alter tag values
#sql alter table st_double_0 set tag tagname=1.7976931348623157e+308
......@@ -444,12 +444,12 @@ sql_error create table st_double_e0 using mt_double tags (31.7976931348623157e+3
sql_error create table st_double_e0 using mt_double tags (-31.7976931348623157e+308)
#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 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_error create table st_double_e0 using mt_double tags (abc)
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)
......@@ -465,31 +465,31 @@ sql create table st_double_e10 using mt_double tags (123)
sql create table st_double_e11 using mt_double tags (123)
sql create table st_double_e12 using mt_double tags (123)
sql_error insert into st_double_e0 values (now, 11.7976931348623157e+308)
sql_error insert into st_double_e1 values (now, -11.7976931348623157e+308)
sql_error insert into st_double_e2 values (now, 111.7976931348623157e+308)
sql_error insert into st_double_e3 values (now, -111.7976931348623157e+308)
#sql_error insert into st_double_e4 values (now, 12.80)
#sql_error insert into st_double_e5 values (now, -11.80)
sql_error insert into st_double_e6 values (now, 123abc)
sql_error insert into st_double_e0 values (now, 11.7976931348623157e+308)
sql_error insert into st_double_e1 values (now, -11.7976931348623157e+308)
sql_error insert into st_double_e2 values (now, 111.7976931348623157e+308)
sql_error insert into st_double_e3 values (now, -111.7976931348623157e+308)
#sql_error insert into st_double_e4 values (now, 12.80)
#sql_error insert into st_double_e5 values (now, -11.80)
sql_error insert into st_double_e6 values (now, 123abc)
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 insert into st_double_e12 values (now, '')
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 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)
sql_error insert into st_double_e15 using mt_double tags (033) values (now, 131.7976931348623157e+308)
sql_error insert into st_double_e16 using mt_double tags (033) values (now, -131.7976931348623157e+308)
#sql_error insert into st_double_e17 using mt_double tags (033) values (now, 12.80)
#sql_error insert into st_double_e18 using mt_double tags (033) values (now, -11.80)
sql_error insert into st_double_e19 using mt_double tags (033) values (now, 123abc)
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)
sql_error insert into st_double_e15 using mt_double tags (033) values (now, 131.7976931348623157e+308)
sql_error insert into st_double_e16 using mt_double tags (033) values (now, -131.7976931348623157e+308)
#sql_error insert into st_double_e17 using mt_double tags (033) values (now, 12.80)
#sql_error insert into st_double_e18 using mt_double tags (033) values (now, -11.80)
sql_error insert into st_double_e19 using mt_double tags (033) values (now, 123abc)
sql_error insert into st_double_e20 using mt_double tags (033) values (now, "123abc")
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 insert into st_double_e25_1 using mt_double tags (033) values (now, '')
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 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)
......@@ -518,15 +518,15 @@ sql insert into st_double_e23 using mt_double tags (033) values (now, 00062)
sql insert into st_double_e24 using mt_double tags (033) values (now, 00062)
sql insert into st_double_e25 using mt_double tags (033) values (now, 00062)
sql_error alter table st_double_e13 set tag tagname=1.8976931348623157e+308
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 alter table st_double_e20 set tag tagname="123abc"
sql_error alter table st_double_e22 set tag tagname=abc
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=''
sql_error alter table st_double_e13 set tag tagname=1.8976931348623157e+308
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 alter table st_double_e20 set tag tagname="123abc"
sql_error alter table st_double_e22 set tag tagname=abc
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/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -12,7 +12,7 @@ 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
######## case 0: float
print ========== float
print ========== float
sql create table mt_float (ts timestamp, c float) tags (tagname float)
## case 00: static create table for test tag values
......@@ -174,7 +174,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_float_1 values (now, NULL)
sql select * from st_float_1
if $rows != 1 then
......@@ -182,7 +182,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_float_2 values (now, 'NULL')
sql select * from st_float_2
if $rows != 1 then
......@@ -238,14 +238,14 @@ if $data01 != -340282346638528859811704183484516925440.00000 then
return -1
endi
sql insert into st_float_8 values (now, +100.89)
sql insert into st_float_8 values (now, +100.89)
sql select * from st_float_8
if $rows != 1 then
return -1
endi
#if $data01 != 100.89000 then
# return -1
#endi
#endi
sql insert into st_float_9 values (now, "-0.98")
sql select * from st_float_9
if $rows != 1 then
......@@ -253,7 +253,7 @@ if $rows != 1 then
endi
#if $data01 != -0.980000 then
# return -1
#endi
#endi
sql insert into st_float_10 values (now, '0')
sql select * from st_float_10
if $rows != 1 then
......@@ -261,15 +261,15 @@ if $rows != 1 then
endi
#if $data01 != 0.00000 then # tsim only print 4 bits after dot
# return -1
#endi
sql insert into st_float_11 values (now, -0)
#endi
sql insert into st_float_11 values (now, -0)
sql select * from st_float_11
if $rows != 1 then
return -1
endi
#if $data01 != 0.00000 then
# return -1
#endi
#endi
sql insert into st_float_12 values (now, "+056")
sql select * from st_float_12
if $rows != 1 then
......@@ -277,7 +277,7 @@ if $rows != 1 then
endi
#if $data01 != 56.000000 then
# return -1
#endi
#endi
sql insert into st_float_13 values (now, +056)
sql select * from st_float_13
......@@ -286,7 +286,7 @@ if $rows != 1 then
endi
#if $data01 != 56.000000 then
# return -1
#endi
#endi
sql insert into st_float_14 values (now, -056)
sql select * from st_float_14
......@@ -295,7 +295,7 @@ if $rows != 1 then
endi
#if $data01 != -56 then
# return -1
#endi
#endi
## case 02: dynamic create table for test tag values
sql insert into st_float_16 using mt_float tags (NULL) values (now, NULL)
......@@ -307,7 +307,7 @@ sql select * from st_float_16
if $data01 != NULL then
return -1
endi
sql insert into st_float_17 using mt_float tags (NULL) values (now, NULL)
sql show tags from st_float_17
if $data05 != NULL then
......@@ -316,7 +316,7 @@ endi
sql select * from st_float_17
if $data01 != NULL then
return -1
endi
endi
sql insert into st_float_18 using mt_float tags ('NULL') values (now, 'NULL')
sql show tags from st_float_18
if $data05 != NULL then
......@@ -474,12 +474,12 @@ 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 (-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 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_error create table st_float_e0 using mt_float tags (abc)
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)
......@@ -495,31 +495,31 @@ sql create table st_float_e10 using mt_float tags (123)
sql create table st_float_e11 using mt_float tags (123)
sql create table st_float_e12 using mt_float tags (123)
sql_error insert into st_float_e0 values (now, 3.50282347e+38)
sql_error insert into st_float_e1 values (now, -3.50282347e+38)
sql_error insert into st_float_e2 values (now, 13.40282347e+38)
sql_error insert into st_float_e3 values (now, -13.40282347e+38)
#sql_error insert into st_float_e4 values (now, 12.80)
#sql_error insert into st_float_e5 values (now, -11.80)
sql_error insert into st_float_e6 values (now, 123abc)
sql_error insert into st_float_e0 values (now, 3.50282347e+38)
sql_error insert into st_float_e1 values (now, -3.50282347e+38)
sql_error insert into st_float_e2 values (now, 13.40282347e+38)
sql_error insert into st_float_e3 values (now, -13.40282347e+38)
#sql_error insert into st_float_e4 values (now, 12.80)
#sql_error insert into st_float_e5 values (now, -11.80)
sql_error insert into st_float_e6 values (now, 123abc)
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 insert into st_float_e12 values (now, '')
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 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)
sql_error insert into st_float_e15 using mt_float tags (033) values (now, 13.40282347e+38)
sql_error insert into st_float_e16 using mt_float tags (033) values (now, -13.40282347e+38)
#sql_error insert into st_float_e17 using mt_float tags (033) values (now, 12.80)
#sql_error insert into st_float_e18 using mt_float tags (033) values (now, -11.80)
sql_error insert into st_float_e19 using mt_float tags (033) values (now, 123abc)
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)
sql_error insert into st_float_e15 using mt_float tags (033) values (now, 13.40282347e+38)
sql_error insert into st_float_e16 using mt_float tags (033) values (now, -13.40282347e+38)
#sql_error insert into st_float_e17 using mt_float tags (033) values (now, 12.80)
#sql_error insert into st_float_e18 using mt_float tags (033) values (now, -11.80)
sql_error insert into st_float_e19 using mt_float tags (033) values (now, 123abc)
sql_error insert into st_float_e20 using mt_float tags (033) values (now, "123abc")
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 insert into st_float_e25_1 using mt_float tags (033) values (now, '')
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 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)
......@@ -548,15 +548,15 @@ sql insert into st_float_e23 using mt_float tags (033) values (now, 00062)
sql insert into st_float_e24 using mt_float tags (033) values (now, 00062)
sql insert into st_float_e25 using mt_float tags (033) values (now, 00062)
sql_error alter table st_float_e13 set tag tagname=3.50282347e+38
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 alter table st_float_e20 set tag tagname="123abc"
sql_error alter table st_float_e22 set tag tagname=abc
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=''
sql_error alter table st_float_e13 set tag tagname=3.50282347e+38
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 alter table st_float_e20 set tag tagname="123abc"
sql_error alter table st_float_e22 set tag tagname=abc
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/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -12,7 +12,7 @@ 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
######## case 0: int
print ========== int
print ========== int
sql create table mt_int (ts timestamp, c int) tags (tagname int)
## case 00: static create table for test tag values
......@@ -86,7 +86,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_int_1 values (now, NULL)
sql select * from st_int_1
if $rows != 1 then
......@@ -94,7 +94,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_int_6 values (now, 2147483647)
sql select * from st_int_6
if $rows != 1 then
......@@ -102,7 +102,7 @@ if $rows != 1 then
endi
if $data01 != 2147483647 then
return -1
endi
endi
sql insert into st_int_7 values (now, -2147483647)
sql select * from st_int_7
if $rows != 1 then
......@@ -110,15 +110,15 @@ if $rows != 1 then
endi
if $data01 != -2147483647 then
return -1
endi
sql insert into st_int_8 values (now, +100)
endi
sql insert into st_int_8 values (now, +100)
sql select * from st_int_8
if $rows != 1 then
return -1
endi
if $data01 != 100 then
return -1
endi
endi
sql insert into st_int_9 values (now, "-098")
sql select * from st_int_9
if $rows != 1 then
......@@ -126,7 +126,7 @@ if $rows != 1 then
endi
if $data01 != -98 then
return -1
endi
endi
sql insert into st_int_10 values (now, '0')
sql select * from st_int_10
if $rows != 1 then
......@@ -134,15 +134,15 @@ if $rows != 1 then
endi
if $data01 != 0 then
return -1
endi
sql insert into st_int_11 values (now, -0)
endi
sql insert into st_int_11 values (now, -0)
sql select * from st_int_11
if $rows != 1 then
return -1
endi
if $data01 != 0 then
return -1
endi
endi
sql insert into st_int_12 values (now, "+056")
sql select * from st_int_12
if $rows != 1 then
......@@ -150,7 +150,7 @@ if $rows != 1 then
endi
if $data01 != 56 then
return -1
endi
endi
sql insert into st_int_13 values (now, +056)
sql select * from st_int_13
......@@ -159,7 +159,7 @@ if $rows != 1 then
endi
if $data01 != 56 then
return -1
endi
endi
sql insert into st_int_14 values (now, -056)
sql select * from st_int_14
......@@ -168,7 +168,7 @@ if $rows != 1 then
endi
if $data01 != -56 then
return -1
endi
endi
## case 02: dynamic create table for test tag values
sql insert into st_int_16 using mt_int tags (NULL) values (now, NULL)
......@@ -180,7 +180,7 @@ sql select * from st_int_16
if $data01 != NULL then
return -1
endi
sql insert into st_int_17 using mt_int tags (NULL) values (now, NULL)
sql show tags from st_int_17
if $data05 != NULL then
......@@ -189,7 +189,7 @@ endi
sql select * from st_int_17
if $data01 != NULL then
return -1
endi
endi
sql insert into st_int_18 using mt_int tags ('NULL') values (now, 'NULL')
sql show tags from st_int_18
if $data05 != NULL then
......@@ -234,7 +234,7 @@ endi
sql select * from st_int_22
if $data01 != 2147483647 then
return -1
endi
endi
sql insert into st_int_23 using mt_int tags (-2147483647) values (now, -2147483647)
sql show tags from st_int_23
if $data05 != -2147483647 then
......@@ -243,7 +243,7 @@ endi
sql select * from st_int_23
if $data01 != -2147483647 then
return -1
endi
endi
sql insert into st_int_24 using mt_int tags (10) values (now, 10)
sql show tags from st_int_24
if $data05 != 10 then
......@@ -252,7 +252,7 @@ endi
sql select * from st_int_24
if $data01 != 10 then
return -1
endi
endi
sql insert into st_int_25 using mt_int tags ("-0") values (now, "-0")
sql show tags from st_int_25
if $data05 != 0 then
......@@ -261,7 +261,7 @@ endi
sql select * from st_int_25
if $data01 != 0 then
return -1
endi
endi
sql insert into st_int_26 using mt_int tags ('123') values (now, '123')
sql show tags from st_int_26
if $data05 != 123 then
......@@ -270,7 +270,7 @@ endi
sql select * from st_int_26
if $data01 != 123 then
return -1
endi
endi
sql insert into st_int_27 using mt_int tags (+056) values (now, +00056)
sql show tags from st_int_27
if $data05 != 56 then
......@@ -279,7 +279,7 @@ endi
sql select * from st_int_27
if $data01 != 56 then
return -1
endi
endi
sql insert into st_int_28 using mt_int tags (-056) values (now, -0056)
sql show tags from st_int_28
if $data05 != -56 then
......@@ -288,7 +288,7 @@ endi
sql select * from st_int_28
if $data01 != -56 then
return -1
endi
endi
### case 03: alter tag values
#sql alter table st_int_0 set tag tagname=2147483647
......@@ -339,12 +339,12 @@ 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
#sql_error create table st_int_e0 using mt_int tags (-11.80)
sql_error create table st_int_e0 using mt_int tags (123abc)
sql_error create table st_int_e0 using mt_int tags (123abc)
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 create table st_int_e0_err2 using mt_int tags ('')
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 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)
......@@ -360,31 +360,31 @@ sql create table st_int_e10 using mt_int tags (123)
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 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)
#sql_error insert into st_int_e5 values (now, -11.80)
sql_error insert into st_int_e6 values (now, 123abc)
sql_error insert into st_int_e0 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)
#sql_error insert into st_int_e5 values (now, -11.80)
sql_error insert into st_int_e6 values (now, 123abc)
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 insert into st_int_e12 values (now, '')
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 insert into st_int_e12 values (now, '')
sql_error insert into st_int_e13 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)
#sql_error insert into st_int_e18 using mt_int tags (033) values (now, -11.80)
sql_error insert into st_int_e19 using mt_int tags (033) values (now, 123abc)
sql_error insert into st_int_e13 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)
#sql_error insert into st_int_e18 using mt_int tags (033) values (now, -11.80)
sql_error insert into st_int_e19 using mt_int tags (033) values (now, 123abc)
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 insert into st_int_e25 using mt_int tags (033) values (now, '')
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 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 insert into st_int_e14_1 using mt_int tags (-2147483648) values (now, -033)
......@@ -413,15 +413,15 @@ sql insert into st_int_e23 using mt_int tags (033) values (now, 00062)
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 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_e13 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
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 alter table st_int_e25 set tag tagname=''
sql_error alter table st_int_e19 set tag tagname=123abc
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 alter table st_int_e25 set tag tagname=''
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -15,7 +15,7 @@ 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
print ========== smallint
print ========== smallint
sql create table mt_smallint (ts timestamp, c smallint) tags (tagname smallint)
## case 00: static create table for test tag values
......@@ -89,7 +89,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_smallint_1 values (now, NULL)
sql select * from st_smallint_1
if $rows != 1 then
......@@ -97,7 +97,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_smallint_6 values (now, 32767)
sql select * from st_smallint_6
if $rows != 1 then
......@@ -105,7 +105,7 @@ if $rows != 1 then
endi
if $data01 != 32767 then
return -1
endi
endi
sql insert into st_smallint_7 values (now, -32767)
sql select * from st_smallint_7
if $rows != 1 then
......@@ -113,15 +113,15 @@ if $rows != 1 then
endi
if $data01 != -32767 then
return -1
endi
sql insert into st_smallint_8 values (now, +100)
endi
sql insert into st_smallint_8 values (now, +100)
sql select * from st_smallint_8
if $rows != 1 then
return -1
endi
if $data01 != 100 then
return -1
endi
endi
sql insert into st_smallint_9 values (now, "-098")
sql select * from st_smallint_9
if $rows != 1 then
......@@ -129,7 +129,7 @@ if $rows != 1 then
endi
if $data01 != -98 then
return -1
endi
endi
sql insert into st_smallint_10 values (now, '0')
sql select * from st_smallint_10
if $rows != 1 then
......@@ -137,15 +137,15 @@ if $rows != 1 then
endi
if $data01 != 0 then
return -1
endi
sql insert into st_smallint_11 values (now, -0)
endi
sql insert into st_smallint_11 values (now, -0)
sql select * from st_smallint_11
if $rows != 1 then
return -1
endi
if $data01 != 0 then
return -1
endi
endi
sql insert into st_smallint_12 values (now, "+056")
sql select * from st_smallint_12
if $rows != 1 then
......@@ -153,7 +153,7 @@ if $rows != 1 then
endi
if $data01 != 56 then
return -1
endi
endi
sql insert into st_smallint_13 values (now, +056)
sql select * from st_smallint_13
......@@ -162,7 +162,7 @@ if $rows != 1 then
endi
if $data01 != 56 then
return -1
endi
endi
sql insert into st_smallint_14 values (now, -056)
sql select * from st_smallint_14
......@@ -171,7 +171,7 @@ if $rows != 1 then
endi
if $data01 != -56 then
return -1
endi
endi
## case 02: dynamic create table for test tag values
sql insert into st_smallint_16 using mt_smallint tags (NULL) values (now, NULL)
......@@ -183,7 +183,7 @@ sql select * from st_smallint_16
if $data01 != NULL then
return -1
endi
sql insert into st_smallint_17 using mt_smallint tags (NULL) values (now, NULL)
sql show tags from st_smallint_17
if $data05 != NULL then
......@@ -192,7 +192,7 @@ endi
sql select * from st_smallint_17
if $data01 != NULL then
return -1
endi
endi
sql insert into st_smallint_18 using mt_smallint tags ('NULL') values (now, 'NULL')
sql show tags from st_smallint_18
if $data05 != NULL then
......@@ -237,7 +237,7 @@ endi
sql select * from st_smallint_22
if $data01 != 32767 then
return -1
endi
endi
sql insert into st_smallint_23 using mt_smallint tags (-32767) values (now, -32767)
sql show tags from st_smallint_23
if $data05 != -32767 then
......@@ -246,7 +246,7 @@ endi
sql select * from st_smallint_23
if $data01 != -32767 then
return -1
endi
endi
sql insert into st_smallint_24 using mt_smallint tags (10) values (now, 10)
sql show tags from st_smallint_24
if $data05 != 10 then
......@@ -255,7 +255,7 @@ endi
sql select * from st_smallint_24
if $data01 != 10 then
return -1
endi
endi
sql insert into st_smallint_25 using mt_smallint tags ("-0") values (now, "-0")
sql show tags from st_smallint_25
if $data05 != 0 then
......@@ -264,7 +264,7 @@ endi
sql select * from st_smallint_25
if $data01 != 0 then
return -1
endi
endi
sql insert into st_smallint_26 using mt_smallint tags ('123') values (now, '123')
sql show tags from st_smallint_26
if $data05 != 123 then
......@@ -273,7 +273,7 @@ endi
sql select * from st_smallint_26
if $data01 != 123 then
return -1
endi
endi
sql insert into st_smallint_27 using mt_smallint tags (+056) values (now, +00056)
sql show tags from st_smallint_27
if $data05 != 56 then
......@@ -282,7 +282,7 @@ endi
sql select * from st_smallint_27
if $data01 != 56 then
return -1
endi
endi
sql insert into st_smallint_28 using mt_smallint tags (-056) values (now, -0056)
sql show tags from st_smallint_28
if $data05 != -56 then
......@@ -291,7 +291,7 @@ endi
sql select * from st_smallint_28
if $data01 != -56 then
return -1
endi
endi
## case 03: alter tag values
#sql alter table st_smallint_0 set tag tagname=32767
......@@ -342,12 +342,12 @@ 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
#sql_error create table st_smallint_e0 using mt_smallint tags (-11.80)
sql_error create table st_smallint_e0 using mt_smallint tags (123abc)
sql_error create table st_smallint_e0 using mt_smallint tags (123abc)
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 create table st_smallint_e0_1 using mt_smallint tags ('')
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 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)
......@@ -363,31 +363,31 @@ sql create table st_smallint_e10 using mt_smallint tags (123)
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 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)
#sql_error insert into st_smallint_e5 values (now, -11.80)
sql_error insert into st_smallint_e6 values (now, 123abc)
sql_error insert into st_smallint_e0 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)
#sql_error insert into st_smallint_e5 values (now, -11.80)
sql_error insert into st_smallint_e6 values (now, 123abc)
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 insert into st_smallint_e12 values (now, '')
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 insert into st_smallint_e12 values (now, '')
sql_error insert into st_smallint_e13 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)
#sql_error insert into st_smallint_e18 using mt_smallint tags (033) values (now, -11.80)
sql_error insert into st_smallint_e19 using mt_smallint tags (033) values (now, 123abc)
sql_error insert into st_smallint_e13 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)
#sql_error insert into st_smallint_e18 using mt_smallint tags (033) values (now, -11.80)
sql_error insert into st_smallint_e19 using mt_smallint tags (033) values (now, 123abc)
sql_error insert into st_smallint_e20 using mt_smallint tags (033) values (now, "123abc")
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 insert into st_smallint_e25_1 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 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 insert into st_smallint_e14 using mt_smallint tags (-32768) values (now, -033)
......@@ -416,15 +416,15 @@ sql insert into st_smallint_e23 using mt_smallint tags (033) values (now, 00062)
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 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
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 alter table st_smallint_e25 set tag tagname=''
sql_error alter table st_smallint_e13 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
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 alter table st_smallint_e25 set tag tagname=''
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -12,7 +12,7 @@ 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
######## case 0: tinyint
print ========== tinyint
print ========== tinyint
sql create table mt_tinyint (ts timestamp, c tinyint) tags (tagname tinyint)
## case 00: static create table for test tag values
......@@ -87,7 +87,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_tinyint_1 values (now, NULL)
sql select * from st_tinyint_1
if $rows != 1 then
......@@ -95,7 +95,7 @@ if $rows != 1 then
endi
if $data01 != NULL then
return -1
endi
endi
sql insert into st_tinyint_6 values (now, 127)
sql select * from st_tinyint_6
if $rows != 1 then
......@@ -103,7 +103,7 @@ if $rows != 1 then
endi
if $data01 != 127 then
return -1
endi
endi
sql insert into st_tinyint_7 values (now, -127)
sql select * from st_tinyint_7
if $rows != 1 then
......@@ -111,15 +111,15 @@ if $rows != 1 then
endi
if $data01 != -127 then
return -1
endi
sql insert into st_tinyint_8 values (now, +100)
endi
sql insert into st_tinyint_8 values (now, +100)
sql select * from st_tinyint_8
if $rows != 1 then
return -1
endi
if $data01 != 100 then
return -1
endi
endi
sql insert into st_tinyint_9 values (now, "-098")
sql select * from st_tinyint_9
if $rows != 1 then
......@@ -127,7 +127,7 @@ if $rows != 1 then
endi
if $data01 != -98 then
return -1
endi
endi
sql insert into st_tinyint_10 values (now, '0')
sql select * from st_tinyint_10
if $rows != 1 then
......@@ -135,15 +135,15 @@ if $rows != 1 then
endi
if $data01 != 0 then
return -1
endi
sql insert into st_tinyint_11 values (now, -0)
endi
sql insert into st_tinyint_11 values (now, -0)
sql select * from st_tinyint_11
if $rows != 1 then
return -1
endi
if $data01 != 0 then
return -1
endi
endi
sql insert into st_tinyint_12 values (now, "+056")
sql select * from st_tinyint_12
if $rows != 1 then
......@@ -151,7 +151,7 @@ if $rows != 1 then
endi
if $data01 != 56 then
return -1
endi
endi
sql insert into st_tinyint_13 values (now, +056)
sql select * from st_tinyint_13
......@@ -160,7 +160,7 @@ if $rows != 1 then
endi
if $data01 != 56 then
return -1
endi
endi
sql insert into st_tinyint_14 values (now, -056)
sql select * from st_tinyint_14
......@@ -169,7 +169,7 @@ if $rows != 1 then
endi
if $data01 != -56 then
return -1
endi
endi
## case 02: dynamic create table for test tag values
sql insert into st_tinyint_16 using mt_tinyint tags (NULL) values (now, NULL)
......@@ -181,7 +181,7 @@ sql select * from st_tinyint_16
if $data01 != NULL then
return -1
endi
sql insert into st_tinyint_17 using mt_tinyint tags (NULL) values (now, NULL)
sql show tags from st_tinyint_17
if $data05 != NULL then
......@@ -190,7 +190,7 @@ endi
sql select * from st_tinyint_17
if $data01 != NULL then
return -1
endi
endi
sql insert into st_tinyint_18 using mt_tinyint tags ('NULL') values (now, 'NULL')
sql show tags from st_tinyint_18
if $data05 != NULL then
......@@ -235,7 +235,7 @@ endi
sql select * from st_tinyint_22
if $data01 != 127 then
return -1
endi
endi
sql insert into st_tinyint_23 using mt_tinyint tags (-127) values (now, -127)
sql show tags from st_tinyint_23
if $data05 != -127 then
......@@ -244,7 +244,7 @@ endi
sql select * from st_tinyint_23
if $data01 != -127 then
return -1
endi
endi
sql insert into st_tinyint_24 using mt_tinyint tags (10) values (now, 10)
sql show tags from st_tinyint_24
if $data05 != 10 then
......@@ -253,7 +253,7 @@ endi
sql select * from st_tinyint_24
if $data01 != 10 then
return -1
endi
endi
sql insert into st_tinyint_25 using mt_tinyint tags ("-0") values (now, "-0")
sql show tags from st_tinyint_25
if $data05 != 0 then
......@@ -262,7 +262,7 @@ endi
sql select * from st_tinyint_25
if $data01 != 0 then
return -1
endi
endi
sql insert into st_tinyint_26 using mt_tinyint tags ('123') values (now, '123')
sql show tags from st_tinyint_26
if $data05 != 123 then
......@@ -271,7 +271,7 @@ endi
sql select * from st_tinyint_26
if $data01 != 123 then
return -1
endi
endi
sql insert into st_tinyint_27 using mt_tinyint tags (+056) values (now, +00056)
sql show tags from st_tinyint_27
if $data05 != 56 then
......@@ -280,7 +280,7 @@ endi
sql select * from st_tinyint_27
if $data01 != 56 then
return -1
endi
endi
sql insert into st_tinyint_28 using mt_tinyint tags (-056) values (now, -0056)
sql show tags from st_tinyint_28
if $data05 != -56 then
......@@ -289,7 +289,7 @@ endi
sql select * from st_tinyint_28
if $data01 != -56 then
return -1
endi
endi
## case 03: alter tag values
#sql alter table st_tinyint_0 set tag tagname=127
......@@ -340,12 +340,12 @@ 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
#sql_error create table st_tinyint_e0 using mt_tinyint tags (-11.80)
sql_error create table st_tinyint_e0 using mt_tinyint tags (123abc)
sql_error create table st_tinyint_e0 using mt_tinyint tags (123abc)
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 create table st_tinyint_e0_2 using mt_tinyint tags ('')
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 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)
......@@ -361,31 +361,31 @@ sql create table st_tinyint_e10 using mt_tinyint tags (123)
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 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)
#sql_error insert into st_tinyint_e5 values (now, -11.80)
sql_error insert into st_tinyint_e6 values (now, 123abc)
sql_error insert into st_tinyint_e0 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)
#sql_error insert into st_tinyint_e5 values (now, -11.80)
sql_error insert into st_tinyint_e6 values (now, 123abc)
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 insert into st_tinyint_e12 values (now, '')
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 insert into st_tinyint_e12 values (now, '')
sql_error insert into st_tinyint_e13 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)
#sql_error insert into st_tinyint_e18 using mt_tinyint tags (033) values (now, -11.80)
sql_error insert into st_tinyint_e19 using mt_tinyint tags (033) values (now, 123abc)
sql_error insert into st_tinyint_e13 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)
#sql_error insert into st_tinyint_e18 using mt_tinyint tags (033) values (now, -11.80)
sql_error insert into st_tinyint_e19 using mt_tinyint tags (033) values (now, 123abc)
sql_error insert into st_tinyint_e20 using mt_tinyint tags (033) values (now, "123abc")
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 insert into st_tinyint_e25_2 using mt_tinyint tags (033) values (now, '')
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 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 insert into st_tinyint_e14 using mt_tinyint tags (-128) values (now, -033)
......@@ -414,15 +414,15 @@ sql insert into st_tinyint_e23 using mt_tinyint tags (033) values (now, 00062)
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 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
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 alter table st_tinyint_e25 set tag tagname=''
sql_error alter table st_tinyint_e13 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
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 alter table st_tinyint_e25 set tag tagname=''
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -9,7 +9,7 @@ $stbPrefix = sc_stb
$tbNum = 10
$rowNum = 10000
$totalNum = $tbNum * $rowNum
$loops = 5
$loops = 5
$log = 1
$ts0 = 1537146000000
$delta = 600000
......@@ -34,7 +34,7 @@ while $i < $halfNum
$tb1 = $tbPrefix . $tbId
sql create table $tb using $stb tags( $i )
sql create table $tb1 using $stb tags( $tbId )
$x = 0
while $x < $rowNum
$xs = $x * $delta
......@@ -48,10 +48,10 @@ while $i < $halfNum
$nchar = $nchar . '
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar ) $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
$x = $x + 1
endw
endw
$i = $i + 1
endw
endw
print ====== tables created
sql use $db
......@@ -62,7 +62,7 @@ $i = 0
while $loop <= $loops
print repeat = $loop
while $i < 10
sql select count(*) from $stb where t1 = $i
sql select count(*) from $stb where t1 = $i
if $data00 != $rowNum then
print expect $rowNum , actual: $data00
return -1
......@@ -89,7 +89,7 @@ $i = 0
while $loop <= $loops
print repeat = $loop
while $i < 10
sql select count(*) from $stb where t1 = $i
sql select count(*) from $stb where t1 = $i
if $data00 != $rowNum then
return -1
endi
......@@ -102,4 +102,4 @@ while $loop <= $loops
$loop = $loop + 1
endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -4,7 +4,7 @@ system sh/exec.sh -n dnode1 -s start
sql connect
sql drop database if exists cdb
sql create database if not exists cdb
sql create database if not exists cdb
sql use cdb
sql create table stb1 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int, t2 binary(10), t3 double)
sql create table tb1 using stb1 tags(1,'1',1.0)
......@@ -37,7 +37,7 @@ sql insert into tb4 values ('2021-05-05 18:19:19',44,44.0,44,44,44,44.0,false,'4
sql insert into tb5 values ('2021-05-05 18:19:20',51,51.0,51,51,51,51.0,true ,'51','51')
sql insert into tb5 values ('2021-05-05 18:19:21',52,52.0,52,52,52,52.0,true ,'52','52')
sql insert into tb5 values ('2021-05-05 18:19:22',53,53.0,53,53,53,53.0,false,'53','53')
sql insert into tb5 values ('2021-05-05 18:19:23',54,54.0,54,54,54,54.0,false,'54','54')
sql insert into tb5 values ('2021-05-05 18:19:23',54,54.0,54,54,54,54.0,false,'54','54')
sql insert into tb6 values ('2021-05-05 18:19:24',61,61.0,61,61,61,61.0,true ,'61','61')
sql insert into tb6 values ('2021-05-05 18:19:25',62,62.0,62,62,62,62.0,true ,'62','62')
sql insert into tb6 values ('2021-05-05 18:19:26',63,63.0,63,63,63,63.0,false,'63','63')
......
......@@ -23,10 +23,10 @@ sql create database $db
sql use $db
sql show databases
if $rows != 3 then
if $rows != 3 then
return -1
endi
if $data20 != $db then
if $data20 != $db then
return -1
endi
sql drop database $db
......@@ -41,7 +41,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data20 != $db then
if $data20 != $db then
return -1
endi
sql drop database $db
......@@ -101,7 +101,7 @@ $duration = 10
$keep = 365,365,365
$rows_db = 1000
$cache = 16 # 16MB
$ablocks = 100
$ablocks = 100
$tblocks = 32 # max=512, automatically trimmed when exceeding
$ctime = 36000 # 10 hours
$wal = 1 # valid value is 1, 2
......@@ -112,16 +112,16 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data20 != $db then
if $data20 != $db then
return -1
endi
if $data24 != $replica then
if $data24 != $replica then
return -1
endi
if $data26 != 14400m then
if $data26 != 14400m then
return -1
endi
if $data27 != 525600m,525600m,525600m then
if $data27 != 525600m,525600m,525600m then
return -1
endi
......@@ -134,7 +134,7 @@ sql_error create database $db replica 4
# day [1, 3650]
sql_error create database $db day 0
sql_error create database $db day 3651
sql_error create database $db day 3651
# keep [1, infinity]
sql_error create database $db keep 0
......@@ -155,7 +155,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 27360m,27360m,27360m then
if $data27 != 27360m,27360m,27360m then
return -1
endi
sql drop database dbk0
......@@ -164,7 +164,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 27360m,28800m,28800m then
if $data27 != 27360m,28800m,28800m then
return -1
endi
sql drop database dbka
......@@ -174,7 +174,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 15840m,15840m,15840m then
if $data27 != 15840m,15840m,15840m then
return -1
endi
sql drop database dbk1
......@@ -183,7 +183,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 15840m,17280m,18720m then
if $data27 != 15840m,17280m,18720m then
return -1
endi
sql drop database dbk2
......@@ -192,7 +192,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 15840m,15840m,18720m then
if $data27 != 15840m,15840m,18720m then
return -1
endi
sql drop database dbk3
......@@ -201,7 +201,7 @@ sql show databases
if $rows != 3 then
return -1
endi
if $data27 != 15840m,18720m,18720m then
if $data27 != 15840m,18720m,18720m then
return -1
endi
sql drop database dbk4
......@@ -238,7 +238,7 @@ if $rows != 3 then
endi
sql show databases
print wallevel $data20_testwal
if $data20_testwal != 1 then
if $data20_testwal != 1 then
return -1
endi
sql drop database testwal
......@@ -249,7 +249,7 @@ if $rows != 3 then
return -1
endi
print wallevel $data13_testwal
if $data13_testwal != 2 then
if $data13_testwal != 2 then
return -1
endi
sql drop database testwal
......@@ -263,7 +263,7 @@ sql_error create database $db comp 3
sql_error drop database $db
sql show databases
if $rows != 2 then
if $rows != 2 then
return -1
endi
......
......@@ -30,7 +30,7 @@ sql show stables
if $rows != 1 then
return -1
endi
if $data00 != $mt then
if $data00 != $mt then
return -1
endi
sql_error DROP METRIC $mt
......@@ -75,7 +75,7 @@ sql_error create table $mt (ts timestamp, col $i_tinyint ) tags (tag1 int)
sql_error create table $mt (ts timestamp, col $i_nchar ) tags (tag1 int)
# correct using of nchar
sql create table $mt (ts timestamp, col nchar(10)) tags (tag1 int)
sql create table $mt (ts timestamp, col nchar(10)) tags (tag1 int)
sql show stables
if $rows != 1 then
return -1
......@@ -115,7 +115,7 @@ endi
if $data00 != $mt then
return -1
endi
sql drop table $mt
sql drop table $mt
print illegal_data_type_in_tags test passed
# illegal_tag_name test
......@@ -141,12 +141,12 @@ $stables = stables
sql_error create table $mt (ts timestamp, col1 int) tags ( $tb_ int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $tbs int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $db_ int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $dbs int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $dbs int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $ses int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $int int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $bint int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $binary int)
sql create table $mt (ts timestamp, col1 int) tags ( $str int)
sql create table $mt (ts timestamp, col1 int) tags ( $str int)
sql drop table $mt
sql_error create table $mt (ts timestamp, col1 int) tags ( $tag int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $tags int)
......@@ -184,7 +184,7 @@ sql drop table $tb
sql_error create table $tb using $mt tags (abc)
#the case below might need more consideration
sql_error create table $tb using $mt tags ('abc')
sql_error create table $tb using $mt tags ('abc')
sql drop table if exists $tb
sql reset query cache
sql_error create table $tb using $mt tags (1e1)
......@@ -202,12 +202,12 @@ $mt2 = mt2
#sql_error create table $mt1 (ts timestamp, $CN_char int) tags (tag1 int)
#sql_error create table $mt2 (ts timestamp, col1 int) tags ( $CN_char int)
#sql show metrics
#if $rows != 3 then
#if $rows != 3 then
# return -1
#endi
##print expected: $CN_char
##print returned: $data00
#if $data00 != $CN_char then
#if $data00 != $CN_char then
# return -1
#endi
##print expected: $mt1
......@@ -241,7 +241,7 @@ print chinese_char_in_metrics test passed
sql drop database $db
sql show databases
if $rows != 2 then
if $rows != 2 then
return -1
endi
......
......@@ -31,7 +31,7 @@ if $rows != 1 then
return -1
endi
print data00 = $data00
if $data00 != $tb then
if $data00 != $tb then
return -1
endi
sql DROP TABLE $tb
......@@ -47,7 +47,7 @@ print =========== create_tb.sim case2: illegal_table_name test
$illegal_tb1 = 1db
$illegal_tb2 = d@b
sql_error create table $illegal_db1 (ts timestamp, tcol int)
sql_error create table $illegal_db1 (ts timestamp, tcol int)
sql_error create table $illegal_db2 (ts timestamp, tcol int)
print illegal_table_name test passed
......@@ -99,19 +99,19 @@ $tint = tinyint
$nchar = nchar
sql_error create table $tb (ts timestamp, $tb_ int)
sql_error create table $tb (ts timestamp, $tbs int)
sql_error create table $tb (ts timestamp, $db_ int)
sql_error create table $tb (ts timestamp, $tbs int)
sql_error create table $tb (ts timestamp, $db_ int)
sql_error create table $tb (ts timestamp, $dbs int)
sql_error create table $tb (ts timestamp, $ses int)
sql_error create table $tb (ts timestamp, $int int)
sql_error create table $tb (ts timestamp, $bint int)
sql_error create table $tb (ts timestamp, $binary int)
sql create table $tb (ts timestamp, $str int)
sql_error create table $tb (ts timestamp, $bint int)
sql_error create table $tb (ts timestamp, $binary int)
sql create table $tb (ts timestamp, $str int)
sql drop table $tb
sql_error create table $tb (ts timestamp, $tag int)
sql_error create table $tb (ts timestamp, $tag int)
sql_error create table $tb (ts timestamp, $tags int)
sql_error create table $tb (ts timestamp, $sint int)
sql_error create table $tb (ts timestamp, $tint int)
sql_error create table $tb (ts timestamp, $sint int)
sql_error create table $tb (ts timestamp, $tint int)
sql_error create table $tb (ts timestamp, $nchar int)
# too long column name
......@@ -124,23 +124,23 @@ print ========== create_tb.sim case5: chinese_char_in_table_support test
$CN_char = 涛思
$tb1 = tb1
sql_error create table $CN_char (ts timestamp, col1 int)
#sql show tables
#if $rows != 1 then
sql_error create table $CN_char (ts timestamp, col1 int)
#sql show tables
#if $rows != 1 then
# return -1
#endi
#print expected: $CN_char
#print returned: $data00
#if $data00 != $CN_char then
#if $data00 != $CN_char then
# return -1
#endi
#sql drop table $CN_char
sql_error create table $tb1 (ts timestamp, $CN_char int)
sql_error create table $tb1 (ts timestamp, $CN_char int)
#print expected: $tb1
#print returned: $data10
#sql show tables
#if $rows != 1 then
#if $rows != 1 then
# return -1
#endi
#if $data00 != $tb1 then
......@@ -181,8 +181,8 @@ print table_already_exists test passed
sql drop database $db
sql show databases
if $rows != 2 then
if $rows != 2 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -15,16 +15,16 @@ sql select id,t1,t2,t3 from tb1
if $rows != 1 then
return -1
endi
if $data00 != 1 then
if $data00 != 1 then
return -1
endi
if $data01 != 2 then
if $data01 != 2 then
return -1
endi
if $data02 != NULL then
if $data02 != NULL then
return -1
endi
if $data03 != NULL then
if $data03 != NULL then
return -1
endi
......@@ -33,16 +33,16 @@ sql show tags from tb2
if $rows != 4 then
return -1
endi
if $data05 != NULL then
if $data05 != NULL then
return -1
endi
if $data15 != NULL then
if $data15 != NULL then
return -1
endi
if $data25 != 12 then
if $data25 != 12 then
return -1
endi
if $data35 != 22.000000000 then
if $data35 != 22.000000000 then
return -1
endi
......@@ -51,16 +51,16 @@ sql show tags from tb3;
if $rows != 4 then
return -1
endi
if $data05 != 1 then
if $data05 != 1 then
return -1
endi
if $data15 != 2 then
if $data15 != 2 then
return -1
endi
if $data25 != 3 then
if $data25 != 3 then
return -1
endi
if $data35 != 33.000000000 then
if $data35 != 33.000000000 then
return -1
endi
......@@ -69,16 +69,16 @@ sql show tags from tb4;
if $rows != 4 then
return -1
endi
if $data05 != 1 then
if $data05 != 1 then
return -1
endi
if $data15 != 2 then
if $data15 != 2 then
return -1
endi
if $data25 != 33 then
if $data25 != 33 then
return -1
endi
if $data35 != 44.000000000 then
if $data35 != 44.000000000 then
return -1
endi
......@@ -96,16 +96,16 @@ sql show tags from tb12;
if $rows != 4 then
return -1
endi
if $data05 != 1 then
if $data05 != 1 then
return -1
endi
if $data15 != 2 then
if $data15 != 2 then
return -1
endi
if $data25 != NULL then
if $data25 != NULL then
return -1
endi
if $data35 != NULL then
if $data35 != NULL then
return -1
endi
......@@ -114,16 +114,16 @@ sql show tags from tb13;
if $rows != 4 then
return -1
endi
if $data05 != 1 then
if $data05 != 1 then
return -1
endi
if $data15 != 2 then
if $data15 != 2 then
return -1
endi
if $data25 != NULL then
if $data25 != NULL then
return -1
endi
if $data35 != NULL then
if $data35 != NULL then
return -1
endi
......
......@@ -85,18 +85,18 @@ sql insert into abc.tk_subt001 (ts, b, d) values (now-1m, 'binary_6',
sql insert into abc.tk_subt001 (ts, b, d) values (now-1s, 'binary_7', 1.007)
sql insert into abc.tk_subt001 (ts, b, d) values (now-1a, 'binary_8', 1.008)
sql select * from tk_subt001
if $rows != 6 then
if $rows != 6 then
print ==== expect rows is 6, but actually is $rows
return -1
endi
sql insert into abc.tk_subt002 using tk_mt tags (22, 'subt002x') values (now+1s, 2001, 'binary_2001', true, 2001.001, 2001.001, 'nchar_2001')
sql insert into abc.tk_subt002 using tk_mt tags (2, 'subt002') values (now+1m, 2002, 'binary_2002', false, 2002.001, 2002.001, 'nchar_2002')
sql insert into abc.tk_subt002 using tk_mt tags (2, 'subt002') values (now+1m, 2002, 'binary_2002', false, 2002.001, 2002.001, 'nchar_2002')
sql insert into abc.tk_subt002 using tk_mt tags (2, 'subt002') values (now+1h, 2003, 'binary_2003', false, 2003.001, 2003.001, 'nchar_2003')
sql insert into abc.tk_subt002 using tk_mt tags (2, 'subt002') values (now+1d, 2004, 'binary_2004', true, 2004.001, 2004.001, 'nchar_2004')
sql insert into abc.tk_subt002 using tk_mt tags (2, 'subt002') values (now+1w, 2005, 'binary_2005', false, 2005.001, 2005.001, 'nchar_2005')
sql select * from tk_subt002
if $rows != 5 then
if $rows != 5 then
print ==== expect rows is 5, but actually is $rows
return -1
endi
......@@ -106,7 +106,7 @@ sql insert into abc.tk_subt003 (ts, a, c, e, f) using tk_mt tags (3, 'subt003')
sql insert into abc.tk_subt003 values (now-36d, 3006, 'binary_3006', true, 3006.001, 3006.001, 'nchar_3006')
sql insert into abc.tk_subt003 (ts, a, c, e, f) using tk_mt tags (33, 'subt003x') values (now-35d, 3007, false, 3007.001, 'nchar_3007')
sql select * from tk_subt003
if $rows != 4 then
if $rows != 4 then
print ==== expect rows is 4, but actually is $rows
return -1
endi
......
......@@ -34,11 +34,11 @@ while $i < $tbNum
sql insert into $tb values('2015-08-18 00:18:00', 4);
sql insert into $tb values('2015-08-18 00:24:00', 5);
sql insert into $tb values('2015-08-18 00:30:00', 6);
endw
endw
$i = 0
$tb = $tbPrefix . $i
print ====== table created
print ====== table created
#### select distinct tag
sql select distinct t1 from $stb
......@@ -66,17 +66,17 @@ if $rows != 6 then
endi
### select multi normal column
### select distinct multi column on sub table
### select distinct multi column on sub table
sql select distinct ts, c1 from $tb
if $rows != 6 then
return -1
endi
### select distinct
### select distinct
sql drop database $db
sql show databases
if $rows != 2 then
if $rows != 2 then
return -1
endi
......
......@@ -27,17 +27,17 @@ $ts = $ts0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , true, 'BINARY', 'NCHAR' )
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , true, 'BINARY', 'NCHAR' )
$x = $x + 1
endw
endw
$i = $i + 1
endw
endw
# setup
$i = 0
......@@ -72,7 +72,7 @@ endi
if $data13 != 6.00000 then
return -1
endi
# unspecified filling method
sql_error select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill (6, 6, 6, 6, 6)
......@@ -81,31 +81,31 @@ sql_error select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb w
print constant_fill test
print count_with_constant_fill
sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data11 != 6 then
if $data11 != 6 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 6 then
if $data31 != 6 then
return -1
endi
if $data41 != 1 then
return -1
endi
if $data51 != 6 then
if $data51 != 6 then
return -1
endi
if $data61 != 1 then
return -1
endi
if $data71 != 6 then
if $data71 != 6 then
return -1
endi
if $data81 != 1 then
......@@ -115,31 +115,31 @@ endi
# avg_with_fill
print avg_with_constant_fill
sql select _wstart, avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0.000000000 then
return -1
endi
if $data11 != 6.000000000 then
if $data11 != 6.000000000 then
return -1
endi
if $data21 != 1.000000000 then
return -1
endi
if $data31 != 6.000000000 then
if $data31 != 6.000000000 then
return -1
endi
if $data41 != 2.000000000 then
return -1
endi
if $data51 != 6.000000000 then
if $data51 != 6.000000000 then
return -1
endi
if $data61 != 3.000000000 then
return -1
endi
if $data71 != 6.000000000 then
if $data71 != 6.000000000 then
return -1
endi
if $data81 != 4.000000000 then
......@@ -149,31 +149,31 @@ endi
# max_with_fill
print max_with_fill
sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 6 then
if $data11 != 6 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 6 then
if $data31 != 6 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 6 then
if $data51 != 6 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 6 then
if $data71 != 6 then
return -1
endi
if $data81 != 4 then
......@@ -183,31 +183,31 @@ endi
# min_with_fill
print min_with_fill
sql select _wstart, min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 6 then
if $data11 != 6 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 6 then
if $data31 != 6 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 6 then
if $data51 != 6 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 6 then
if $data71 != 6 then
return -1
endi
if $data81 != 4 then
......@@ -217,31 +217,31 @@ endi
# first_with_fill
print first_with_fill
sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 6 then
if $data11 != 6 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 6 then
if $data31 != 6 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 6 then
if $data51 != 6 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 6 then
if $data71 != 6 then
return -1
endi
if $data81 != 4 then
......@@ -306,32 +306,32 @@ endi
# last_with_fill
print last_with_fill
sql select _wstart, last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
print expect 0, actual:$data01
return -1
endi
if $data11 != 6 then
if $data11 != 6 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 6 then
if $data31 != 6 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 6 then
if $data51 != 6 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 6 then
if $data71 != 6 then
return -1
endi
if $data81 != 4 then
......@@ -340,13 +340,13 @@ endi
# fill_negative_values
sql select _wstart, sum(c1), avg(c2), max(c3), min(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -1, -1, -1, -1, -1, -1, -1)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != -1 then
if $data11 != -1 then
return -1
endi
......@@ -401,7 +401,7 @@ sql select count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(v
print select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e1');
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e1');
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
......@@ -409,7 +409,7 @@ if $data01 != 1 then
endi
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1e1);
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
......@@ -417,7 +417,7 @@ if $data01 != 1 then
endi
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '10');
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
......@@ -431,31 +431,31 @@ endi
## previous fill
print fill(prev)
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data11 != 1 then
if $data11 != 1 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 1 then
if $data31 != 1 then
return -1
endi
if $data41 != 1 then
return -1
endi
if $data51 != 1 then
if $data51 != 1 then
return -1
endi
if $data61 != 1 then
return -1
endi
if $data71 != 1 then
if $data71 != 1 then
return -1
endi
if $data81 != 1 then
......@@ -464,31 +464,31 @@ endi
# avg_with_fill
sql select _wstart, avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0.000000000 then
return -1
endi
if $data11 != 0.000000000 then
if $data11 != 0.000000000 then
return -1
endi
if $data21 != 1.000000000 then
return -1
endi
if $data31 != 1.000000000 then
if $data31 != 1.000000000 then
return -1
endi
if $data41 != 2.000000000 then
return -1
endi
if $data51 != 2.000000000 then
if $data51 != 2.000000000 then
return -1
endi
if $data61 != 3.000000000 then
return -1
endi
if $data71 != 3.000000000 then
if $data71 != 3.000000000 then
return -1
endi
if $data81 != 4.000000000 then
......@@ -497,31 +497,31 @@ endi
# max_with_fill
sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 0 then
if $data11 != 0 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 1 then
if $data31 != 1 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 2 then
if $data51 != 2 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 3 then
if $data71 != 3 then
return -1
endi
if $data81 != 4 then
......@@ -530,31 +530,31 @@ endi
# min_with_fill
sql select _wstart, min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 0 then
if $data11 != 0 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 1 then
if $data31 != 1 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 2 then
if $data51 != 2 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 3 then
if $data71 != 3 then
return -1
endi
if $data81 != 4 then
......@@ -563,31 +563,31 @@ endi
# first_with_fill
sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 0 then
if $data11 != 0 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 1 then
if $data31 != 1 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 2 then
if $data51 != 2 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 3 then
if $data71 != 3 then
return -1
endi
if $data81 != 4 then
......@@ -596,31 +596,31 @@ endi
# last_with_fill
sql select _wstart, last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 0 then
if $data11 != 0 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 1 then
if $data31 != 1 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 2 then
if $data51 != 2 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 3 then
if $data71 != 3 then
return -1
endi
if $data81 != 4 then
......@@ -633,7 +633,7 @@ print fill(value, NULL)
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
print select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
......@@ -664,13 +664,13 @@ if $data81 != 1 then
return -1
endi
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(none)
if $rows != 5 then
if $rows != 5 then
return -1
endi
# avg_with_fill
sql select _wstart, avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0.000000000 then
......@@ -703,7 +703,7 @@ endi
# max_with_fill
sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
......@@ -736,7 +736,7 @@ endi
# min_with_fill
sql select _wstart, min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
......@@ -769,7 +769,7 @@ endi
# first_with_fill
sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
......@@ -802,7 +802,7 @@ endi
# last_with_fill
sql select _wstart, last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
......
......@@ -35,7 +35,7 @@ while $i < $halfNum
$tgstr1 = $tgstr1 . '
sql create table $tb using $stb tags( $i , $tgstr , $tgstr , $i , $i , $i )
sql create table $tb1 using $stb tags( $i1 , $tgstr1 , $tgstr1 , $i , $i , $i )
$x = 0
while $x < $rowNum
$xs = $x * $delta
......@@ -47,13 +47,13 @@ while $i < $halfNum
$binary = $binary . '
$nchar = 'nchar . $c
$nchar = $nchar . '
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
sql insert into $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
sql insert into $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
$x = $x + 1
endw
endw
$i = $i + 1
endw
endw
print ====== tables created
# setup
......@@ -167,7 +167,7 @@ endi
if $data13 != 6.00000 then
return -1
endi
# unspecified filling method
sql_error select max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill (6, 6, 6, 6, 6)
......@@ -245,35 +245,35 @@ sql_error select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m)
sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '2e1');
$val = $rowNum * 2
$val = $val - 1
if $rows != $val then
if $rows != $val then
return -1
endi
if $data01 != $rowNum then
return -1
endi
if $data11 != 20 then
if $data11 != 20 then
return -1
endi
sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 2e1);
if $rows != $val then
if $rows != $val then
return -1
endi
if $data01 != $rowNum then
return -1
endi
if $data11 != 20 then
if $data11 != 20 then
return -1
endi
sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '20');
if $rows != $val then
if $rows != $val then
return -1
endi
if $data01 != $rowNum then
return -1
endi
if $data11 != 20 then
if $data11 != 20 then
return -1
endi
......@@ -358,7 +358,7 @@ endi
## previous fill
print fill(prev)
sql select max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(prev) group by t1 limit 5
if $rows != 25 then
if $rows != 25 then
return -1
endi
if $data01 != 0 then
......@@ -370,19 +370,19 @@ endi
if $data04 != NULL then
return -1
endi
if $data09 != 5 then
if $data09 != 5 then
return -1
endi
if $data12 != NULL then
return -1
endi
if $data19 != 5 then
if $data19 != 5 then
return -1
endi
if $data18 != nchar0 then
return -1
endi
if $data59 != 6 then
if $data59 != 6 then
return -1
endi
if $data69 != 6 then
......@@ -392,7 +392,7 @@ endi
## NULL fill
print fill(NULL)
sql select max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(value, NULL) group by t1 limit 5
if $rows != 25 then
if $rows != 25 then
return -1
endi
if $data01 != 0 then
......@@ -407,7 +407,7 @@ endi
if $data06 != 1 then
return -1
endi
if $data09 != 5 then
if $data09 != 5 then
return -1
endi
if $data11 != NULL then
......@@ -416,13 +416,13 @@ endi
if $data12 != NULL then
return -1
endi
if $data19 != 5 then
if $data19 != 5 then
return -1
endi
if $data18 != NULL then
return -1
endi
if $data59 != 6 then
if $data59 != 6 then
return -1
endi
if $data69 != 6 then
......@@ -432,8 +432,8 @@ endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
if $rows != 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -27,17 +27,17 @@ $ts = $ts0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , true, 'BINARY', 'NCHAR' )
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , true, 'BINARY', 'NCHAR' )
$x = $x + 1
endw
endw
$i = $i + 1
endw
endw
# setup
$i = 0
......@@ -74,7 +74,7 @@ endi
if $data13 != 6.00000 then
return -1
endi
# unspecified filling method
sql_error select max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill (6, 6, 6, 6, 6)
......@@ -84,31 +84,31 @@ print constant_fill test
print count_with_constant_fill
print sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data11 != 6 then
if $data11 != 6 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 6 then
if $data31 != 6 then
return -1
endi
if $data41 != 1 then
return -1
endi
if $data51 != 6 then
if $data51 != 6 then
return -1
endi
if $data61 != 1 then
return -1
endi
if $data71 != 6 then
if $data71 != 6 then
return -1
endi
if $data81 != 1 then
......@@ -118,31 +118,31 @@ endi
# avg_with_fill
print avg_witt_constant_fill
sql select avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0.000000000 then
return -1
endi
if $data11 != 6.000000000 then
if $data11 != 6.000000000 then
return -1
endi
if $data21 != 1.000000000 then
return -1
endi
if $data31 != 6.000000000 then
if $data31 != 6.000000000 then
return -1
endi
if $data41 != 2.000000000 then
return -1
endi
if $data51 != 6.000000000 then
if $data51 != 6.000000000 then
return -1
endi
if $data61 != 3.000000000 then
return -1
endi
if $data71 != 6.000000000 then
if $data71 != 6.000000000 then
return -1
endi
if $data81 != 4.000000000 then
......@@ -152,31 +152,31 @@ endi
# max_with_fill
print max_with_fill
sql select max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 6 then
if $data11 != 6 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 6 then
if $data31 != 6 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 6 then
if $data51 != 6 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 6 then
if $data71 != 6 then
return -1
endi
if $data81 != 4 then
......@@ -186,31 +186,31 @@ endi
# min_with_fill
print min_with_fill
sql select min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 6 then
if $data11 != 6 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 6 then
if $data31 != 6 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 6 then
if $data51 != 6 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 6 then
if $data71 != 6 then
return -1
endi
if $data81 != 4 then
......@@ -220,31 +220,31 @@ endi
# first_with_fill
print first_with_fill
sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 6 then
if $data11 != 6 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 6 then
if $data31 != 6 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 6 then
if $data51 != 6 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 6 then
if $data71 != 6 then
return -1
endi
if $data81 != 4 then
......@@ -309,31 +309,31 @@ endi
# last_with_fill
print last_with_fill
sql select last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 6 then
if $data11 != 6 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 6 then
if $data31 != 6 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 6 then
if $data51 != 6 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 6 then
if $data71 != 6 then
return -1
endi
if $data81 != 4 then
......@@ -342,13 +342,13 @@ endi
# fill_negative_values
sql select _wstart, sum(c1), avg(c2), max(c3), min(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -1, -1, -1, -1, -1, -1, -1)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != -1 then
if $data11 != -1 then
return -1
endi
......@@ -401,7 +401,7 @@ sql_error select count(*) where ts >= $ts0 and ts <= $tsu interval(5m) fill(valu
sql select count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true');
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e1');
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
......@@ -409,7 +409,7 @@ if $data01 != 1 then
endi
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1e1);
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
......@@ -417,7 +417,7 @@ if $data01 != 1 then
endi
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '10');
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
......@@ -432,31 +432,31 @@ endi
## previous fill
print fill(prev)
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data11 != 1 then
if $data11 != 1 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 1 then
if $data31 != 1 then
return -1
endi
if $data41 != 1 then
return -1
endi
if $data51 != 1 then
if $data51 != 1 then
return -1
endi
if $data61 != 1 then
return -1
endi
if $data71 != 1 then
if $data71 != 1 then
return -1
endi
if $data81 != 1 then
......@@ -465,31 +465,31 @@ endi
# avg_with_fill
sql select _wstart, avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0.000000000 then
return -1
endi
if $data11 != 0.000000000 then
if $data11 != 0.000000000 then
return -1
endi
if $data21 != 1.000000000 then
return -1
endi
if $data31 != 1.000000000 then
if $data31 != 1.000000000 then
return -1
endi
if $data41 != 2.000000000 then
return -1
endi
if $data51 != 2.000000000 then
if $data51 != 2.000000000 then
return -1
endi
if $data61 != 3.000000000 then
return -1
endi
if $data71 != 3.000000000 then
if $data71 != 3.000000000 then
return -1
endi
if $data81 != 4.000000000 then
......@@ -498,31 +498,31 @@ endi
# max_with_fill
sql select max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 0 then
if $data11 != 0 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 1 then
if $data31 != 1 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 2 then
if $data51 != 2 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 3 then
if $data71 != 3 then
return -1
endi
if $data81 != 4 then
......@@ -531,31 +531,31 @@ endi
# min_with_fill
sql select min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 0 then
if $data11 != 0 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 1 then
if $data31 != 1 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 2 then
if $data51 != 2 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 3 then
if $data71 != 3 then
return -1
endi
if $data81 != 4 then
......@@ -564,31 +564,31 @@ endi
# first_with_fill
sql select first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 0 then
if $data11 != 0 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 1 then
if $data31 != 1 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 2 then
if $data51 != 2 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 3 then
if $data71 != 3 then
return -1
endi
if $data81 != 4 then
......@@ -597,31 +597,31 @@ endi
# last_with_fill
sql select last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
return -1
endi
if $data11 != 0 then
if $data11 != 0 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data31 != 1 then
if $data31 != 1 then
return -1
endi
if $data41 != 2 then
return -1
endi
if $data51 != 2 then
if $data51 != 2 then
return -1
endi
if $data61 != 3 then
return -1
endi
if $data71 != 3 then
if $data71 != 3 then
return -1
endi
if $data81 != 4 then
......@@ -634,7 +634,7 @@ print fill(value, NULL)
sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
print select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 1 then
......@@ -665,13 +665,13 @@ if $data81 != 1 then
return -1
endi
sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(none)
if $rows != 5 then
if $rows != 5 then
return -1
endi
# avg_with_fill
sql select _wstart, avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0.000000000 then
......@@ -704,7 +704,7 @@ endi
# max_with_fill
sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
......@@ -737,7 +737,7 @@ endi
# min_with_fill
sql select _wstart, min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
......@@ -770,7 +770,7 @@ endi
# first_with_fill
sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
......@@ -803,7 +803,7 @@ endi
# last_with_fill
sql select _wstart, last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(NULL)
if $rows != 9 then
if $rows != 9 then
return -1
endi
if $data01 != 0 then
......@@ -845,7 +845,7 @@ endi
#print =============== clear
#sql drop database $db
#sql show databases
#if $rows != 0 then
#if $rows != 0 then
# return -1
#endi
......@@ -880,7 +880,7 @@ sql insert into us_t1 values ('2018-09-17 09:00:00.000029', 29 , 29)
print sql select avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(value, 999, 999)
sql select avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(value, 999, 999)
if $rows != 8 then
if $rows != 8 then
return -1
endi
if $data01 != 2.000000000 then
......@@ -909,7 +909,7 @@ if $data71 != 21.000000000 then
endi
sql select avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(none)
if $rows != 6 then
if $rows != 6 then
return -1
endi
if $data01 != 2.000000000 then
......@@ -932,7 +932,7 @@ if $data51 != 21.000000000 then
endi
sql select avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(null)
if $rows != 8 then
if $rows != 8 then
return -1
endi
if $data01 != 2.000000000 then
......@@ -965,7 +965,7 @@ endi
sql select avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(prev)
if $rows != 8 then
if $rows != 8 then
return -1
endi
if $data01 != 2.000000000 then
......@@ -994,7 +994,7 @@ if $data71 != 21.000000000 then
endi
sql select _wstart, avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(linear)
if $rows != 8 then
if $rows != 8 then
return -1
endi
if $data01 != 2.000000000 then
......@@ -1022,4 +1022,4 @@ if $data71 != 21.000000000 then
return -1
endi
print ======== fill_us.sim run end...... ================
\ No newline at end of file
print ======== fill_us.sim run end...... ================
......@@ -19,7 +19,7 @@ $stb = $stbPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db maxrows 400
sql create database $db maxrows 400
sql use $db
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)
......@@ -29,18 +29,18 @@ $ts = $ts0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $stb tags( $i )
$x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
$c6 = $x / 128
$c6 = $x / 128
$c6 = $c6 * 128
$c6 = $x - $c6
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , $c6 , true, 'BINARY', 'NCHAR' )
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , $c6 , true, 'BINARY', 'NCHAR' )
$x = $x + 1
endw
endw
$i = $i + 1
endw
......
......@@ -29,22 +29,22 @@ if $data00 != @18-09-17 08:59:00.000@ then
return -1
endi
if $data01 != 0 then
return -1
endi
return -1
endi
if $data02 != 0 then
return -1
endi
return -1
endi
print data03 = $data03
if $data03 != 0.00000 then
print expect 0.00000, actual: $data03
return -1
endi
return -1
endi
if $data04 != 0.000000000 then
return -1
endi
if $data05 != 0 then
return -1
endi
endi
if $data06 != 0 then
return -1
endi
......@@ -66,20 +66,20 @@ if $rows != 1 then
return -1
endi
if $data00 != @18-09-18 01:40:00.000@ then
return -1
endi
return -1
endi
if $data01 != 999 then
return -1
return -1
endi
if $data02 != 999 then
return -1
return -1
endi
if $data03 != 999.00000 then
return -1
endi
return -1
endi
if $data04 != 999.000000000 then
return -1
......@@ -88,7 +88,7 @@ endi
#if $data05 != NULL then
if $data05 != 999 then
return -1
endi
endi
#if $data06 != NULL then
if $data06 != 103 then
return -1
......@@ -108,8 +108,8 @@ endi
### test if first works for committed data. An 'order by ts desc' clause should be present, and queried data should come from at least 2 file blocks
$tb = $tbPrefix . 9
sql select first(ts), first(c1) from $tb where ts < '2018-10-17 10:00:00.000'
if $rows != 1 then
sql select first(ts), first(c1) from $tb where ts < '2018-10-17 10:00:00.000'
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
......@@ -121,7 +121,7 @@ endi
$tb = $tbPrefix . 9
sql select first(ts), first(c1) from $tb where ts < '2018-10-17 10:00:00.000'
if $rows != 1 then
if $rows != 1 then
return -1
endi
if $data00 != @18-09-17 09:00:00.000@ then
......
......@@ -18,7 +18,7 @@ print =============== create super table
sql create table if not exists stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double) tags (t1 int)
sql show stables
if $rows != 1 then
if $rows != 1 then
return -1
endi
......@@ -28,7 +28,7 @@ sql create table ct0 using stb tags(1000)
#sql create table ct3 using stb tags(3000)
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
endi
......@@ -63,7 +63,7 @@ $loop_test = 0
loop_test_pos:
sql select ts, c2-c1, c3/c1, c4+c1, c1*9, c1%3 from ct0
print ===> rows: $rows
print ===> rows: $rows
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
......@@ -96,15 +96,15 @@ if $loop_test == 0 then
print =============== stop and restart taosd
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$loop_cnt = 0
check_dnode_ready_0:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
......@@ -114,7 +114,7 @@ if $loop_test == 0 then
goto check_dnode_ready_0
endi
$loop_test = 1
$loop_test = 1
goto loop_test_pos
endi
......
......@@ -91,7 +91,7 @@ if $data13 != 1 then
return -1
endi
sql select _wstart, twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:07:00' interval(1m)
sql select _wstart, twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:07:00' interval(1m)
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
print $data10 $data11 $data12 $data13 $data14 $data15 $data16
print $data20 $data21 $data22 $data23 $data24 $data25 $data26
......@@ -114,7 +114,7 @@ if $data01 != 2.068333156 then
return -1
endi
sql select _wstart, twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:27:00' interval(10m)
sql select _wstart, twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:27:00' interval(10m)
if $rows != 3 then
return -1
endi
......@@ -190,8 +190,8 @@ if $rows != 0 then
return -1
endi
sql select twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:30:00' interval(10m)
sql select twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:30:00' interval(10m)
sql select twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:30:00' interval(10m)
sql select twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:30:00' interval(10m)
#todo add test case while column filter exists for twa query
......@@ -536,7 +536,7 @@ if $data14 != 2 then
return -1
endi
sql select _wstart, stddev(k), stddev(b), stddev(c), tbname,a from m1 partition by tbname, a interval(10s) order by tbname
sql select _wstart, stddev(k), stddev(b), stddev(c), tbname,a from m1 partition by tbname, a interval(10s) order by tbname
if $rows != 3 then
return -1
endi
......
......@@ -77,7 +77,7 @@ $ts1 = $tb1 . .ts
$ts2 = $tb2 . .ts
print ===============================groupby_operation
print
print
print ==== select count(*), c1 from group_tb0 group by c1
sql select count(*), c1 from group_tb0 group by c1
print rows: $rows
......@@ -142,7 +142,7 @@ print $data20 $data21 $data22 $data23
print $data80 $data81 $data82 $data83
print $data90 $data91 $data92 $data93
return
return
sql select sum(c1), c1, avg(c1), min(c1), max(c2) from group_tb0 where c1 < 20 group by c1;
if $row != 20 then
......@@ -581,10 +581,10 @@ endi
sql create table st (ts timestamp, c int) tags (t1 int, t2 int, t3 int, t4 int);
sql create table t1 using st tags(1, 1, 1, 1);
sql create table t2 using st tags(1, 2, 2, 2);
sql insert into t1 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
sql insert into t1 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
sql insert into t2 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
sql insert into t2 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
sql insert into t1 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
sql insert into t1 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
sql insert into t2 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
sql insert into t2 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
print =================>TD-2665
sql_error create table txx as select avg(c) as t from st;
......
......@@ -565,10 +565,10 @@ endi
sql create table st (ts timestamp, c int) tags (t1 int, t2 int, t3 int, t4 int);
sql create table t1 using st tags(1, 1, 1, 1);
sql create table t2 using st tags(1, 2, 2, 2);
sql insert into t1 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
sql insert into t1 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
sql insert into t2 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
sql insert into t2 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
sql insert into t1 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
sql insert into t1 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
sql insert into t2 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
sql insert into t2 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
print =================>TD-2665
sql_error create table txx as select avg(c) as t from st;
......
此差异已折叠。
......@@ -16,7 +16,7 @@ $stb = $stbPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql create database $db
print ====== create tables
sql use $db
sql create table tb (ts timestamp, c1 int, c2 timestamp)
......@@ -78,4 +78,4 @@ if $data40 != @19-05-05 11:59:00.000@ then
endi
if $data50 != @19-05-05 12:00:00.000@ then
return -1
endi
\ No newline at end of file
endi
......@@ -19,7 +19,7 @@ $stb = $stbPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql create database $db
print ====== create tables
sql use $db
......@@ -31,9 +31,9 @@ $x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
sql insert into $tb values ( $ts , $x )
sql insert into $tb values ( $ts , $x )
$x = $x + 1
endw
endw
print ====== tables created
$ts = $ts0 + $delta
......@@ -42,9 +42,9 @@ sql import into $tb values ( $ts , -1)
sql select count(*) from $tb
$res = $rowNum + 1
if $data00 != $res then
print expected: $res
print returned: $rows
print expected: $res
print returned: $rows
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -18,7 +18,7 @@ $stb = $stbPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql create database $db
print ====== create tables
sql use $db
......@@ -30,9 +30,9 @@ $x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
sql insert into $tb values ( $ts , $x )
sql insert into $tb values ( $ts , $x )
$x = $x + 1
endw
endw
print ====== tables created
$ts = $ts0 + $delta
......@@ -41,9 +41,9 @@ sql import into $tb values ( $ts , -1)
sql select count(*) from $tb
$res = $rowNum + 1
if $data00 != $res then
print expected: $res
print returned: $rows
print expected: $res
print returned: $rows
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -18,7 +18,7 @@ $stb = $stbPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql create database $db
print ====== create tables
sql use $db
sql reset query cache
......@@ -30,9 +30,9 @@ $x = 0
while $x < $rowNum
$xs = $x * $delta
$ts = $ts0 + $xs
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x )
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x )
$x = $x + 1
endw
endw
print ====== tables created
$ts = $ts + 1
......@@ -46,9 +46,9 @@ sql show databases
sql select count(*) from $tb
$res = $rowNum + 2
if $data00 != $res then
print expected: $res
print returned: $rows
print expected: $res
print returned: $rows
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -59,7 +59,7 @@ sql select * from $tb order by ts desc
if $rows != 3 then
return -1
endi
if $data01 != $col1 then
if $data01 != $col1 then
return -1
endi
print data03 = $data03
......@@ -213,7 +213,7 @@ if $data46 != @quoted double@ then
endi
# case: support NULL char of the binary field [TBASE-660]
sql create table NULLb (ts timestamp, c1 binary(20), c2 binary(20), c3 float)
sql create table NULLb (ts timestamp, c1 binary(20), c2 binary(20), c3 float)
sql insert into NULLb values ('2018-09-17 09:00:00.000', '', '', 3.746)
sql select * from NULLb
if $rows != 1 then
......@@ -222,8 +222,8 @@ endi
#sql drop database $db
#sql show databases
#if $rows != 0 then
#if $rows != 0 then
# return -1
#endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
system sh/exec.sh -n dnode1 -s stop -x SIGINT
......@@ -18,7 +18,7 @@ $stb = $stbPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql create database $db
print ====== create tables
sql use $db
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)
......@@ -32,7 +32,7 @@ while $i < $halfNum
$tb1 = $tbPrefix . $tbId
sql create table $tb using $stb tags( $i )
sql create table $tb1 using $stb tags( $tbId )
$x = 0
while $x < $rowNum
$xs = $x * $delta
......@@ -46,10 +46,10 @@ while $i < $halfNum
$nchar = $nchar . '
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar ) $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
$x = $x + 1
endw
endw
$i = $i + 1
endw
endw
print ====== tables created
sql create table ap1 (ts timestamp, pav float);
......
......@@ -55,7 +55,7 @@ while $i < $tbNum
endw
$tstart = 100000
$mt = $mtPrefix . 1
$mt = $mtPrefix . 1
sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int, t2 binary(12), t3 int)
$i = 0
......@@ -110,7 +110,7 @@ if $row != 3000 then
return -1
endi
# TODO
# TODO
return
print ======= second tags join
......
......@@ -24,7 +24,7 @@ sql create table tbb using st2 tags (5);
sql create table tbc using st2 tags (5);
sql create table tbd using st2 tags (5);
sql create table tbe using st2 tags (5);
sql insert into tb1 values ("2021-05-09 10:10:10", 1, 2.0, '3', -1000)
sql insert into tb1 values ("2021-05-10 10:10:11", 4, 5.0, NULL, -2000)
sql insert into tb1 values ("2021-05-12 10:10:12", 6,NULL, NULL, -3000)
......
......@@ -9,7 +9,7 @@ sql select last(ts) from tb1
if $rows != 1 then
return -1
endi
if $data00 != @21-05-12 10:10:12.000@ then
if $data00 != @21-05-12 10:10:12.000@ then
print $data00
return -1
endi
......@@ -18,7 +18,7 @@ sql select last(f1) from tb1
if $rows != 1 then
return -1
endi
if $data00 != 6 then
if $data00 != 6 then
print $data00
return -1
endi
......@@ -27,21 +27,21 @@ sql select last(*) from tb1
if $rows != 1 then
return -1
endi
if $data00 != @21-05-12 10:10:12.000@ then
if $data00 != @21-05-12 10:10:12.000@ then
print $data00
return -1
endi
if $data01 != 6 then
if $data01 != 6 then
return -1
endi
if $data02 != 5.000000000 then
if $data02 != 5.000000000 then
print $data02
return -1
endi
if $data03 != 3 then
if $data03 != 3 then
return -1
endi
if $data04 != @70-01-01 07:59:57.000@ then
if $data04 != @70-01-01 07:59:57.000@ then
return -1
endi
......@@ -49,28 +49,28 @@ sql select last(tb1.*,ts,f4) from tb1
if $rows != 1 then
return -1
endi
if $data00 != @21-05-12 10:10:12.000@ then
if $data00 != @21-05-12 10:10:12.000@ then
print $data00
return -1
endi
if $data01 != 6 then
if $data01 != 6 then
return -1
endi
if $data02 != 5.000000000 then
if $data02 != 5.000000000 then
print $data02
return -1
endi
if $data03 != 3 then
if $data03 != 3 then
return -1
endi
if $data04 != @70-01-01 07:59:57.000@ then
if $data04 != @70-01-01 07:59:57.000@ then
return -1
endi
if $data05 != @21-05-12 10:10:12.000@ then
if $data05 != @21-05-12 10:10:12.000@ then
print $data00
return -1
endi
if $data06 != @70-01-01 07:59:57.000@ then
if $data06 != @70-01-01 07:59:57.000@ then
return -1
endi
......@@ -79,7 +79,7 @@ sql select last(ts) from tb2
if $rows != 1 then
return -1
endi
if $data00 != @21-05-11 10:11:15.000@ then
if $data00 != @21-05-11 10:11:15.000@ then
print $data00
return -1
endi
......@@ -88,7 +88,7 @@ sql select last(f1) from tb2
if $rows != 1 then
return -1
endi
if $data00 != -6 then
if $data00 != -6 then
print $data00
return -1
endi
......@@ -97,21 +97,21 @@ sql select last(*) from tb2
if $rows != 1 then
return -1
endi
if $data00 != @21-05-11 10:11:15.000@ then
if $data00 != @21-05-11 10:11:15.000@ then
print $data00
return -1
endi
if $data01 != -6 then
if $data01 != -6 then
return -1
endi
if $data02 != -7.000000000 then
if $data02 != -7.000000000 then
print $data02
return -1
endi
if $data03 != -8 then
if $data03 != -8 then
return -1
endi
if $data04 != @70-01-01 07:59:56.999@ then
if $data04 != @70-01-01 07:59:56.999@ then
if $data04 != @70-01-01 07:59:57.-01@ then
return -1
endi
......@@ -121,30 +121,30 @@ sql select last(tb2.*,ts,f4) from tb2
if $rows != 1 then
return -1
endi
if $data00 != @21-05-11 10:11:15.000@ then
if $data00 != @21-05-11 10:11:15.000@ then
print $data00
return -1
endi
if $data01 != -6 then
if $data01 != -6 then
return -1
endi
if $data02 != -7.000000000 then
if $data02 != -7.000000000 then
print $data02
return -1
endi
if $data03 != -8 then
if $data03 != -8 then
return -1
endi
if $data04 != @70-01-01 07:59:56.999@ then
if $data04 != @70-01-01 07:59:56.999@ then
if $data04 != @70-01-01 07:59:57.-01@ then
return -1
endi
endi
if $data05 != @21-05-11 10:11:15.000@ then
if $data05 != @21-05-11 10:11:15.000@ then
print $data00
return -1
endi
if $data06 != @70-01-01 07:59:56.999@ then
if $data06 != @70-01-01 07:59:56.999@ then
if $data04 != @70-01-01 07:59:57.-01@ then
return -1
endi
......@@ -155,21 +155,21 @@ sql select last(*) from tbd
if $rows != 1 then
return -1
endi
if $data00 != @21-05-11 10:12:29.000@ then
if $data00 != @21-05-11 10:12:29.000@ then
print $data00
return -1
endi
if $data01 != NULL then
if $data01 != NULL then
return -1
endi
if $data02 != NULL then
if $data02 != NULL then
print $data02
return -1
endi
if $data03 != NULL then
if $data03 != NULL then
return -1
endi
if $data04 != NULL then
if $data04 != NULL then
return -1
endi
......@@ -184,7 +184,7 @@ sql select last(ts) from st2
if $rows != 1 then
return -1
endi
if $data00 != @21-05-12 10:10:12.000@ then
if $data00 != @21-05-12 10:10:12.000@ then
print $data00
return -1
endi
......@@ -193,7 +193,7 @@ sql select last(f1) from st2
if $rows != 1 then
return -1
endi
if $data00 != 6 then
if $data00 != 6 then
print $data00
return -1
endi
......@@ -202,21 +202,21 @@ sql select last(*) from st2
if $rows != 1 then
return -1
endi
if $data00 != @21-05-12 10:10:12.000@ then
if $data00 != @21-05-12 10:10:12.000@ then
print $data00
return -1
endi
if $data01 != 6 then
if $data01 != 6 then
return -1
endi
if $data02 != 37.000000000 then
if $data02 != 37.000000000 then
print $data02
return -1
endi
if $data03 != 27 then
if $data03 != 27 then
return -1
endi
if $data04 != @70-01-01 07:59:57.000@ then
if $data04 != @70-01-01 07:59:57.000@ then
return -1
endi
......@@ -225,28 +225,28 @@ sql select last(st2.*,ts,f4) from st2
if $rows != 1 then
return -1
endi
if $data00 != @21-05-12 10:10:12.000@ then
if $data00 != @21-05-12 10:10:12.000@ then
print $data00
return -1
endi
if $data01 != 6 then
if $data01 != 6 then
return -1
endi
if $data02 != 37.000000000 then
if $data02 != 37.000000000 then
print $data02
return -1
endi
if $data03 != 27 then
if $data03 != 27 then
return -1
endi
if $data04 != @70-01-01 07:59:57.000@ then
if $data04 != @70-01-01 07:59:57.000@ then
return -1
endi
if $data05 != @21-05-12 10:10:12.000@ then
if $data05 != @21-05-12 10:10:12.000@ then
print $data00
return -1
endi
if $data06 != @70-01-01 07:59:57.000@ then
if $data06 != @70-01-01 07:59:57.000@ then
return -1
endi
......@@ -260,99 +260,99 @@ print ===> $data40 $data41 $data42 $data43 $data44 $data45 $data46 $data47 $data
if $rows != 5 then
return -1
endi
if $data00 != @21-05-12 10:10:12.000@ then
if $data00 != @21-05-12 10:10:12.000@ then
return -1
endi
if $data01 != 6 then
if $data01 != 6 then
return -1
endi
if $data02 != 5.000000000 then
if $data02 != 5.000000000 then
print $data02
return -1
endi
if $data03 != 21 then
if $data03 != 21 then
return -1
endi
if $data04 != @70-01-01 07:59:57.000@ then
if $data04 != @70-01-01 07:59:57.000@ then
return -1
endi
if $data05 != 1 then
if $data05 != 1 then
return -1
endi
if $data10 != @21-05-11 10:12:23.000@ then
if $data10 != @21-05-11 10:12:23.000@ then
return -1
endi
if $data11 != 22 then
if $data11 != 22 then
return -1
endi
if $data12 != 23.000000000 then
if $data12 != 23.000000000 then
print $data02
return -1
endi
if $data13 != -8 then
if $data13 != -8 then
return -1
endi
if $data14 != @70-01-01 07:59:58.-04@ then
if $data14 != @70-01-01 07:59:58.-04@ then
return -1
endi
if $data15 != 2 then
if $data15 != 2 then
return -1
endi
if $data20 != @21-05-10 10:12:24.000@ then
if $data20 != @21-05-10 10:12:24.000@ then
return -1
endi
if $data21 != 24 then
if $data21 != 24 then
return -1
endi
if $data22 != 11.000000000 then
print expect 11.000000000 actual: $data22
return -1
endi
if $data23 != 25 then
if $data23 != 25 then
return -1
endi
if $data24 != @70-01-01 07:59:57.-04@ then =
return -1
endi
if $data25 != 3 then
if $data25 != 3 then
return -1
endi
if $data30 != @21-05-11 10:12:25.000@ then
if $data30 != @21-05-11 10:12:25.000@ then
return -1
endi
if $data31 != 26 then
if $data31 != 26 then
return -1
endi
if $data32 != 17.000000000 then
if $data32 != 17.000000000 then
print $data02
return -1
endi
if $data33 != 27 then
if $data33 != 27 then
return -1
endi
if $data34 != @70-01-01 07:59:56.-04@ then
if $data34 != @70-01-01 07:59:56.-04@ then
return -1
endi
if $data35 != 4 then
if $data35 != 4 then
return -1
endi
if $data40 != @21-05-11 10:12:29.000@ then
if $data40 != @21-05-11 10:12:29.000@ then
return -1
endi
if $data41 != 36 then
if $data41 != 36 then
return -1
endi
if $data42 != 37.000000000 then
if $data42 != 37.000000000 then
print $data02
return -1
endi
if $data43 != 35 then
if $data43 != 35 then
return -1
endi
if $data44 != @70-01-01 07:59:56.-05@ then
if $data44 != @70-01-01 07:59:56.-05@ then
return -1
endi
if $data45 != 5 then
if $data45 != 5 then
return -1
endi
......@@ -367,21 +367,21 @@ sql select last(*) from tbn;
if $rows != 1 then
return -1
endi
if $data00 != @21-05-13 10:10:12.000@ then
if $data00 != @21-05-13 10:10:12.000@ then
print $data00
return -1
endi
if $data01 != 6 then
if $data01 != 6 then
return -1
endi
if $data02 != 5.000000000 then
if $data02 != 5.000000000 then
print $data02
return -1
endi
if $data03 != 3 then
if $data03 != 3 then
return -1
endi
if $data04 != @70-01-01 07:59:57.000@ then
if $data04 != @70-01-01 07:59:57.000@ then
return -1
endi
......@@ -27,7 +27,7 @@ while $i > 0
$tb = $tbPrefix . $i
sql create table $tb using $stb tags( $i )
$i = $i - 1
endw
endw
$ts = $ts0
$i = 1
......@@ -36,7 +36,7 @@ while $i <= $tbNum
$tb = $tbPrefix . $i
while $x < $rowNum
$ts = $ts + $delta
$c6 = $x / 128
$c6 = $x / 128
$c6 = $c6 * 128
$c6 = $x - $c6
$c3 = NULL
......@@ -46,9 +46,9 @@ while $i <= $tbNum
if $xr = 0 then
$c3 = $x
endi
sql insert into $tb values ( $ts , $x , NULL , $x , $x , $x , $c6 , true, 'BINARY', 'NCHAR' )
sql insert into $tb values ( $ts , $x , NULL , $x , $x , $x , $c6 , true, 'BINARY', 'NCHAR' )
$x = $x + 1
endw
endw
$i = $i + 1
endw
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -218,7 +218,7 @@ if $data00 != 0.016666667 then
endi
sql select derivative(c1, 1s, 0) from (select * from nest_tb0);
print $rows $data00 $data10
print $rows $data00 $data10
if $rows != 9999 then
return -1
endi
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册