提交 e2c2a7a2 编写于 作者: P Ping Xiao

[TD-6425]<test>: add test case for join result more than 1MB

上级 882e495d
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
import sys import sys
import taos import taos
import string
import random
from util.log import * from util.log import *
from util.cases import * from util.cases import *
from util.sql import * from util.sql import *
...@@ -23,6 +25,11 @@ class TDTestCase: ...@@ -23,6 +25,11 @@ class TDTestCase:
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor()) 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): def run(self):
tdSql.prepare() tdSql.prepare()
...@@ -186,6 +193,20 @@ class TDTestCase: ...@@ -186,6 +193,20 @@ class TDTestCase:
tdSql.query("select t1.ts from t0,t1 where t0.ts = t1.ts") tdSql.query("select t1.ts from t0,t1 where t0.ts = t1.ts")
tdSql.checkData(0,0,'2018-10-03 14:38:05.000000') 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): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册