summaryrefslogtreecommitdiff
path: root/mysql-test/t/change_user.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-05-14 23:45:32 +0200
committerSergei Golubchik <sergii@pisem.net>2010-05-14 23:45:32 +0200
commit3b98d69d689efcaba97476f34537fde24cfd5451 (patch)
tree0841558c8f5a6b6386f4a040203b9c38bc7f436c /mysql-test/t/change_user.test
parentc9b10e250d96d3f8eab22ebb698654da78fed5d8 (diff)
downloadmariadb-git-3b98d69d689efcaba97476f34537fde24cfd5451.tar.gz
crash on --with-embedded-privilege-control builds:
1. fix broken change user handling (no restart should happen in the normal case) 2. add assert to guarantee that we never send a request to change to the same plugin 3. "fix" plugin string as sent by the client to be able to compare native plugins by pointers 4. more complete MYSQL initialization in the embedded case 5. change_user.test updated to handle -with-embedded-privilege-control builds
Diffstat (limited to 'mysql-test/t/change_user.test')
-rw-r--r--mysql-test/t/change_user.test23
1 files changed, 17 insertions, 6 deletions
diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test
index b529ab7539b..5639e013de8 100644
--- a/mysql-test/t/change_user.test
+++ b/mysql-test/t/change_user.test
@@ -6,19 +6,30 @@ grant select on test.* to test_nopw;
grant select on test.* to test_oldpw identified by password "09301740536db389";
grant select on test.* to test_newpw identified by "newpw";
+select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
+
#
# massaging the data for tests to pass in the embedded server,
-# that has authentication completely disabled.
+# that has authentication completely disabled or, if enabled, can
+# only do new auth (20-byte scramble).
#
---replace_result <@> <test_nopw@%> @> @localhost>
-select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
-
change_user test_nopw;
--replace_result <@> <test_nopw@%> @> @localhost>
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
+
+#
+# embedded with enabled privilege control cannot do plugin negotiation.
+# that is, it cannot try to authenticate with a new scramble, receive a request
+# to switch to an old scramble, and retry with an old scramble.
+# As a result, it cannot change to a user that has old scramble and
+# and it stays logged as a previous user - test_nopw in this test file.
+# For the embedded with auth we replace nopw with oldpw in the results.
+#
+let $repl = `select if(version() like '%embedded%' and user() like '%nopw%', 'nopw', 'oldpw')`;
+
change_user test_oldpw, oldpw;
---replace_result <@> <test_oldpw@%> @> @localhost>
+--replace_result <@> <test_oldpw@%> @> @localhost> $repl oldpw
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
change_user test_newpw, newpw;
--replace_result <@> <test_newpw@%> @> @localhost>
@@ -31,7 +42,7 @@ change_user test_nopw,,test;
--replace_result <@> <test_nopw@%> @> @localhost>
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
change_user test_oldpw,oldpw,test;
---replace_result <@> <test_oldpw@%> @> @localhost>
+--replace_result <@> <test_oldpw@%> @> @localhost> $repl oldpw
select concat('<', user(), '>'), concat('<', current_user(), '>'), database();
change_user test_newpw,newpw,test;
--replace_result <@> <test_newpw@%> @> @localhost>