Skip to content

Commit 35e4c24

Browse files
committed
Use DROP USER in test
DROP USER existed in 5.6 http://www.asktheway.org/official-documents/mysql/refman-5.6-en.html-chapter/sql-statements.html#drop-user 5.7 and MariaDB versions support an IF EXISTS option. https://jira.mariadb.org/browse/MDEV-7288 Using executable comment syntax we can make it compatible. When using DROP USER, like all user modifications, FLUSH PRIVILEGES isn't required.
1 parent 884ef87 commit 35e4c24

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/conn/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,10 +1552,9 @@ mod test {
15521552
.map(|x| ((x % (123 - 97)) + 97) as char)
15531553
.collect();
15541554

1555-
conn.query_drop("DELETE FROM mysql.user WHERE user = '__mats'")
1555+
conn.query_drop("DROP USER /*!50700 IF EXISTS */ /*M!100103 IF EXISTS */ __mats")
15561556
.await
15571557
.unwrap();
1558-
conn.query_drop("FLUSH PRIVILEGES").await.unwrap();
15591558

15601559
if conn.inner.is_mariadb || conn.server_version() < (5, 7, 0) {
15611560
if matches!(conn.server_version(), (5, 6, _)) {
@@ -1587,8 +1586,6 @@ mod test {
15871586
.unwrap();
15881587
};
15891588

1590-
conn.query_drop("FLUSH PRIVILEGES").await.unwrap();
1591-
15921589
let mut conn2 = Conn::new(get_opts().secure_auth(false)).await.unwrap();
15931590
conn2
15941591
.change_user(

0 commit comments

Comments
 (0)