diff --git a/Jenkinsfile2 b/Jenkinsfile2 index 9c28489a39dbb843dfd95e583b9d3b9a1b9046ae..99058b725796e5142d538ae0981930d5836d94cc 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -387,7 +387,7 @@ pipeline { } steps { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - timeout(time: 75, unit: 'MINUTES'){ + timeout(time: 86, unit: 'MINUTES'){ pre_test_win() pre_test_build_win() run_win_ctest() diff --git a/source/util/src/tutil.c b/source/util/src/tutil.c index 1f9ca7407e51240680466f736cb1cf4d3914b531..6d95660103e2c78203e7531af927e8d59ae4c358 100644 --- a/source/util/src/tutil.c +++ b/source/util/src/tutil.c @@ -468,7 +468,7 @@ size_t tstrncspn(const char *str, size_t size, const char *reject, size_t rsize) c3 = p[s[j + 3]]; if ((c0 | c1 | c2 | c3) != 0) { - size_t count = ((i + 1) >> 2); + size_t count = i * 4; return (c0 | c1) != 0 ? count - c0 + 1 : count - c2 + 3; } } diff --git a/source/util/test/utilTests.cpp b/source/util/test/utilTests.cpp index a35512541089863b66bb69dc95f8ad95504b847e..ff1d91aa9de72bd024520a859f16822078a74ef1 100644 --- a/source/util/test/utilTests.cpp +++ b/source/util/test/utilTests.cpp @@ -294,6 +294,10 @@ TEST(utilTest, tstrncspn) { const char* reject5 = "911"; v = tstrncspn(p2, strlen(p2), reject5, 0); ASSERT_EQ(v, 14); + + const char* reject6 = "Kk"; + v = tstrncspn(p2, strlen(p2), reject6, 2); + ASSERT_EQ(v, 10); } TEST(utilTest, intToHextStr) { @@ -322,4 +326,4 @@ TEST(utilTest, intToHextStr) { sprintf(destBuf, "%" PRIx64, v); ASSERT_STREQ(buf, destBuf); } -} \ No newline at end of file +} diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index a24efeac5fcbdcda9257961d2bbccaead8ce54a4..2fd1d02de10bdc5233e6eb3c6ebee3051c0d2115 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -168,6 +168,7 @@ ,,y,script,./test.sh -f tsim/parser/union.sim ,,y,script,./test.sh -f tsim/parser/union_sysinfo.sim ,,y,script,./test.sh -f tsim/parser/where.sim +,,y,script,./test.sh -f tsim/query/tagLikeFilter.sim ,,y,script,./test.sh -f tsim/query/charScalarFunction.sim ,,y,script,./test.sh -f tsim/query/explain.sim ,,y,script,./test.sh -f tsim/query/interval-offset.sim diff --git a/tests/script/tsim/query/tagLikeFilter.sim b/tests/script/tsim/query/tagLikeFilter.sim new file mode 100644 index 0000000000000000000000000000000000000000..79c1bc7c0bda151b0613689e0081735e6f0372f8 --- /dev/null +++ b/tests/script/tsim/query/tagLikeFilter.sim @@ -0,0 +1,36 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect + +sql drop database if exists db1; +sql create database if not exists db1 vgroups 10; +sql use db1; +sql create stable sta (ts timestamp, f1 double, f2 binary(200)) tags(t1 binary(100)); +sql create table tba1 using sta tags('ZQMPvstuzZVzCRjFTQawILuGSqZKSqlJwcBtZMxrAEqBbzChHWVDMiAZJwESzJAf'); +sql create table tba2 using sta tags('ieofwehughkreghughuerugu34jf9340aieefjalie28ffj8fj8fafjaekdfjfii'); +sql create table tba3 using sta tags('ZQMPvstuzZVzCRjFTQawILuGSqabSqlJwcBtZMxrAEqBbzChHWVDMiAZJwESzJAf'); +sql insert into tba1 values ('2022-04-26 15:15:01', 1.0, "a"); +sql insert into tba2 values ('2022-04-26 15:15:01', 1.0, "a"); +sql insert into tba2 values ('2022-04-26 15:15:02', 1.0, "a"); +sql insert into tba3 values ('2022-04-26 15:15:01', 1.0, "a"); +sql insert into tba3 values ('2022-04-26 15:15:02', 1.0, "a"); +sql insert into tba3 values ('2022-04-26 15:15:03', 1.0, "a"); +sql select t1 from sta where t1 like '%ab%'; +if $rows != 3 then + return -1 +endi +sql select t1 from sta where t1 like '%ax%'; +if $rows != 0 then + return -1 +endi +sql select t1 from sta where t1 like '%cd%'; +if $rows != 0 then + return -1 +endi +sql select t1 from sta where t1 like '%ii'; +if $rows != 2 then + return -1 +endi + +system sh/exec.sh -n dnode1 -s stop -x SIGINT