From e2c2a7a2748d2aff4f1b553c6d5e9db6f1ccdeb2 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Tue, 7 Sep 2021 14:14:17 +0800 Subject: [PATCH] [TD-6425]: add test case for join result more than 1MB --- tests/pytest/query/queryJoin.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/pytest/query/queryJoin.py b/tests/pytest/query/queryJoin.py index cd50a7bf45..6d028049e5 100644 --- a/tests/pytest/query/queryJoin.py +++ b/tests/pytest/query/queryJoin.py @@ -13,6 +13,8 @@ import sys import taos +import string +import random from util.log import * from util.cases import * from util.sql import * @@ -23,6 +25,11 @@ class TDTestCase: tdLog.debug("start to execute %s" % __file__) tdSql.init(conn.cursor()) + def get_random_string(self, length): + letters = string.ascii_lowercase + result_str = ''.join(random.choice(letters) for i in range(length)) + return result_str + def run(self): tdSql.prepare() @@ -186,6 +193,20 @@ class TDTestCase: tdSql.query("select t1.ts from t0,t1 where t0.ts = t1.ts") tdSql.checkData(0,0,'2018-10-03 14:38:05.000000') + #TD-6425 join result more than 1MB + tdSql.execute("create database test_join") + tdSql.execute("use test_join") + + ts = 1538548685000 + tdSql.execute("create table stb(ts timestamp, c1 nchar(200)) tags(id int, loc binary(20))") + for i in range(2): + tdSql.execute("create table tb%d using stb tags(1, 'city%d')" % (i, i)) + for j in range(1000): + tdSql.execute("insert into tb%d values(%d, '%s')" % (i, ts + j, self.get_random_string(200))) + + tdSql.query("select tb0.c1, tb1.c1 from tb0, tb1 where tb0.ts = tb1.ts") + tdSql.checkRows(1000) + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__) -- GitLab