From d2fafd71f72726c632da22a47e35923247550dc1 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 12 Aug 2020 15:11:15 +0800 Subject: [PATCH 1/3] [td-225] add some test cases. --- tests/script/general/parser/lastrow_query.sim | 4 ++++ tests/script/general/parser/testSuite.sim | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tests/script/general/parser/lastrow_query.sim b/tests/script/general/parser/lastrow_query.sim index e43cc15173..72e8b4de95 100644 --- a/tests/script/general/parser/lastrow_query.sim +++ b/tests/script/general/parser/lastrow_query.sim @@ -51,3 +51,7 @@ if $data09 != NCHAR then return -1 endi +sql select count(*) from lr_tb1 where ts>'2018-09-18 08:45:00.1' and ts<'2018-09-18 08:45:00.2' +if $row != 0 then + return -1 +endi diff --git a/tests/script/general/parser/testSuite.sim b/tests/script/general/parser/testSuite.sim index dd4faee959..ccd1aa9940 100644 --- a/tests/script/general/parser/testSuite.sim +++ b/tests/script/general/parser/testSuite.sim @@ -97,6 +97,8 @@ run general/parser/topbot.sim sleep 2000 run general/parser/union.sim sleep 2000 +run general/parser/bug.sim +sleep 2000 run general/parser/sliding.sim #sleep 2000 From 819ceda31f09502236b0a20801bb3df02ada9258 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Wed, 12 Aug 2020 22:45:10 +0800 Subject: [PATCH 2/3] update client test case --- tests/pytest/client/client.py | 8 +------ tests/pytest/client/version.py | 41 ++++++++++++++++++++++++++++++++++ tests/pytest/fulltest.sh | 1 + tests/pytest/regressiontest.sh | 1 + 4 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 tests/pytest/client/version.py diff --git a/tests/pytest/client/client.py b/tests/pytest/client/client.py index 6fd2a2b6bd..b40511094b 100644 --- a/tests/pytest/client/client.py +++ b/tests/pytest/client/client.py @@ -27,13 +27,7 @@ class TDTestCase: ret = tdSql.query('select database()') tdSql.checkData(0, 0, "db") - - ret = tdSql.query('select server_version()') - tdSql.checkData(0, 0, "2.0.0.0") - - ret = tdSql.query('select client_version()') - tdSql.checkData(0, 0, "2.0.0.0") - + ret = tdSql.query('select server_status()') tdSql.checkData(0, 0, 1) diff --git a/tests/pytest/client/version.py b/tests/pytest/client/version.py new file mode 100644 index 0000000000..bc2e58f106 --- /dev/null +++ b/tests/pytest/client/version.py @@ -0,0 +1,41 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +from util.log import * +from util.cases import * +from util.sql import * + + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + tdSql.prepare() + + ret = tdSql.query('select server_version()') + tdSql.checkData(0, 0, "2.0.0.6") + + ret = tdSql.query('select client_version()') + tdSql.checkData(0, 0, "2.0.0.6") + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index cbe82b2c8c..8e0f6314e0 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -158,6 +158,7 @@ python3 ./test.py -f alter/alter_table_crash.py # client python3 ./test.py -f client/client.py +python3 ./test.py -f client/version.py # Misc python3 testCompress.py diff --git a/tests/pytest/regressiontest.sh b/tests/pytest/regressiontest.sh index 61ec491f5d..20f4b4dc3b 100755 --- a/tests/pytest/regressiontest.sh +++ b/tests/pytest/regressiontest.sh @@ -152,6 +152,7 @@ python3 ./test.py -f alter/alter_table_crash.py # client python3 ./test.py -f client/client.py +python3 ./test.py -f client/version.py # Misc python3 testCompress.py From d7d840cc977059aafc1f59592b4c72e7984e95a2 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Wed, 12 Aug 2020 22:49:52 +0800 Subject: [PATCH 3/3] [td-225] remove invalid assert --- src/client/src/tscLocalMerge.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/src/tscLocalMerge.c b/src/client/src/tscLocalMerge.c index 8436777ddf..0733593284 100644 --- a/src/client/src/tscLocalMerge.c +++ b/src/client/src/tscLocalMerge.c @@ -1349,7 +1349,6 @@ static bool doHandleLastRemainData(SSqlObj *pSql) { ((pRes->numOfRowsGroup < pQueryInfo->limit.limit && pQueryInfo->limit.limit > 0) || (pQueryInfo->limit.limit < 0))) { int64_t etime = (pQueryInfo->window.skey < pQueryInfo->window.ekey) ? pQueryInfo->window.ekey : pQueryInfo->window.skey; - assert(pFillInfo->numOfRows == 0); int32_t rows = (int32_t)getFilledNumOfRes(pFillInfo, etime, pLocalReducer->resColModel->capacity); if (rows > 0) { // do interpo doFillResult(pSql, pLocalReducer, true);