Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 63a5dbf

Browse files
committedJun 7, 2019
Fix Expired Passwords UT
1 parent b04fb66 commit 63a5dbf

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
 

‎test/unit/bugs/bugs.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,6 @@ void bugs::expired_pwd()
274274
{
275275
logMsg("bugs::expired_pwd");
276276

277-
//TODO: Enable it after fixing
278-
SKIP("Removed untill fixed");
279-
280277
if (getMySQLVersion(con) < 56006)
281278
{
282279
SKIP("The server does not support tested functionality(expired password)");
@@ -294,7 +291,7 @@ void bugs::expired_pwd()
294291
}
295292

296293
stmt->executeUpdate("CREATE USER ccpp_expired_pwd IDENTIFIED BY 'foo'");
297-
stmt->executeUpdate("GRANT ALL ON test to ccpp_expired_pwd");
294+
stmt->executeUpdate("GRANT ALL ON test.* to ccpp_expired_pwd");
298295
stmt->executeUpdate("ALTER USER ccpp_expired_pwd PASSWORD EXPIRE");
299296

300297
sql::ConnectOptionsMap opts;
@@ -345,7 +342,12 @@ void bugs::expired_pwd()
345342
}
346343

347344
// Now setting new password and getting fully functional connection
348-
opts["preInit"]= sql::SQLString("set password= password('bar')");
345+
if (getMySQLVersion(con) < 57006)
346+
opts["preInit"]= sql::SQLString("set password= password('bar')");
347+
else
348+
opts["preInit"]= sql::SQLString("ALTER USER 'ccpp_expired_pwd' IDENTIFIED BY 'bar';");
349+
350+
349351

350352
// Connect should go thru fine
351353
try

0 commit comments

Comments
 (0)
Failed to load comments.