Commit 1d46ee77 authored by Sergei Golubchik's avatar Sergei Golubchik

fix @@external_user variable

parent 03d08bed
...@@ -224,7 +224,7 @@ NULL ...@@ -224,7 +224,7 @@ NULL
# in connection plug_con # in connection plug_con
SELECT @@LOCAL.external_user; SELECT @@LOCAL.external_user;
@@LOCAL.external_user @@LOCAL.external_user
'plug'@'%' plug_dest
# in connection default # in connection default
## cleanup ## cleanup
DROP USER plug; DROP USER plug;
......
...@@ -44,7 +44,7 @@ SELECT @@external_user; ...@@ -44,7 +44,7 @@ SELECT @@external_user;
NULL NULL
exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
current_user() user() @@local.proxy_user @@local.external_user current_user() user() @@local.proxy_user @@local.external_user
authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' 'qa_test_2_user'@'%' authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' externaluser
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string user plugin authentication_string
authenticated_as authenticated_as
...@@ -60,7 +60,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_3_dest identified by 'dest_pas ...@@ -60,7 +60,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_3_dest identified by 'dest_pas
GRANT PROXY ON qa_test_3_dest TO qa_test_3_user; GRANT PROXY ON qa_test_3_dest TO qa_test_3_user;
exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
current_user() user() @@local.proxy_user @@local.external_user current_user() user() @@local.proxy_user @@local.external_user
qa_test_3_dest@% qa_test_3_user@localhost 'qa_test_3_user'@'%' 'qa_test_3_user'@'%' qa_test_3_dest@% qa_test_3_user@localhost 'qa_test_3_user'@'%' qa_test_3_dest
DROP USER qa_test_3_user; DROP USER qa_test_3_user;
DROP USER qa_test_3_dest; DROP USER qa_test_3_dest;
=== Assign too low values for *length, which should have no effect ==== === Assign too low values for *length, which should have no effect ====
...@@ -70,7 +70,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_4_dest identified by 'dest_pas ...@@ -70,7 +70,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_4_dest identified by 'dest_pas
GRANT PROXY ON qa_test_4_dest TO qa_test_4_user; GRANT PROXY ON qa_test_4_dest TO qa_test_4_user;
exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
current_user() user() @@local.proxy_user @@local.external_user current_user() user() @@local.proxy_user @@local.external_user
qa_test_4_dest@% qa_test_4_user@localhost 'qa_test_4_user'@'%' 'qa_test_4_user'@'%' qa_test_4_dest@% qa_test_4_user@localhost 'qa_test_4_user'@'%' qa_test_4_dest
DROP USER qa_test_4_user; DROP USER qa_test_4_user;
DROP USER qa_test_4_dest; DROP USER qa_test_4_dest;
=== Assign empty string especially to authenticated_as (in plugin) ==== === Assign empty string especially to authenticated_as (in plugin) ====
......
...@@ -4,7 +4,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_pa ...@@ -4,7 +4,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_pa
GRANT PROXY ON qa_test_11_dest TO qa_test_11_user; GRANT PROXY ON qa_test_11_dest TO qa_test_11_user;
exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
current_user() user() @@local.proxy_user @@local.external_user current_user() user() @@local.proxy_user @@local.external_user
qa_test_11_dest@% qa_test_11_user@localhost 'qa_test_11_user'@'%' 'qa_test_11_user'@'%' qa_test_11_dest@% qa_test_11_user@localhost 'qa_test_11_user'@'%' NULL
exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1
ERROR 1045 (28000): Access denied for user 'qa_test_2_user'@'localhost' (using password: NO) ERROR 1045 (28000): Access denied for user 'qa_test_2_user'@'localhost' (using password: NO)
DROP USER qa_test_11_user, qa_test_11_dest; DROP USER qa_test_11_user, qa_test_11_dest;
......
...@@ -547,8 +547,7 @@ class Sys_var_external_user : public Sys_var_proxy_user ...@@ -547,8 +547,7 @@ class Sys_var_external_user : public Sys_var_proxy_user
protected: protected:
virtual uchar *session_value_ptr(THD *thd, LEX_STRING *base) virtual uchar *session_value_ptr(THD *thd, LEX_STRING *base)
{ {
return thd->security_ctx->proxy_user[0] ? return (uchar*)thd->security_ctx->external_user;
(uchar *) &(thd->security_ctx->proxy_user[0]) : NULL;
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment