Skip to content

Commit

Permalink
feat: taosdump add rename database option -W case
Browse files Browse the repository at this point in the history
  • Loading branch information
DuanKuanJun committed Sep 13, 2023
1 parent 97542a1 commit aa65243
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions tests/taosdump/native/taosdumpDbNtb.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,21 @@ def run(self):
tdSql.execute("drop database db")
# sys.exit(1)

os.system("%s -i %s -T 1" % (binPath, self.tmpdir))
os.system("%s -i %s -T 1 -W db=newdb" % (binPath, self.tmpdir))

tdSql.query("show databases")
dbresult = tdSql.queryResult

found = False
for i in range(len(dbresult)):
print("Found db: %s" % dbresult[i][0])
if dbresult[i][0] == "db":
if dbresult[i][0] == "newdb":
found = True
break

assert found == True

tdSql.execute("use db")
tdSql.execute("use newdb")
tdSql.query("show stables")
tdSql.checkRows(1)
tdSql.checkData(0, 0, "st")
Expand Down
6 changes: 3 additions & 3 deletions tests/taosdump/native/taosdumpDbStb.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,21 @@ def run(self):
tdSql.execute("drop database db")
# sys.exit(1)

os.system("%s -i %s -T 1" % (binPath, self.tmpdir))
os.system("%s -i %s -T 1 -W db=newdb" % (binPath, self.tmpdir))

tdSql.query("show databases")
dbresult = tdSql.queryResult

found = False
for i in range(len(dbresult)):
print("Found db: %s" % dbresult[i][0])
if dbresult[i][0] == "db":
if dbresult[i][0] == "newdb":
found = True
break

assert found == True

tdSql.execute("use db")
tdSql.execute("use newdb")
tdSql.query("show stables")
tdSql.checkRows(1)
tdSql.checkData(0, 0, "st")
Expand Down
6 changes: 3 additions & 3 deletions tests/taosdump/native/taosdumpDbWithNonRoot.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,21 +109,21 @@ def run(self):
tdSql.execute("drop database db")
# sys.exit(1)

os.system("%s -i %s -T 1" % (binPath, self.tmpdir))
os.system("%s -i %s -T 1 -W db=newdb" % (binPath, self.tmpdir))

tdSql.query("show databases")
dbresult = tdSql.queryResult

found = False
for i in range(len(dbresult)):
print("Found db: %s" % dbresult[i][0])
if dbresult[i][0] == "db":
if dbresult[i][0] == "newdb":
found = True
break

assert found == True

tdSql.execute("use db")
tdSql.execute("use newdb")
tdSql.query("show stables")
tdSql.checkRows(1)
tdSql.checkData(0, 0, "st")
Expand Down
6 changes: 3 additions & 3 deletions tests/taosdump/native/taosdumpEscapedDb.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@ def run(self):
tdSql.execute("drop database `Db`")
# sys.exit(1)

os.system("%s -e -i %s -T 1" % (binPath, self.tmpdir))
os.system("%s -e -i %s -T 1 -W Db=NewDb" % (binPath, self.tmpdir))

tdSql.query("show databases")
dbresult = tdSql.queryResult

found = False
for i in range(len(dbresult)):
print("Found db: %s" % dbresult[i][0])
if dbresult[i][0] == "Db":
if dbresult[i][0] == "NewDb":
found = True
break

assert found == True

tdSql.execute("use `Db`")
tdSql.execute("use `NewDb`")
tdSql.query("show stables")
tdSql.checkRows(1)
tdSql.checkData(0, 0, "st")
Expand Down

0 comments on commit aa65243

Please sign in to comment.