add test case for \G, >> in sql, excute in shell
This commit is contained in:
parent
9f4f340622
commit
05eb328b22
|
@ -840,6 +840,7 @@ e
|
|||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/blockSMA.py -Q 4
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/projectionDesc.py -Q 4
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/odbc.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/ts-4233.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/fill_with_group.py
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-21561.py -Q 4
|
||||
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
|
||||
import taos
|
||||
|
||||
from util.log import *
|
||||
from util.sql import *
|
||||
from util.cases import *
|
||||
from util.dnodes import *
|
||||
from util.common import *
|
||||
|
||||
class TDTestCase:
|
||||
def init(self, conn, logSql, replicaVar=1):
|
||||
self.replicaVar = int(replicaVar)
|
||||
tdLog.debug(f"start to excute {__file__}")
|
||||
tdSql.init(conn.cursor(), True)
|
||||
|
||||
def checksql(self, sql):
|
||||
result = os.popen("taos -s '%s'" %sql)
|
||||
res = result.read()
|
||||
print(res)
|
||||
if ("Query OK" in res):
|
||||
tdLog.info(f"checkEqual success")
|
||||
else :
|
||||
tdLog.exit(f"checkEqual error")
|
||||
|
||||
def check(self):
|
||||
conn = taos.connect()
|
||||
sql = "select 'a;b' as x"
|
||||
tdSql.query(f"%s" %sql)
|
||||
tdSql.checkRows(1)
|
||||
|
||||
self.checksql('select "a;b" as x\G')
|
||||
self.checksql('select "a;b" as x >> /tmp/res.txt')
|
||||
return
|
||||
|
||||
def run(self):
|
||||
tdSql.prepare()
|
||||
self.check()
|
||||
|
||||
def stop(self):
|
||||
tdSql.close()
|
||||
tdLog.success(f"{__file__} successfully executed")
|
||||
|
||||
|
||||
|
||||
tdCases.addLinux(__file__, TDTestCase())
|
||||
tdCases.addWindows(__file__, TDTestCase())
|
Loading…
Reference in New Issue