From b3c74da37aa2715ab962d6f1326dbf58f380cd5b Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Tue, 8 Jun 2021 11:16:27 +0800 Subject: [PATCH] add test case --- src/mnode/src/mnodeDb.c | 18 +- tests/script/general/parser/alter.sim | 60 +++- .../parser/alter__for_community_version.sim | 316 ++++++++++++++++++ tests/script/general/parser/create_db.sim | 49 ++- .../create_db__for_community_version.sim | 238 +++++++++++++ .../general/parser/dbtbnameValidate.sim | 2 +- tests/script/general/parser/first_last.sim | 4 +- tests/script/general/parser/function.sim | 2 +- tests/script/general/parser/groupby.sim | 2 +- tests/script/general/parser/join.sim | 2 +- .../script/general/parser/join_manyblocks.sim | 2 +- .../script/general/parser/join_multivnode.sim | 4 +- .../parser/projection_limit_offset.sim | 2 +- .../general/parser/select_with_tags.sim | 4 +- tests/script/general/parser/sliding.sim | 2 +- tests/script/general/parser/subInfrom.sim | 2 +- tests/script/general/parser/topbot.sim | 8 +- tests/script/jenkins/basic.txt | 4 + 18 files changed, 697 insertions(+), 24 deletions(-) create mode 100644 tests/script/general/parser/alter__for_community_version.sim create mode 100644 tests/script/general/parser/create_db__for_community_version.sim diff --git a/src/mnode/src/mnodeDb.c b/src/mnode/src/mnodeDb.c index 3fa33dc4b7..9faf08c2ec 100644 --- a/src/mnode/src/mnodeDb.c +++ b/src/mnode/src/mnodeDb.c @@ -612,7 +612,12 @@ static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn pShow->bytes[cols] = 24 + VARSTR_HEADER_SIZE; pSchema[cols].type = TSDB_DATA_TYPE_BINARY; - strcpy(pSchema[cols].name, "keep0,keep1,keep(D)"); + +#ifdef _STORAGE + strcpy(pSchema[cols].name, "keep0,keep1,keep2"); +#else + strcpy(pSchema[cols].name, "keep"); +#endif pSchema[cols].bytes = htons(pShow->bytes[cols]); cols++; @@ -778,11 +783,15 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; char tmp[128] = {0}; +#ifdef _STORAGE if (pDb->cfg.daysToKeep0 > pDb->cfg.daysToKeep1 || pDb->cfg.daysToKeep0 > pDb->cfg.daysToKeep2) { sprintf(tmp, "%d,%d,%d", pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2, pDb->cfg.daysToKeep0); } else { sprintf(tmp, "%d,%d,%d", pDb->cfg.daysToKeep0, pDb->cfg.daysToKeep1, pDb->cfg.daysToKeep2); } +#else + sprintf(tmp, "%d", pDb->cfg.daysToKeep0); +#endif STR_WITH_SIZE_TO_VARSTR(pWrite, tmp, strlen(tmp)); cols++; @@ -941,6 +950,7 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SAlterDbMsg *pAlter) { terrno = TSDB_CODE_SUCCESS; + //UPGRATE FROM LOW VERSION, reorder it if (pDb->cfg.daysToKeep0 > pDb->cfg.daysToKeep1 || pDb->cfg.daysToKeep0 > pDb->cfg.daysToKeep2) { int32_t t = pDb->cfg.daysToKeep0; newCfg.daysToKeep0 = pDb->cfg.daysToKeep1; @@ -972,17 +982,17 @@ static SDbCfg mnodeGetAlterDbOption(SDbObj *pDb, SAlterDbMsg *pAlter) { terrno = TSDB_CODE_MND_INVALID_DB_OPTION; } - if (daysToKeep0 > 0 && daysToKeep0 != pDb->cfg.daysToKeep0) { + if (daysToKeep0 > 0 && (daysToKeep0 != pDb->cfg.daysToKeep0 || newCfg.daysToKeep0 != pDb->cfg.daysToKeep0)) { mDebug("db:%s, daysToKeep:%d change to %d", pDb->name, pDb->cfg.daysToKeep0, daysToKeep0); newCfg.daysToKeep0 = daysToKeep0; } - if (daysToKeep1 > 0 && daysToKeep1 != pDb->cfg.daysToKeep1) { + if (daysToKeep1 > 0 && (daysToKeep1 != pDb->cfg.daysToKeep1 || newCfg.daysToKeep1 != pDb->cfg.daysToKeep1)) { mDebug("db:%s, daysToKeep1:%d change to %d", pDb->name, pDb->cfg.daysToKeep1, daysToKeep1); newCfg.daysToKeep1 = daysToKeep1; } - if (daysToKeep2 > 0 && daysToKeep2 != pDb->cfg.daysToKeep2) { + if (daysToKeep2 > 0 && (daysToKeep2 != pDb->cfg.daysToKeep2 || newCfg.daysToKeep2 != pDb->cfg.daysToKeep2)) { mDebug("db:%s, daysToKeep2:%d change to %d", pDb->name, pDb->cfg.daysToKeep2, daysToKeep2); newCfg.daysToKeep2 = daysToKeep2; } diff --git a/tests/script/general/parser/alter.sim b/tests/script/general/parser/alter.sim index 6c88497396..5c22f67a0b 100644 --- a/tests/script/general/parser/alter.sim +++ b/tests/script/general/parser/alter.sim @@ -20,8 +20,66 @@ $db = $dbPrefix . $i $mt = $mtPrefix . $i sql drop database if exists $db -sql create database $db +sql create database $db days 10 keep 20,20,20 sql use $db + +sql_error alter database $db keep "20" +sql_error alter database $db keep "20","20","20" +sql_error alter database $db keep 20 +sql_error alter database $db keep 20.0 +sql_error alter database $db keep 20.0,20.0,20.0 +sql_error alter database $db keep 0,0,0 +sql_error alter database $db keep -1,-1,-1 +sql_error alter database $db keep 20,20 +sql_error alter database $db keep 9,9,9 +sql_error alter database $db keep 20,20,19 +sql_error alter database $db keep 20,19,20 +sql_error alter database $db keep 20,19,19 +sql_error alter database $db keep 20,19,18 +sql_error alter database $db keep 20,20,20,20 +sql_error alter database $db keep 365001,365001,365001 +sql alter database $db keep 20,20,20 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 20,20,20 then + return -1 +endi +sql alter database $db keep 10,10,10 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 10,10,10 then + return -1 +endi +sql alter database $db keep 10,10,11 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 10,10,11 then + return -1 +endi +sql alter database $db keep 11,12,13 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 11,12,13 then + return -1 +endi +sql alter database $db keep 365000,365000,365000 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 365000,365000,365000 then + return -1 +endi + + ##### alter table test, simeplest case sql create table tb (ts timestamp, c1 int, c2 int, c3 int) sql insert into tb values (now, 1, 1, 1) diff --git a/tests/script/general/parser/alter__for_community_version.sim b/tests/script/general/parser/alter__for_community_version.sim new file mode 100644 index 0000000000..f55fb812a7 --- /dev/null +++ b/tests/script/general/parser/alter__for_community_version.sim @@ -0,0 +1,316 @@ +system sh/stop_dnodes.sh + +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c walLevel -v 1 +system sh/exec.sh -n dnode1 -s start +sleep 100 +sql connect + +$dbPrefix = m_alt_db +$tbPrefix = m_alt_tb +$mtPrefix = m_alt_mt +$tbNum = 10 +$rowNum = 5 +$totalNum = $tbNum * $rowNum +$ts0 = 1537146000000 +$delta = 600000 +print ========== alter.sim +$i = 0 +$db = $dbPrefix . $i +$mt = $mtPrefix . $i + +sql drop database if exists $db +sql create database $db days 10 keep 20 +sql use $db +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 20 then + return -1 +endi + +sql_error alter database $db keep "20" +sql_error alter database $db keep "20","20","20" +sql_error alter database $db keep 0 +sql_error alter database $db keep 20.0 +sql_error alter database $db keep 20.0,20.0,20.0 +sql_error alter database $db keep 0,0,0 +sql_error alter database $db keep 3 +sql_error alter database $db keep -1,-1,-1 +sql_error alter database $db keep 20,20 +sql_error alter database $db keep 9,9,9 +sql_error alter database $db keep 20,20,19 +sql_error alter database $db keep 20,19,20 +sql_error alter database $db keep 20,19,19 +sql_error alter database $db keep 20,19,18 +sql_error alter database $db keep 20,20,20,20 +sql_error alter database $db keep 365001,365001,365001 +sql_error alter database $db keep 365001 +sql alter database $db keep 20 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 20 then + return -1 +endi +sql alter database $db keep 10 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 10 then + return -1 +endi +sql alter database $db keep 11 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 11 then + return -1 +endi +sql alter database $db keep 13 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 13 then + return -1 +endi +sql alter database $db keep 365000 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 365000 then + return -1 +endi + + +##### alter table test, simeplest case +sql create table tb (ts timestamp, c1 int, c2 int, c3 int) +sql insert into tb values (now, 1, 1, 1) +sql select * from tb order by ts desc +if $rows != 1 then + return -1 +endi +sql alter table tb drop column c3 +sql select * from tb order by ts desc +if $data01 != 1 then + return -1 +endi +if $data02 != 1 then + return -1 +endi +if $data03 != null then + return -1 +endi +sql alter table tb add column c3 nchar(4) +sql select * from tb order by ts desc +if $rows != 1 then + return -1 +endi +if $data03 != NULL then + return -1 +endi +sql insert into tb values (now, 2, 2, 'taos') +sql select * from tb order by ts desc +if $rows != 2 then + return -1 +endi +print data03 = $data03 +if $data03 != taos then + print expect taos, actual: $data03 + return -1 +endi +sql drop table tb + +##### alter metric test, simplest case +sql create table mt (ts timestamp, c1 int, c2 int, c3 int) tags (t1 int) +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 + return -1 +endi +if $data02 != 1 then + return -1 +endi +if $data03 != null then + return -1 +endi + +sql alter table mt add column c3 nchar(4) +sql select * from tb order by ts desc +if $data03 != NULL then + return -1 +endi +sql insert into tb values (now, 2, 2, 'taos') +sql select * from tb order by ts desc +if $rows != 2 then + return -1 +endi +if $data03 != taos then + return -1 +endi +if $data13 != NULL then + return -1 +endi +sql drop table tb +sql drop table mt + +## [TBASE272] +sql create table tb (ts timestamp, c1 int, c2 int, c3 int) +sql insert into tb values (now, 1, 1, 1) +sql alter table tb drop column c3 +sql alter table tb add column c3 nchar(5) +sql insert into tb values(now, 2, 2, 'taos') +sql drop table tb +sql create table mt (ts timestamp, c1 int, c2 int, c3 int) tags (t1 int) +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 $rows != 1 then + return -1 +endi +sql drop table tb +sql drop table mt + +sleep 100 +### ALTER TABLE WHILE STREAMING [TBASE271] +#sql create table tb1 (ts timestamp, c1 int, c2 nchar(5), c3 int) +#sql create table strm as select count(*), avg(c1), first(c2), sum(c3) from tb1 interval(2s) +#sql select * from strm +#if $rows != 0 then +# return -1 +#endi +##sleep 12000 +#sql insert into tb1 values (now, 1, 'taos', 1) +#sleep 20000 +#sql select * from strm +#print rows = $rows +#if $rows != 1 then +# return -1 +#endi +#if $data04 != 1 then +# return -1 +#endi +#sql alter table tb1 drop column c3 +#sleep 500 +#sql insert into tb1 values (now, 2, 'taos') +#sleep 30000 +#sql select * from strm +#if $rows != 2 then +# return -1 +#endi +#if $data04 != 1 then +# return -1 +#endi +#sql alter table tb1 add column c3 int +#sleep 500 +#sql insert into tb1 values (now, 3, 'taos', 3); +#sleep 100 +#sql select * from strm +#if $rows != 3 then +# return -1 +#endi +#if $data04 != 1 then +# return -1 +#endi + +## ALTER TABLE AND INSERT BY COLUMNS +sql create table mt (ts timestamp, c1 int, c2 int) tags(t1 int) +sql create table tb using mt tags(0) +sql insert into tb values (now-1m, 1, 1) +sql alter table mt drop column c2 +sql_error insert into tb (ts, c1, c2) values (now, 2, 2) +sql insert into tb (ts, c1) values (now, 2) +sql select * from tb order by ts desc +if $rows != 2 then + return -1 +endi +if $data01 != 2 then + return -1 +endi +if $data02 != null then + return -1 +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 +if $data02 != 3 then + return -1 +endi + +## ALTER TABLE AND IMPORT +sql drop database $db +sql create database $db +sql use $db +sql create table mt (ts timestamp, c1 int, c2 nchar(7), c3 int) tags (t1 int) +sql create table tb using mt tags(1) +sleep 100 +sql insert into tb values ('2018-11-01 16:30:00.000', 1, 'insert', 1) +sql alter table mt drop column c3 + +sql insert into tb values ('2018-11-01 16:29:59.000', 1, 'insert') +sql import into tb values ('2018-11-01 16:29:59.000', 1, 'import') +sql select * from tb order by ts desc +if $data01 != 1 then + return -1 +endi +if $data02 != insert then + return -1 +endi +sql alter table mt add column c3 nchar(4) +sql select * from tb order by ts desc +if $data03 != NULL then + return -1 +endi + +print ============================>TD-3366 TD-3486 +sql insert into td_3366(ts, c3, c1) using mt(t1) tags(911) values('2018-1-1 11:11:11', 'new1', 12); +sql insert into td_3486(ts, c3, c1) using mt(t1) tags(-12) values('2018-1-1 11:11:11', 'new1', 12); +sql insert into ttxu(ts, c3, c1) using mt(t1) tags('-121') values('2018-1-1 11:11:11', 'new1', 12); + +sql insert into tb(ts, c1, c3) using mt(t1) tags(123) values('2018-11-01 16:29:58.000', 2, 'port') + +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 +if $rows != 4 then + return -1 +endi + +if $data03 != 3 then + return -1 +endi + +##### ILLEGAL OPERATIONS + +# try dropping columns that are defined in metric +sql_error alter table tb drop column c1; + +# try dropping primary key +sql_error alter table mt drop column ts; + +# try modifying two columns in a single statement +sql_error alter table mt add column c5 nchar(3) c6 nchar(4) + +# duplicate columns +sql_error alter table mt add column c1 int + +# drop non-existing columns +sql_error alter table mt drop column c9 + +#sql drop database $db +#sql show databases +#if $rows != 0 then +# return -1 +#endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/general/parser/create_db.sim b/tests/script/general/parser/create_db.sim index 9ca84af136..d3b74b697f 100644 --- a/tests/script/general/parser/create_db.sim +++ b/tests/script/general/parser/create_db.sim @@ -102,7 +102,7 @@ print create_db.sim case5: db_meta_data test # cfg params $replica = 1 # max=3 $days = 10 -$keep = 365 +$keep = 365,365,365 $rows_db = 1000 $cache = 16 # 16MB $ablocks = 100 @@ -150,6 +150,53 @@ sql_error create database $db day 3651 # keep [1, infinity] sql_error create database $db keep 0 +sql_error create database $db keep 0,0,0 +sql_error create database $db keep 3,3,3 +sql_error create database $db keep 11.0 +sql_error create database $db keep 11.0,11.0,11.0 +sql_error create database $db keep "11","11","11" +sql_error create database $db keep "11" +sql_error create database $db keep 13,12,11 +sql_error create database $db keep 11,12,11 +sql_error create database $db keep 12,11,12 +sql_error create database $db keep 11,11 +sql_error create database $db keep 365001,365001,365001 +sql create database dbk1 keep 11,11,11 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 11,11,11 then + return -1 +endi +sql drop database dbk1 +sql create database dbk2 keep 11,12,13 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 11,12,13 then + return -1 +endi +sql drop database dbk2 +sql create database dbk3 keep 11,11,13 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 11,11,13 then + return -1 +endi +sql drop database dbk3 +sql create database dbk4 keep 11,13,13 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 11,13,13 then + return -1 +endi +sql drop database dbk4 #sql_error create database $db keep 3651 # rows [200, 10000] diff --git a/tests/script/general/parser/create_db__for_community_version.sim b/tests/script/general/parser/create_db__for_community_version.sim new file mode 100644 index 0000000000..406e69b0e6 --- /dev/null +++ b/tests/script/general/parser/create_db__for_community_version.sim @@ -0,0 +1,238 @@ +system sh/stop_dnodes.sh + + +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c walLevel -v 1 +system sh/exec.sh -n dnode1 -s start + +sleep 100 +sql connect +print ======================== dnode1 start + +$dbPrefix = fi_in_db +$tbPrefix = fi_in_tb +$mtPrefix = fi_in_mt +$tbNum = 10 +$rowNum = 20 +$totalNum = 200 + +print excuting test script create_db.sim +print =============== set up +$i = 0 +$db = $dbPrefix . $i +$mt = $mtPrefix . $i + +sql_error createdatabase $db +sql create database $db +sql use $db +sql show databases + +if $rows != 1 then + return -1 +endi +if $data00 != $db then + return -1 +endi +sql drop database $db + +# case1: case_insensitivity test +print =========== create_db.sim case1: case insensitivity test +sql_error CREATEDATABASE $db +sql CREATE DATABASE $db +sql use $db +sql show databases + +if $rows != 1 then + return -1 +endi +if $data00 != $db then + return -1 +endi +sql drop database $db +print case_insensitivity test passed + +# case2: illegal_db_name test +print =========== create_db.sim case2: illegal_db_name test +$illegal_db1 = 1db +$illegal_db2 = d@b + +sql_error create database $illegal_db1 +sql_error create database $illegal_db2 +print illegal_db_name test passed + +# case3: chinese_char_in_db_name test +print ========== create_db.sim case3: chinese_char_in_db_name test +$CN_db1 = 数据库 +$CN_db2 = 数据库1 +$CN_db3 = db数据库1 +sql_error create database $CN_db1 +sql_error create database $CN_db2 +sql_error create database $CN_db3 +#sql show databases +#if $rows != 3 then +# return -1 +#endi +#if $data00 != $CN_db1 then +# return -1 +#endi +#if $data10 != $CN_db2 then +# return -1 +#endi +#if $data20 != $CN_db3 then +# return -1 +#endi +#sql drop database $CN_db1 +#sql drop database $CN_db2 +#sql drop database $CN_db3 +print case_chinese_char_in_db_name test passed + +# case4: db_already_exists +print create_db.sim case4: db_already_exists +sql create database db0 +sql create database db0 +sql show databases +if $rows != 1 then + return -1 +endi +sql drop database db0 +print db_already_exists test passed + +# case5: db_meta_data +print create_db.sim case5: db_meta_data test +# cfg params +$replica = 1 # max=3 +$days = 10 +$keep = 365 +$rows_db = 1000 +$cache = 16 # 16MB +$ablocks = 100 +$tblocks = 32 # max=512, automatically trimmed when exceeding +$ctime = 36000 # 10 hours +$wal = 1 # valid value is 1, 2 +$comp = 1 # max=32, automatically trimmed when exceeding + +sql create database $db replica $replica days $days keep $keep maxrows $rows_db cache $cache blocks 4 ctime $ctime wal $wal comp $comp +sql show databases +if $rows != 1 then + return -1 +endi +if $data00 != $db then + return -1 +endi +if $data04 != $replica then + return -1 +endi +if $data06 != $days then + return -1 +endi +if $data07 != 365 then + return -1 +endi +print data08 = $data07 +if $data08 != $cache then + print expect $cache, actual:$data08 + return -1 +endi +if $data09 != 4 then + return -1 +endi + +sql drop database $db + +## param range tests +# replica [1,3] +#sql_error create database $db replica 0 +sql_error create database $db replica 4 + +# day [1, 3650] +sql_error create database $db day 0 +sql_error create database $db day 3651 + +# keep [1, infinity] +sql_error create database $db keep 0 +sql_error create database $db keep 0,0,0 +sql_error create database $db keep 3,3,3 +sql_error create database $db keep 3 +sql_error create database $db keep 11.0 +sql_error create database $db keep 11.0,11.0,11.0 +sql_error create database $db keep "11","11","11" +sql_error create database $db keep "11" +sql_error create database $db keep 13,12,11 +sql_error create database $db keep 11,12,11 +sql_error create database $db keep 12,11,12 +sql_error create database $db keep 11,12,13 +sql_error create database $db keep 11,12,13,14 +sql_error create database $db keep 11,11 +sql_error create database $db keep 365001,365001,365001 +sql_error create database $db keep 365001 +sql create database dbk1 keep 11 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 11 then + return -1 +endi +sql drop database dbk1 +sql create database dbk2 keep 12 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 12 then + return -1 +endi +sql drop database dbk2 +sql create database dbk3 keep 11 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 11 then + return -1 +endi +sql drop database dbk3 +sql create database dbk4 keep 13 +sql show databases +if $rows != 1 then + return -1 +endi +if $data07 != 13 then + return -1 +endi +sql drop database dbk4 +#sql_error create database $db keep 3651 + +# rows [200, 10000] +sql_error create database $db maxrows 199 +#sql_error create database $db maxrows 10001 + +# cache [100, 10485760] +sql_error create database $db cache 0 +#sql_error create database $db cache 10485761 + + +# blocks [32, 4096 overwriten by 4096 if exceeds, Note added:2018-10-24] +#sql_error create database $db tblocks 31 +#sql_error create database $db tblocks 4097 + +# ctime [30, 40960] +sql_error create database $db ctime 29 +sql_error create database $db ctime 40961 + +# wal {0, 2} +#sql_error create database $db wal 0 +sql_error create database $db wal -1 +sql_error create database $db wal 3 + +# comp {0, 1, 2} +sql_error create database $db comp -1 +sql_error create database $db comp 3 + +sql_error drop database $db +sql show databases +if $rows != 0 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/general/parser/dbtbnameValidate.sim b/tests/script/general/parser/dbtbnameValidate.sim index bc3bfefafb..caa5f3aa6d 100644 --- a/tests/script/general/parser/dbtbnameValidate.sim +++ b/tests/script/general/parser/dbtbnameValidate.sim @@ -7,7 +7,7 @@ sleep 100 sql connect print ========== db name and table name check in create and drop, describe -sql create database abc keep 36500 +sql create database abc keep 36500,36500,36500 sql create database 'abc123' sql create database '_ab1234' sql create database 'ABC123' diff --git a/tests/script/general/parser/first_last.sim b/tests/script/general/parser/first_last.sim index f47f67ddc6..70c3e8a5f6 100644 --- a/tests/script/general/parser/first_last.sim +++ b/tests/script/general/parser/first_last.sim @@ -86,7 +86,7 @@ sleep 100 run general/parser/first_last_query.sim print =================> insert data regression test -sql create database test keep 36500 +sql create database test keep 36500,36500,36500 sql use test sql create table tm0 (ts timestamp, k int) @@ -124,4 +124,4 @@ if $rows != 10000 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 diff --git a/tests/script/general/parser/function.sim b/tests/script/general/parser/function.sim index 591d5d1535..11eb3fb2bd 100644 --- a/tests/script/general/parser/function.sim +++ b/tests/script/general/parser/function.sim @@ -21,7 +21,7 @@ $db = $dbPrefix . $i $mt = $mtPrefix . $i sql drop database if exists $db -sql create database $db keep 36500 +sql create database $db keep 36500,36500,36500 sql use $db print =====================================> td-4481 diff --git a/tests/script/general/parser/groupby.sim b/tests/script/general/parser/groupby.sim index 124e76e85c..8ded859669 100644 --- a/tests/script/general/parser/groupby.sim +++ b/tests/script/general/parser/groupby.sim @@ -29,7 +29,7 @@ $tstart = 100000 sql drop database if exists $db -x step1 step1: -sql create database if not exists $db keep 36500 +sql create database if not exists $db keep 36500,36500,36500 sql use $db 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)) diff --git a/tests/script/general/parser/join.sim b/tests/script/general/parser/join.sim index 2c14a86c3a..6142277e50 100644 --- a/tests/script/general/parser/join.sim +++ b/tests/script/general/parser/join.sim @@ -26,7 +26,7 @@ $tstart = 100000 sql drop database if exists $db -x step1 step1: -sql create database if not exists $db keep 36500 +sql create database if not exists $db keep 36500,36500,36500 sql use $db 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)) diff --git a/tests/script/general/parser/join_manyblocks.sim b/tests/script/general/parser/join_manyblocks.sim index fddd59c0a1..43936ee645 100644 --- a/tests/script/general/parser/join_manyblocks.sim +++ b/tests/script/general/parser/join_manyblocks.sim @@ -24,7 +24,7 @@ $tstart = 100000 sql drop database if exists $db -x step1 step1: -sql create database if not exists $db keep 36500 +sql create database if not exists $db keep 36500,36500,36500 sql use $db 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)) diff --git a/tests/script/general/parser/join_multivnode.sim b/tests/script/general/parser/join_multivnode.sim index c72b2c5b3e..4bafc0d0e9 100644 --- a/tests/script/general/parser/join_multivnode.sim +++ b/tests/script/general/parser/join_multivnode.sim @@ -24,7 +24,7 @@ $tstart = 100000 sql drop database if exists $db -x step1 step1: -sql create database if not exists $db keep 36500 +sql create database if not exists $db keep 36500,36500,36500 sql use $db 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)) @@ -367,4 +367,4 @@ if $data35 != 5 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 diff --git a/tests/script/general/parser/projection_limit_offset.sim b/tests/script/general/parser/projection_limit_offset.sim index ffbcb28ffd..2a93a179a2 100644 --- a/tests/script/general/parser/projection_limit_offset.sim +++ b/tests/script/general/parser/projection_limit_offset.sim @@ -23,7 +23,7 @@ $tstart = 100000 sql drop database if exists $db -x step1 step1: -sql create database if not exists $db keep 36500 +sql create database if not exists $db keep 36500,36500,36500 sql use $db 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)) diff --git a/tests/script/general/parser/select_with_tags.sim b/tests/script/general/parser/select_with_tags.sim index 9d5214bfaa..45507bf1e7 100644 --- a/tests/script/general/parser/select_with_tags.sim +++ b/tests/script/general/parser/select_with_tags.sim @@ -24,7 +24,7 @@ $tstart = 100000 sql drop database if exists $db -x step1 step1: -sql create database if not exists $db keep 36500 +sql create database if not exists $db keep 36500,36500,36500 sql use $db 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) @@ -902,4 +902,4 @@ sql_error select first(c1), count(*), t2, t1, tbname from select_tags_mt0 group #sql select count(c1) from select_tags_mt0 where c1=99 group by tbname; #sql select count(*),tbname from select_tags_mt0 group by tbname -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 diff --git a/tests/script/general/parser/sliding.sim b/tests/script/general/parser/sliding.sim index b2695ff95f..cbdcb2162a 100644 --- a/tests/script/general/parser/sliding.sim +++ b/tests/script/general/parser/sliding.sim @@ -29,7 +29,7 @@ $mt = $mtPrefix . $i sql drop database if exists $db -x step1 step1: -sql create database if not exists $db keep 36500 +sql create database if not exists $db keep 36500,36500,36500 sql use $db 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)) diff --git a/tests/script/general/parser/subInfrom.sim b/tests/script/general/parser/subInfrom.sim index e47831ee87..09ba4381ba 100644 --- a/tests/script/general/parser/subInfrom.sim +++ b/tests/script/general/parser/subInfrom.sim @@ -26,7 +26,7 @@ $stb = $stbPrefix . $i sql drop database $db -x step1 step1: -sql create database $db cache 16 maxrows 4096 keep 36500 +sql create database $db cache 16 maxrows 4096 keep 36500,36500,36500 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) diff --git a/tests/script/general/parser/topbot.sim b/tests/script/general/parser/topbot.sim index 5c61acb2ba..8a10fa2b41 100644 --- a/tests/script/general/parser/topbot.sim +++ b/tests/script/general/parser/topbot.sim @@ -25,7 +25,7 @@ $stb = $stbPrefix . $i sql drop database $db -x step1 step1: -sql create database $db cache 16 maxrows 4096 keep 36500 +sql create database $db cache 16 maxrows 4096 keep 36500,36500,36500 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) @@ -175,7 +175,7 @@ if $data21 != 2.10000 then endi print =====================td-1302 case -sql create database t1 keep 36500; +sql create database t1 keep 36500,36500,36500; sql use t1; sql create table test(ts timestamp, k int); sql insert into test values(29999, 1)(70000, 2)(80000, 3) @@ -194,7 +194,7 @@ if $rows != 3 then endi print ==============>td-1308 -sql create database db keep 36500; +sql create database db keep 36500,36500,36500; sql use db; sql create table stb (ts timestamp, c1 int, c2 binary(10)) tags(t1 binary(10)); @@ -377,4 +377,4 @@ sql_error select * from ttm2 where k<>null sql_error select * from ttm2 where k like null sql_error select * from ttm2 where k