提交 69a8be54 编写于 作者: P Ping Xiao

udpate tests cases for defects

上级 e11b3b2e
...@@ -365,6 +365,54 @@ class TDTestCase: ...@@ -365,6 +365,54 @@ class TDTestCase:
# _ for binary type on tag case 5 # _ for binary type on tag case 5
tdSql.query("select * from st where tagcol3 like '_据'") tdSql.query("select * from st where tagcol3 like '_据'")
tdSql.checkRows(0) tdSql.checkRows(0)
# test case for https://jira.taosdata.com:18080/browse/TD-857
tdSql.execute("create database test")
tdSql.execute("use test")
tdSql.execute("create table meters(ts timestamp, voltage int) tags(tag1 binary(20))")
tdSql.execute("create table t1 using meters tags('beijing')")
tdSql.execute("create table t2 using meters tags('nanjing')")
tdSql.execute("insert into t1 values(1538548685000, 1) (1538548685001, 2) (1538548685002, 3)")
tdSql.execute("insert into t2 values(1538548685000, 4) (1538548685001, 5) (1538548685002, 6)")
tdSql.query("select * from t1 where tag1 like '%g'")
tdSql.checkRows(3)
tdSql.query("select * from t2 where tag1 like '%g'")
tdSql.checkRows(3)
tdSql.query("select * from meters where tag1 like '%g'")
tdSql.checkRows(6)
tdSql.execute("create table meters1(ts timestamp, voltage int) tags(tag1 nchar(20))")
tdSql.execute("create table t3 using meters1 tags('北京')")
tdSql.execute("create table t4 using meters1 tags('南京')")
tdSql.execute("create table t5 using meters1 tags('beijing')")
tdSql.execute("create table t6 using meters1 tags('nanjing')")
tdSql.execute("insert into t3 values(1538548685000, 1) (1538548685001, 2) (1538548685002, 3)")
tdSql.execute("insert into t4 values(1538548685000, 4) (1538548685001, 5) (1538548685002, 6)")
tdSql.execute("insert into t5 values(1538548685000, 1) (1538548685001, 2) (1538548685002, 3)")
tdSql.execute("insert into t6 values(1538548685000, 1) (1538548685001, 2) (1538548685002, 3)")
tdSql.query("select * from t3 where tag1 like '%京'")
tdSql.checkRows(3)
tdSql.query("select * from t4 where tag1 like '%京'")
tdSql.checkRows(3)
tdSql.query("select * from meters1 where tag1 like '%京'")
tdSql.checkRows(6)
tdSql.query("select * from t5 where tag1 like '%g'")
tdSql.checkRows(3)
tdSql.query("select * from t6 where tag1 like '%g'")
tdSql.checkRows(3)
tdSql.query("select * from meters1 where tag1 like '%g'")
tdSql.checkRows(6)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
...@@ -114,6 +114,32 @@ class TDTestCase: ...@@ -114,6 +114,32 @@ class TDTestCase:
tdSql.error("select stb_t.ts, stb_t.dscrption, stb_t.temperature, stb_t.pid, stb_p.id, stb_p.dscrption, stb_p.pressure,stb_v.velocity from stb_p, stb_t, stb_v where stb_p.ts=stb_t.ts and stb_p.ts=stb_v.ts and stb_p.id = stb_t.id") tdSql.error("select stb_t.ts, stb_t.dscrption, stb_t.temperature, stb_t.pid, stb_p.id, stb_p.dscrption, stb_p.pressure,stb_v.velocity from stb_p, stb_t, stb_v where stb_p.ts=stb_t.ts and stb_p.ts=stb_v.ts and stb_p.id = stb_t.id")
# test case for https://jira.taosdata.com:18080/browse/TD-1250
tdSql.execute("create table meters1(ts timestamp, voltage int) tags(tag1 binary(20), tag2 nchar(20))")
tdSql.execute("create table t1 using meters1 tags('beijing', 'chaoyang')")
tdSql.execute("create table t2 using meters1 tags('shanghai', 'xuhui')")
tdSql.execute("insert into t1 values(1538548685000, 1) (1538548685001, 2) (1538548685002, 3)")
tdSql.execute("insert into t1 values(1538548685004, 4) (1538548685004, 5) (1538548685005, 6)")
tdSql.execute("create table meters2(ts timestamp, voltage int) tags(tag1 binary(20), tag2 nchar(20))")
tdSql.execute("create table t3 using meters2 tags('beijing', 'chaoyang')")
tdSql.execute("create table t4 using meters2 tags('shenzhen', 'nanshan')")
tdSql.execute("insert into t3 values(1538548685000, 7) (1538548685001, 8) (1538548685002, 9)")
tdSql.execute("insert into t4 values(1538548685000, 10) (1538548685001, 11) (1538548685002, 12)")
tdSql.execute("create table meters3(ts timestamp, voltage int) tags(tag1 binary(20), tag2 nchar(20))")
tdSql.query("select * from meters1, meters2 where meters1.ts = meters2.ts and meters1.tag1 = meters2.tag1")
tdSql.checkRows(3)
tdSql.query("select * from meters1, meters2 where meters1.ts = meters2.ts and meters1.tag2 = meters2.tag2")
tdSql.checkRows(3)
tdSql.query("select * from meters1, meters3 where meters1.ts = meters3.ts and meters1.tag1 = meters3.tag1")
tdSql.checkRows(0)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
...@@ -575,23 +575,6 @@ class TDTestCase: ...@@ -575,23 +575,6 @@ class TDTestCase:
# TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT # TSIM: system sh/exec.sh -n dnode1 -s stop -x SIGINT
# convert end # convert end
tdSql.execute("create database db")
tdSql.execute("use db")
tdSql.execute(
"create table if not exists st (ts timestamp, tagtype int) tags(dev float)")
tdSql.error(
'CREATE TABLE if not exists dev_001 using st tags(%f)' % -3.4E38 - 1)
tdSql.error(
'CREATE TABLE if not exists dev_001 using st tags(%f)' % 3.4E38 + 1)
tdSql.execute(
'CREATE TABLE if not exists dev_001 using st tags(%f)' % 3.4E38)
tdSql.execute(
'CREATE TABLE if not exists dev_002 using st tags(%f)' % -3.4E38)
tdSql.query("show tables")
tdSql.checkRows(2)
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.
先完成此消息的编辑!
想要评论请 注册