fix: create user no read privilage on enterprise version

This commit is contained in:
Alex Duan 2025-03-13 17:40:13 +08:00
parent 4078c58ee7
commit fbc274b41a
1 changed files with 7 additions and 4 deletions

View File

@ -217,18 +217,21 @@ class TDTestCase(TBase):
# password
def checkPassword(self, tmpdir):
# 255 char max password
user = "dkj"
pwd = ""
pwdFile = "cmdline/data/pwdMax.txt"
with open(pwdFile) as file:
pwd = file.readline()
sql = f"create user dkj pass '{pwd}' "
sql = f"create user {user} pass '{pwd}' "
tdSql.execute(sql)
# enterprise must set
sql = f"grant read on test to {user}"
tdSql.execute(sql)
pwd = "taosdata"
cmds = [
f"-uroot -p{pwd} -D test -o {tmpdir}", # command pass
f"-uroot -p < {pwdFile} -D test -o {tmpdir}" # input pass
f"-u{user} -p{pwd} -D test -o {tmpdir}", # command pass
f"-u{user} -p < {pwdFile} -D test -o {tmpdir}" # input pass
]
for cmd in cmds: