summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-09-21 09:32:17 +0400
committerAlexander Barkov <bar@mariadb.com>2018-09-21 09:32:17 +0400
commitd533f6d58b0e4e4dace14227c6eb53e3c0b3232d (patch)
treef71cb30f6e548886d2272919b4e87201caa9db3e /mysql-test
parent80bcb05b2451b89dd7e1355c9fde97c115b4bcb3 (diff)
downloadmariadb-git-d533f6d58b0e4e4dace14227c6eb53e3c0b3232d.tar.gz
After-merge cleanup: adjust the test to work in 10.0
For the original test in 10.0 it was not really important if find_user_wild() or find_user_exact() is used in sp_grant_privileges(). sp-security.test passed with either of them. Fixing the test so it reliably fails with find_user_wild() and pass with find_user_exact().
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/sp-security.result4
-rw-r--r--mysql-test/t/sp-security.test11
2 files changed, 13 insertions, 2 deletions
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index a4e3505cf0f..4125762e622 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -618,7 +618,9 @@ SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
DROP USER user2@localhost;
DROP DATABASE db1;
create user foo@local_ost;
-create user foo@`local\_ost` identified by 'nevermore';
+create user foo@`local\_ost`;
+update mysql.user set plugin='foobar' where host='local\\_ost';
+flush privileges;
create database foodb;
grant create routine on foodb.* to foo@local_ost;
select user(), current_user();
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index 0f9243f30bb..53dc4f8c7ac 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -999,7 +999,16 @@ DROP DATABASE db1;
# Bug#27407480: AUTOMATIC_SP_PRIVILEGES REQUIRES NEED THE INSERT PRIVILEGES FOR MYSQL.USER TABLE
#
create user foo@local_ost;
-create user foo@`local\_ost` identified by 'nevermore';
+#
+# Create a user with an authentification plugin 'foobar'.
+# Instead of using a normal "CREATE USER <user> IDENTIFIED VIA <plugin>"
+# we do CREATE (without VIA) followed by UPDATE and FLUSH.
+# This is to avoid installing a real plugin and thus avoid the test dependency.
+# We won't login under this user in the below test, so this is fine.
+#
+create user foo@`local\_ost`;
+update mysql.user set plugin='foobar' where host='local\\_ost';
+flush privileges;
create database foodb;
grant create routine on foodb.* to foo@local_ost;
connect con1,localhost,foo;