未验证 提交 08810f73 编写于 作者: H Hui Li 提交者: GitHub

Merge pull request #14217 from taosdata/cases/TS-1438

test: add test cases for case sensitive
...@@ -73,6 +73,10 @@ class TDTestCase: ...@@ -73,6 +73,10 @@ class TDTestCase:
sql = tdSql.getData(0, 1) sql = tdSql.getData(0, 1)
tdSql.checkEqual(True, sql.startswith("CREATE DATABASE `电力系统`")) tdSql.checkEqual(True, sql.startswith("CREATE DATABASE `电力系统`"))
tdSql.error("create database ``")
tdSql.execute("create database ` `")
tdSql.error("create database ` `")
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
...@@ -159,6 +159,22 @@ class TDTestCase: ...@@ -159,6 +159,22 @@ class TDTestCase:
tdSql.query("select ts `时间戳` from tt3") tdSql.query("select ts `时间戳` from tt3")
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.error("create table tt4(`` timestamp, c1 int)")
tdSql.error("create table tt4(` ` timestamp, ` ` int)")
tdSql.error("create table tt4(`tb1` timestamp, `tb1` int)")
ts = 1656040651000
tdSql.execute("create table `T4`(` ` timestamp, c1 int, `C1` int)")
tdSql.execute("insert into `T4`(` `, `C1`) values(%d, 1)" % ts)
tdSql.query("select * from `T4`")
tdSql.checkRows(1)
tdSql.execute("delete from `T4` where ` ` = '2022-06-24 11:17:31.000'")
tdSql.query("select * from `T4`")
tdSql.checkRows(0)
tdSql.error("alter table `T4` add column `` double")
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
...@@ -56,6 +56,26 @@ class TDTestCase: ...@@ -56,6 +56,26 @@ class TDTestCase:
tdSql.query("describe `STB5`") tdSql.query("describe `STB5`")
tdSql.checkRows(5) tdSql.checkRows(5)
ts = 1656040651000
tdSql.error("create table `STB6`(ts timestamp, c1 int) tags(`` int)")
tdSql.error("create table `STB6`(ts timestamp, c1 int) tags(` ` int, ` ` binary(20))")
tdSql.execute("create table `STB6`(ts timestamp, c1 int) tags(` ` int)")
tdSql.execute("insert into tb6 using `STB6` tags(1) values(%d, 1)(%d, 2)(%d, 3)" % (ts, ts + 1000, ts + 2000))
tdSql.execute("insert into tb7 using `STB6` tags(2) values(%d, 1)(%d, 2)(%d, 3)" % (ts, ts + 1000, ts + 2000))
tdSql.query("select * from `STB6`")
tdSql.checkRows(6)
tdSql.execute("delete from `STB6` where ` ` = 1 and ts = '2022-06-24 11:17:31.000'")
tdSql.checkAffectedRows(1)
tdSql.query("select * from `STB6`")
tdSql.checkRows(5)
tdSql.execute("delete from `STB6` where ` ` = 2")
tdSql.checkAffectedRows(3)
tdSql.query("select * from `STB6`")
tdSql.checkRows(2)
tdSql.error("alter table `STB6` add tag `` nchar(20)")
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)
......
...@@ -120,6 +120,19 @@ class TDTestCase: ...@@ -120,6 +120,19 @@ class TDTestCase:
tdSql.query("show create table `普通表`") tdSql.query("show create table `普通表`")
tdSql.checkData(0, 1, "CREATE TABLE `普通表` (`ts` TIMESTAMP,`c1` INT)") tdSql.checkData(0, 1, "CREATE TABLE `普通表` (`ts` TIMESTAMP,`c1` INT)")
tdSql.error("create table `` (ts timestamp, c1 int)")
tdSql.execute("create table ` ` (ts timestamp, c1 int)")
tdSql.error("create table ` ` (ts timestamp, c1 int)")
ts = 1656040651000
tdSql.execute("insert into ` ` values(%d, 1)" % ts)
tdSql.query("select * from ` `")
tdSql.checkRows(1)
tdSql.execute("delete from ` `")
tdSql.checkAffectedRows(1)
tdSql.query("select * from ` `")
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__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册