From 1431f19d646dee3914e52172957877afb6ad7d77 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 19 May 2020 02:58:05 +0000 Subject: [PATCH] [TD-362] reproduce error --- src/mnode/src/mgmtTable.c | 4 +-- tests/script/general/http/autocreate.sim | 28 +++++++++++++++++++++ tests/script/general/table/column_value.sim | 6 ++--- tests/script/general/tag/create.sim | 2 +- 4 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 tests/script/general/http/autocreate.sim diff --git a/src/mnode/src/mgmtTable.c b/src/mnode/src/mgmtTable.c index 3043306978..7b5b2ca8ed 100644 --- a/src/mnode/src/mgmtTable.c +++ b/src/mnode/src/mgmtTable.c @@ -1252,7 +1252,7 @@ static void mgmtGetSuperTableMeta(SQueuedMsg *pMsg) { pMeta->contLen = htons(pMeta->contLen); rpcSendResponse(&rpcRsp); - mTrace("stable:%%s, uid:%" PRIu64 " table meta is retrieved", pTable->info.tableId, pTable->uid); + mTrace("stable:%s, uid:%" PRIu64 " table meta is retrieved", pTable->info.tableId, pTable->uid); } static void mgmtProcessSuperTableVgroupMsg(SQueuedMsg *pMsg) { @@ -1759,7 +1759,7 @@ static void mgmtAutoCreateChildTable(SQueuedMsg *pMsg) { newMsg->msgType = TSDB_MSG_TYPE_CM_CREATE_TABLE; newMsg->pCont = pCreateMsg; - mTrace("table:%s, start to create on demand", pInfo->tableId); + mTrace("table:%s, start to create on demand, stable:%s", pInfo->tableId, pInfo->tags); mgmtAddToShellQueue(newMsg); } diff --git a/tests/script/general/http/autocreate.sim b/tests/script/general/http/autocreate.sim new file mode 100644 index 0000000000..7c1fdcd0f8 --- /dev/null +++ b/tests/script/general/http/autocreate.sim @@ -0,0 +1,28 @@ +system sh/stop_dnodes.sh +sleep 3000 +system sh/deploy.sh -n dnode1 -i 1 +system sh/cfg.sh -n dnode1 -c wallevel -v 0 +system sh/cfg.sh -n dnode1 -c http -v 1 +system sh/cfg.sh -n dnode1 -c httpEnableRecordSql -v 1 +system sh/exec.sh -n dnode1 -s start + +sleep 3000 +sql connect + +print ============================ dnode1 start + +print =============== step1 - prepare data +sql create database db +sql use db +sql create table if not exists db.win_cpu(ts timestamp,f_percent_dpc_time double,f_percent_idle_time double,f_percent_interrupt_time double,f_percent_privileged_time double,f_percent_processor_time double,f_percent_user_time double) tags(t_host binary(32),t_instance binary(32),t_objectname binary(32)); + +print =============== step2 - auto create + +system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'import into db.win_cpu_windows_1_processor using db.win_cpu tags('windows','1','Processor') values(1564641722000,0.000000,95.598305,0.000000,0.000000,0.000000,0.000000);' 127.0.0.1:6020/rest/sql +print curl 127.0.0.1:6020/rest/sql -----> $system_content +#if $system_content != @{"status":"succ","head":["ts","i"],"data":[["2017-12-25 21:28:41.022",1],["2017-12-25 21:28:42.022",2],["2017-12-25 21:28:43.022",3],["2017-12-25 21:28:44.022",4],["2017-12-25 21:28:45.022",5],["2017-12-25 21:28:46.022",6],["2017-12-25 21:28:47.022",7],["2017-12-25 21:28:48.022",8],["2017-12-25 21:28:49.022",9],["2017-12-25 21:28:50.022",10],["2017-12-25 21:28:51.022",11]],"rows":11}@ then +# return -1 +#endi + + +#system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file diff --git a/tests/script/general/table/column_value.sim b/tests/script/general/table/column_value.sim index 72f5faee63..117c288b36 100644 --- a/tests/script/general/table/column_value.sim +++ b/tests/script/general/table/column_value.sim @@ -60,11 +60,9 @@ if $rows != 0 then endi print =============== step4 -sql create table $tb (ts timestamp, speed double, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) -x step4 - return -1 -step4: +sql create table $tb (ts timestamp, speed double, v1 binary(1500), v2 binary(1500), v3 binary(1500), v4 binary(500), v5 binary(500)) sql show tables -if $rows != 0 then +if $rows != 1 then return -1 endi diff --git a/tests/script/general/tag/create.sim b/tests/script/general/tag/create.sim index 3e16810f91..adbb14e88a 100644 --- a/tests/script/general/tag/create.sim +++ b/tests/script/general/tag/create.sim @@ -579,7 +579,7 @@ $i = 30 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(250), tgcol2 binary(250), tgcol3 binary(30)) -x step30 - return -1 +# return -1 step30: print =============== step31 -- GitLab