From 5495e1ceaceb7cfcad73e42dc4e0bd55522e0348 Mon Sep 17 00:00:00 2001 From: slzhou Date: Mon, 6 Nov 2023 12:33:09 +0800 Subject: [PATCH 1/3] fix: use the right target name --- source/libs/parser/src/parInsertSql.c | 2 +- tests/script/tsim/insert/insert_stb.sim | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/source/libs/parser/src/parInsertSql.c b/source/libs/parser/src/parInsertSql.c index 0d520b97f6..f50655f8e0 100644 --- a/source/libs/parser/src/parInsertSql.c +++ b/source/libs/parser/src/parInsertSql.c @@ -1757,7 +1757,7 @@ static int32_t processCtbAutoCreationAndCtbMeta(SInsertParseContext* pCxt, SVnod .requestId = pCxt->pComCxt->requestId, .requestObjRefId = pCxt->pComCxt->requestRid, .mgmtEps = pCxt->pComCxt->mgmtEpSet}; - code = catalogGetTableHashVgroup(pCxt->pComCxt->pCatalog, &conn, &pStmt->targetTableName, &vg); + code = catalogGetTableHashVgroup(pCxt->pComCxt->pCatalog, &conn, &pStbRowsCxt->ctbName, &vg); if (code == TSDB_CODE_SUCCESS) { taosHashPut(pStmt->pVgroupsHashObj, (const char*)(&vg.vgId), sizeof(vg.vgId), &vg, sizeof(vg)); pStbRowsCxt->pCtbMeta->uid = taosHashGetSize(pStmt->pSubTableHashObj) + 1; diff --git a/tests/script/tsim/insert/insert_stb.sim b/tests/script/tsim/insert/insert_stb.sim index 890d8937a5..5d9e244565 100644 --- a/tests/script/tsim/insert/insert_stb.sim +++ b/tests/script/tsim/insert/insert_stb.sim @@ -51,6 +51,21 @@ print $rows if $rows != 5 then return -1 endi + +sql create database dgxy; +sql use dgxy; +sql create table st(ts timestamp, f int) tags(t int); +sql insert into ct1 using st tags(1) values(now, 1); +sql insert into st(tbname, ts, f) values('ct1', now, 2); +sql select * from ct1; +if $rows != 2 then + return -1 +endi +sql show tables like 'ct1'; +if $rows != 1 then + return -1 +endi + sql_error insert into d2.st values(now, 1, 1) sql_error insert into d2.st(ts, f) values(now, 1); sql_error insert into d2.st(ts, f, tbname) values(now, 1); From 3f13ab7a20948e363510528288d59a2d5ed3ac05 Mon Sep 17 00:00:00 2001 From: slzhou Date: Mon, 6 Nov 2023 17:15:46 +0800 Subject: [PATCH 2/3] fix: fix test case --- tests/system-test/1-insert/insert_stb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system-test/1-insert/insert_stb.py b/tests/system-test/1-insert/insert_stb.py index 605bee7d8b..2cdd3ea7c2 100644 --- a/tests/system-test/1-insert/insert_stb.py +++ b/tests/system-test/1-insert/insert_stb.py @@ -176,7 +176,7 @@ class TDTestCase: tdSql.checkData(3, 2, 10) tdSql.checkData(4, 0, datetime.datetime(2021, 4, 19, 8, 0, 13)) tdSql.checkData(4, 1, 1) - tdSql.checkData(4, 2, None) + tdSql.checkData(4, 2, 1) def run_insert_stb(self): print("running {}".format('insert_stb')) From c716c737ec84f483ef17c31ac251d3fb1c44d975 Mon Sep 17 00:00:00 2001 From: slzhou Date: Mon, 6 Nov 2023 23:09:03 +0800 Subject: [PATCH 3/3] fix: increase taos-ws-py version to 0.3.1 --- tests/parallel_test/run_case.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh index 1c57ed9b30..0a94eb645f 100755 --- a/tests/parallel_test/run_case.sh +++ b/tests/parallel_test/run_case.sh @@ -81,10 +81,10 @@ pip3 list|grep taospy pip3 uninstall taospy -y pip3 install --default-timeout=120 taospy==2.7.12 -#define taos-ws-py 0.2.8 +#define taos-ws-py 0.3.1 pip3 list|grep taos-ws-py pip3 uninstall taos-ws-py -y -pip3 install --default-timeout=120 taos-ws-py==0.2.8 +pip3 install --default-timeout=120 taos-ws-py==0.3.1 $TIMEOUT_CMD $cmd RET=$?