few variables need reset after prepare called.
This commit is contained in:
parent
6e250f58ef
commit
ab47133213
|
@ -42,14 +42,17 @@ class TDTestCase:
|
||||||
('2020-05-13 10:00:00.005', 3, 'third')""")
|
('2020-05-13 10:00:00.005', 3, 'third')""")
|
||||||
|
|
||||||
# query with filter condition A OR condition B
|
# query with filter condition A OR condition B
|
||||||
tdSql.query("select * from db.st where ts > '2020-05-13 10:00:00.002' AND tagtype < 2")
|
tdSql.query(
|
||||||
|
"select * from db.st where ts > '2020-05-13 10:00:00.002' AND tagtype < 2")
|
||||||
tdSql.checkRows(1)
|
tdSql.checkRows(1)
|
||||||
|
|
||||||
# query with filter condition A OR condition B, error expected
|
# query with filter condition A OR condition B, error expected
|
||||||
tdSql.error("select * from db.st where ts > '2020-05-13 10:00:00.002' OR tagtype < 2")
|
tdSql.error(
|
||||||
|
"select * from db.st where ts > '2020-05-13 10:00:00.002' OR tagtype < 2")
|
||||||
|
|
||||||
# illegal condition
|
# illegal condition
|
||||||
tdSql.error("select * from db.st where ts != '2020-05-13 10:00:00.002' OR tagtype < 2")
|
tdSql.error(
|
||||||
|
"select * from db.st where ts != '2020-05-13 10:00:00.002' OR tagtype < 2")
|
||||||
tdSql.error("select * from db.st where tagtype <> 1 OR tagtype < 2")
|
tdSql.error("select * from db.st where tagtype <> 1 OR tagtype < 2")
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
|
|
@ -41,7 +41,6 @@ class TDTestCase:
|
||||||
('2020-05-13 10:00:00.002', 3, 'third') dev_002 VALUES('2020-05-13 10:00:00.003', 1, 'first'), ('2020-05-13 10:00:00.004', 2, 'second'),
|
('2020-05-13 10:00:00.002', 3, 'third') dev_002 VALUES('2020-05-13 10:00:00.003', 1, 'first'), ('2020-05-13 10:00:00.004', 2, 'second'),
|
||||||
('2020-05-13 10:00:00.005', 3, 'third')""")
|
('2020-05-13 10:00:00.005', 3, 'third')""")
|
||||||
|
|
||||||
|
|
||||||
# query first .. as ..
|
# query first .. as ..
|
||||||
tdSql.error("select first(*) as one from st")
|
tdSql.error("select first(*) as one from st")
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,12 @@ class TDTestCase:
|
||||||
|
|
||||||
print("==============step1")
|
print("==============step1")
|
||||||
|
|
||||||
tdSql.execute("create table stb1 (ts timestamp, c1 int, c2 float) tags(t1 int, t2 binary(10), t3 nchar(10))")
|
tdSql.execute(
|
||||||
tdSql.execute("insert into tb1 using stb1 tags(1,'tb1', '表1') values ('2020-04-18 15:00:00.000', 1, 0.1), ('2020-04-18 15:00:01.000', 2, 0.1)")
|
"create table stb1 (ts timestamp, c1 int, c2 float) tags(t1 int, t2 binary(10), t3 nchar(10))")
|
||||||
tdSql.execute("insert into tb2 using stb1 tags(2,'tb2', '表2') values ('2020-04-18 15:00:02.000', 3, 2.1), ('2020-04-18 15:00:03.000', 4, 2.2)")
|
tdSql.execute(
|
||||||
|
"insert into tb1 using stb1 tags(1,'tb1', '表1') values ('2020-04-18 15:00:00.000', 1, 0.1), ('2020-04-18 15:00:01.000', 2, 0.1)")
|
||||||
|
tdSql.execute(
|
||||||
|
"insert into tb2 using stb1 tags(2,'tb2', '表2') values ('2020-04-18 15:00:02.000', 3, 2.1), ('2020-04-18 15:00:03.000', 4, 2.2)")
|
||||||
|
|
||||||
# inner join --- bug
|
# inner join --- bug
|
||||||
tdSql.query("select * from tb1 a, tb2 b where a.ts = b.ts")
|
tdSql.query("select * from tb1 a, tb2 b where a.ts = b.ts")
|
||||||
|
|
|
@ -111,7 +111,6 @@ class Test (threading.Thread):
|
||||||
last_tb)
|
last_tb)
|
||||||
written = written + 1
|
written = written + 1
|
||||||
|
|
||||||
|
|
||||||
def drop_stable(self):
|
def drop_stable(self):
|
||||||
tdLog.info("drop_stable")
|
tdLog.info("drop_stable")
|
||||||
global last_stb
|
global last_stb
|
||||||
|
@ -152,7 +151,6 @@ class Test (threading.Thread):
|
||||||
last_tb = ""
|
last_tb = ""
|
||||||
written = 0
|
written = 0
|
||||||
|
|
||||||
|
|
||||||
def query_data_from_stable(self):
|
def query_data_from_stable(self):
|
||||||
tdLog.info("query_data_from_stable")
|
tdLog.info("query_data_from_stable")
|
||||||
global last_stb
|
global last_stb
|
||||||
|
@ -164,7 +162,6 @@ class Test (threading.Thread):
|
||||||
tdLog.info("will query data from super table")
|
tdLog.info("will query data from super table")
|
||||||
tdSql.execute('select * from %s' % last_stb)
|
tdSql.execute('select * from %s' % last_stb)
|
||||||
|
|
||||||
|
|
||||||
def reset_query_cache(self):
|
def reset_query_cache(self):
|
||||||
tdLog.info("reset_query_cache")
|
tdLog.info("reset_query_cache")
|
||||||
global last_tb
|
global last_tb
|
||||||
|
|
|
@ -111,7 +111,6 @@ class Test (threading.Thread):
|
||||||
last_tb)
|
last_tb)
|
||||||
written = written + 1
|
written = written + 1
|
||||||
|
|
||||||
|
|
||||||
def drop_stable(self):
|
def drop_stable(self):
|
||||||
tdLog.info("drop_stable")
|
tdLog.info("drop_stable")
|
||||||
global last_stb
|
global last_stb
|
||||||
|
@ -154,7 +153,6 @@ class Test (threading.Thread):
|
||||||
last_tb = ""
|
last_tb = ""
|
||||||
written = 0
|
written = 0
|
||||||
|
|
||||||
|
|
||||||
def query_data_from_stable(self):
|
def query_data_from_stable(self):
|
||||||
tdLog.info("query_data_from_stable")
|
tdLog.info("query_data_from_stable")
|
||||||
global last_stb
|
global last_stb
|
||||||
|
@ -166,7 +164,6 @@ class Test (threading.Thread):
|
||||||
tdLog.info("will query data from super table")
|
tdLog.info("will query data from super table")
|
||||||
tdSql.execute('select * from %s' % last_stb)
|
tdSql.execute('select * from %s' % last_stb)
|
||||||
|
|
||||||
|
|
||||||
def reset_query_cache(self):
|
def reset_query_cache(self):
|
||||||
tdLog.info("reset_query_cache")
|
tdLog.info("reset_query_cache")
|
||||||
global last_tb
|
global last_tb
|
||||||
|
|
|
@ -112,7 +112,6 @@ class Test:
|
||||||
tdSql.execute('drop table %s' % self.last_stb)
|
tdSql.execute('drop table %s' % self.last_stb)
|
||||||
self.last_stb = ""
|
self.last_stb = ""
|
||||||
|
|
||||||
|
|
||||||
def query_data_from_stable(self):
|
def query_data_from_stable(self):
|
||||||
tdLog.info("query_data_from_stable")
|
tdLog.info("query_data_from_stable")
|
||||||
if (self.last_stb == ""):
|
if (self.last_stb == ""):
|
||||||
|
@ -122,20 +121,21 @@ class Test:
|
||||||
tdLog.info("will query data from super table")
|
tdLog.info("will query data from super table")
|
||||||
tdSql.execute('select * from %s' % self.last_stb)
|
tdSql.execute('select * from %s' % self.last_stb)
|
||||||
|
|
||||||
|
|
||||||
def restart_database(self):
|
def restart_database(self):
|
||||||
tdLog.info("restart_databae")
|
tdLog.info("restart_databae")
|
||||||
tdDnodes.stop(1)
|
tdDnodes.stop(1)
|
||||||
tdDnodes.start(1)
|
tdDnodes.start(1)
|
||||||
tdLog.sleep(5)
|
tdLog.sleep(5)
|
||||||
|
|
||||||
|
|
||||||
def force_restart_database(self):
|
def force_restart_database(self):
|
||||||
tdLog.info("force_restart_database")
|
tdLog.info("force_restart_database")
|
||||||
tdDnodes.forcestop(1)
|
tdDnodes.forcestop(1)
|
||||||
tdDnodes.start(1)
|
tdDnodes.start(1)
|
||||||
tdLog.sleep(5)
|
tdLog.sleep(5)
|
||||||
tdSql.prepare()
|
tdSql.prepare()
|
||||||
|
self.last_tb = ""
|
||||||
|
self.last_stb = ""
|
||||||
|
self.written = 0
|
||||||
|
|
||||||
def drop_table(self):
|
def drop_table(self):
|
||||||
tdLog.info("drop_table")
|
tdLog.info("drop_table")
|
||||||
|
@ -159,6 +159,9 @@ class Test:
|
||||||
tdDnodes.start(1)
|
tdDnodes.start(1)
|
||||||
tdLog.sleep(5)
|
tdLog.sleep(5)
|
||||||
tdSql.prepare()
|
tdSql.prepare()
|
||||||
|
self.last_tb = ""
|
||||||
|
self.last_stb = ""
|
||||||
|
self.written = 0
|
||||||
|
|
||||||
def delete_datafiles(self):
|
def delete_datafiles(self):
|
||||||
tdLog.info("delete_datafiles")
|
tdLog.info("delete_datafiles")
|
||||||
|
@ -173,6 +176,9 @@ class Test:
|
||||||
tdDnodes.start(1)
|
tdDnodes.start(1)
|
||||||
tdLog.sleep(10)
|
tdLog.sleep(10)
|
||||||
tdSql.prepare()
|
tdSql.prepare()
|
||||||
|
self.last_tb = ""
|
||||||
|
self.last_stb = ""
|
||||||
|
self.written = 0
|
||||||
|
|
||||||
|
|
||||||
class TDTestCase:
|
class TDTestCase:
|
||||||
|
|
Loading…
Reference in New Issue