From 74f3902af081048b518b19e7a42d8b2c0740ae2d Mon Sep 17 00:00:00 2001 From: cpwu Date: Tue, 17 May 2022 17:48:49 +0800 Subject: [PATCH] fix case --- tests/system-test/2-query/union.py | 15 +++++++-------- tests/system-test/2-query/union2.py | 16 +++++++--------- tests/system-test/2-query/union3.py | 15 +++++++-------- tests/system-test/2-query/union4.py | 15 +++++++-------- 4 files changed, 28 insertions(+), 33 deletions(-) diff --git a/tests/system-test/2-query/union.py b/tests/system-test/2-query/union.py index bf01527b12..e0a138a4aa 100644 --- a/tests/system-test/2-query/union.py +++ b/tests/system-test/2-query/union.py @@ -221,8 +221,8 @@ class TDTestCase: for i in range(len(sqls)): tdSql.query(sqls[i]) res1_type = self.__get_type(0) - for j in range(sqls[i:]): - tdSql.query(sqls[j]) + for j in range(len(sqls[i:])): + tdSql.query(sqls[j+i]) union_type = False res2_type = self.__get_type(0) @@ -236,18 +236,17 @@ class TDTestCase: union_type = True if union_type: - tdSql.query(f"{sqls[i]} union {sqls[j]}") - tdSql.query(f"{sqls[j]} union {sqls[i]}") + tdSql.query(f"{sqls[i]} union {sqls[j+i]}") + tdSql.query(f"{sqls[j+i]} union {sqls[i]}") tdSql.checkCols(1) - tdSql.query(f"{sqls[i]} union all {sqls[j]}") - tdSql.query(f"{sqls[j]} union all {sqls[i]}") + tdSql.query(f"{sqls[i]} union all {sqls[j+i]}") + tdSql.query(f"{sqls[j+i]} union all {sqls[i]}") tdSql.checkCols(1) else: - tdSql.error(f"{sqls[i]} union {sqls[j]}") + tdSql.error(f"{sqls[i]} union {sqls[j+i]}") def __test_error(self): - tdSql.error( "show tables union show tables" ) tdSql.error( "create table errtb1 union all create table errtb2" ) tdSql.error( "drop table ct1 union all drop table ct3" ) diff --git a/tests/system-test/2-query/union2.py b/tests/system-test/2-query/union2.py index 68b1733106..a17a92de16 100644 --- a/tests/system-test/2-query/union2.py +++ b/tests/system-test/2-query/union2.py @@ -220,8 +220,8 @@ class TDTestCase: for i in range(len(sqls)): tdSql.query(sqls[i]) res1_type = self.__get_type(0) - for j in range(sqls[i:]): - tdSql.query(sqls[j]) + for j in range(len(sqls[i:])): + tdSql.query(sqls[j+i]) union_type = False res2_type = self.__get_type(0) @@ -235,19 +235,17 @@ class TDTestCase: union_type = True if union_type: - tdSql.query(f"{sqls[i]} union {sqls[j]}") - tdSql.query(f"{sqls[j]} union {sqls[i]}") + tdSql.query(f"{sqls[i]} union {sqls[j+i]}") + tdSql.query(f"{sqls[j+i]} union {sqls[i]}") tdSql.checkCols(1) - tdSql.query(f"{sqls[i]} union all {sqls[j]}") - tdSql.query(f"{sqls[j]} union all {sqls[i]}") + tdSql.query(f"{sqls[i]} union all {sqls[j+i]}") + tdSql.query(f"{sqls[j+i]} union all {sqls[i]}") tdSql.checkCols(1) else: - tdSql.error(f"{sqls[i]} union {sqls[j]}") - + tdSql.error(f"{sqls[i]} union {sqls[j+i]}") def __test_error(self): - tdSql.error( "show tables union show tables" ) tdSql.error( "create table errtb1 union all create table errtb2" ) tdSql.error( "drop table ct1 union all drop table ct3" ) diff --git a/tests/system-test/2-query/union3.py b/tests/system-test/2-query/union3.py index 94fd834184..cdc81015df 100644 --- a/tests/system-test/2-query/union3.py +++ b/tests/system-test/2-query/union3.py @@ -221,8 +221,8 @@ class TDTestCase: for i in range(len(sqls)): tdSql.query(sqls[i]) res1_type = self.__get_type(0) - for j in range(sqls[i:]): - tdSql.query(sqls[j]) + for j in range(len(sqls[i:])): + tdSql.query(sqls[j+i]) union_type = False res2_type = self.__get_type(0) @@ -236,18 +236,17 @@ class TDTestCase: union_type = True if union_type: - tdSql.query(f"{sqls[i]} union {sqls[j]}") - tdSql.query(f"{sqls[j]} union {sqls[i]}") + tdSql.query(f"{sqls[i]} union {sqls[j+i]}") + tdSql.query(f"{sqls[j+i]} union {sqls[i]}") tdSql.checkCols(1) - tdSql.query(f"{sqls[i]} union all {sqls[j]}") - tdSql.query(f"{sqls[j]} union all {sqls[i]}") + tdSql.query(f"{sqls[i]} union all {sqls[j+i]}") + tdSql.query(f"{sqls[j+i]} union all {sqls[i]}") tdSql.checkCols(1) else: - tdSql.error(f"{sqls[i]} union {sqls[j]}") + tdSql.error(f"{sqls[i]} union {sqls[j+i]}") def __test_error(self): - tdSql.error( "show tables union show tables" ) tdSql.error( "create table errtb1 union all create table errtb2" ) tdSql.error( "drop table ct1 union all drop table ct3" ) diff --git a/tests/system-test/2-query/union4.py b/tests/system-test/2-query/union4.py index 7a9a6e7e48..85befc9772 100644 --- a/tests/system-test/2-query/union4.py +++ b/tests/system-test/2-query/union4.py @@ -221,8 +221,8 @@ class TDTestCase: for i in range(len(sqls)): tdSql.query(sqls[i]) res1_type = self.__get_type(0) - for j in range(sqls[i:]): - tdSql.query(sqls[j]) + for j in range(len(sqls[i:])): + tdSql.query(sqls[j+i]) union_type = False res2_type = self.__get_type(0) @@ -236,18 +236,17 @@ class TDTestCase: union_type = True if union_type: - tdSql.query(f"{sqls[i]} union {sqls[j]}") - tdSql.query(f"{sqls[j]} union {sqls[i]}") + tdSql.query(f"{sqls[i]} union {sqls[j+i]}") + tdSql.query(f"{sqls[j+i]} union {sqls[i]}") tdSql.checkCols(1) - tdSql.query(f"{sqls[i]} union all {sqls[j]}") - tdSql.query(f"{sqls[j]} union all {sqls[i]}") + tdSql.query(f"{sqls[i]} union all {sqls[j+i]}") + tdSql.query(f"{sqls[j+i]} union all {sqls[i]}") tdSql.checkCols(1) else: - tdSql.error(f"{sqls[i]} union {sqls[j]}") + tdSql.error(f"{sqls[i]} union {sqls[j+i]}") def __test_error(self): - tdSql.error( "show tables union show tables" ) tdSql.error( "create table errtb1 union all create table errtb2" ) tdSql.error( "drop table ct1 union all drop table ct3" )