From 3fb2d7656d2d39941aaa25b29759a7dd9bf81f0e Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 5 May 2023 13:39:37 +0800 Subject: [PATCH] fix:[TS-3303]use stable name + child table name as key to save uid to avoid multi items for one table in submit block --- tests/system-test/2-query/sml.py | 2 ++ utils/test/c/sml_test.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/tests/system-test/2-query/sml.py b/tests/system-test/2-query/sml.py index 519957f6f9..2f97118fbf 100644 --- a/tests/system-test/2-query/sml.py +++ b/tests/system-test/2-query/sml.py @@ -35,6 +35,8 @@ class TDTestCase: tdLog.info("sml_test ret != 0") tdSql.query(f"select * from ts3303.stb2") + tdSql.query(f"select * from ts3303.meters") + # tdSql.execute('use sml_db') tdSql.query(f"select * from {dbname}.t_b7d815c9222ca64cdf2614c61de8f211") tdSql.checkRows(1) diff --git a/utils/test/c/sml_test.c b/utils/test/c/sml_test.c index ffcd5d1b2e..f1dc8ebe79 100644 --- a/utils/test/c/sml_test.c +++ b/utils/test/c/sml_test.c @@ -1183,6 +1183,11 @@ int sml_ts3303_Test() { "stb2,t1=4,dataModelName=t0 f1=72i32 1629717140000", }; + const char *sql1[] = { + "meters,location=California.LosAngeles,groupid=2 current=11.8,voltage=221,phase=\"2022-02-0210:22:22\" 1626006833339000000", + "meters,groupid=2,location=California.LosAngeles current=11.8,voltage=221,phase=\"2022-02-0210:22:22\" 1626006833339000000", + }; + pRes = taos_query(taos, "use ts3303"); taos_free_result(pRes); @@ -1190,8 +1195,16 @@ int sml_ts3303_Test() { TSDB_SML_TIMESTAMP_MILLI_SECONDS, 20); int code = taos_errno(pRes); + printf("%s result0:%s\n", __FUNCTION__, taos_errstr(pRes)); + taos_free_result(pRes); + ASSERT(code == 0); + + pRes = taos_schemaless_insert_ttl(taos, (char **)sql1, sizeof(sql1) / sizeof(sql1[0]), TSDB_SML_LINE_PROTOCOL, + TSDB_SML_TIMESTAMP_NANO_SECONDS, 20); + printf("%s result1:%s\n", __FUNCTION__, taos_errstr(pRes)); taos_free_result(pRes); + taos_close(taos); return code;