MDEV-36405 Session tracking does not report changes from COM_CHANGE_USER
report all sysvar tracker changes, as for the new login. also report db and other session state changes.
This commit is contained in:
parent
07de0ac69e
commit
26ea37be5d
@ -4669,7 +4669,11 @@ void do_change_user(struct st_command *command)
|
|||||||
handle_error(command, mysql_errno(mysql), mysql_error(mysql),
|
handle_error(command, mysql_errno(mysql), mysql_error(mysql),
|
||||||
mysql_sqlstate(mysql), &ds_res);
|
mysql_sqlstate(mysql), &ds_res);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (display_session_track_info)
|
||||||
|
append_session_track_info(&ds_res, mysql);
|
||||||
handle_no_error(command);
|
handle_no_error(command);
|
||||||
|
}
|
||||||
|
|
||||||
dynstr_free(&ds_user);
|
dynstr_free(&ds_user);
|
||||||
dynstr_free(&ds_passwd);
|
dynstr_free(&ds_passwd);
|
||||||
|
@ -7,4 +7,20 @@ ERROR 08S01: Unknown command
|
|||||||
ERROR 08S01: Unknown command
|
ERROR 08S01: Unknown command
|
||||||
disconnect test;
|
disconnect test;
|
||||||
connection default;
|
connection default;
|
||||||
that's all
|
# End of 10.0 tests
|
||||||
|
#
|
||||||
|
# MDEV-36405 Session tracking does not report changes from COM_CHANGE_USER
|
||||||
|
#
|
||||||
|
change_user
|
||||||
|
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
|
||||||
|
-- autocommit: ON
|
||||||
|
-- character_set_client: latin1
|
||||||
|
-- character_set_connection: latin1
|
||||||
|
-- character_set_results: latin1
|
||||||
|
-- redirect_url:
|
||||||
|
-- time_zone: SYSTEM
|
||||||
|
|
||||||
|
-- Tracker : SESSION_TRACK_SCHEMA
|
||||||
|
-- test
|
||||||
|
|
||||||
|
# End of 12.0 tests
|
||||||
|
@ -22,5 +22,14 @@ change_user;
|
|||||||
disconnect test;
|
disconnect test;
|
||||||
connection default;
|
connection default;
|
||||||
|
|
||||||
--echo that's all
|
--echo # End of 10.0 tests
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-36405 Session tracking does not report changes from COM_CHANGE_USER
|
||||||
|
--echo #
|
||||||
|
enable_session_track_info;
|
||||||
|
--echo change_user
|
||||||
|
change_user;
|
||||||
|
disable_session_track_info;
|
||||||
|
|
||||||
|
--echo # End of 12.0 tests
|
||||||
|
@ -133,4 +133,19 @@ show global status like 'access_denied_errors';
|
|||||||
Variable_name Value
|
Variable_name Value
|
||||||
Access_denied_errors 2
|
Access_denied_errors 2
|
||||||
drop user u1;
|
drop user u1;
|
||||||
# End of 11.8 tests
|
#
|
||||||
|
# MDEV-36405 Session tracking does not report changes from COM_CHANGE_USER
|
||||||
|
#
|
||||||
|
set session authorization root@localhost;
|
||||||
|
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
|
||||||
|
-- autocommit: ON
|
||||||
|
-- character_set_client: utf8mb4
|
||||||
|
-- character_set_connection: utf8mb4
|
||||||
|
-- character_set_results: utf8mb4
|
||||||
|
-- redirect_url:
|
||||||
|
-- time_zone: SYSTEM
|
||||||
|
|
||||||
|
-- Tracker : SESSION_TRACK_SCHEMA
|
||||||
|
--
|
||||||
|
|
||||||
|
# End of 12.0 tests
|
||||||
|
@ -136,4 +136,11 @@ connection default;
|
|||||||
show global status like 'access_denied_errors';
|
show global status like 'access_denied_errors';
|
||||||
drop user u1;
|
drop user u1;
|
||||||
|
|
||||||
--echo # End of 11.8 tests
|
--echo #
|
||||||
|
--echo # MDEV-36405 Session tracking does not report changes from COM_CHANGE_USER
|
||||||
|
--echo #
|
||||||
|
enable_session_track_info;
|
||||||
|
set session authorization root@localhost;
|
||||||
|
disable_session_track_info;
|
||||||
|
|
||||||
|
--echo # End of 12.0 tests
|
||||||
|
@ -163,6 +163,9 @@ connect foo,localhost,root;
|
|||||||
-- redirect_url:
|
-- redirect_url:
|
||||||
-- time_zone: SYSTEM
|
-- time_zone: SYSTEM
|
||||||
|
|
||||||
|
-- Tracker : SESSION_TRACK_SCHEMA
|
||||||
|
--
|
||||||
|
|
||||||
connection default;
|
connection default;
|
||||||
disconnect foo;
|
disconnect foo;
|
||||||
# End of tests 11.5
|
# End of tests 11.5
|
||||||
|
@ -483,6 +483,7 @@ class Session_tracker
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void mark_as_changed(THD *thd) {}
|
void mark_as_changed(THD *thd) {}
|
||||||
|
void mark_all_as_changed(THD *thd) {}
|
||||||
void mark_as_changed(THD *thd, const sys_var *var) {}
|
void mark_as_changed(THD *thd, const sys_var *var) {}
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
|
@ -12390,6 +12390,10 @@ static int set_privs_on_login(THD *thd, const ACL_USER *acl_user)
|
|||||||
thd->variables.max_statement_time=
|
thd->variables.max_statement_time=
|
||||||
(ulonglong) (thd->variables.max_statement_time_double * 1e6 + 0.1);
|
(ulonglong) (thd->variables.max_statement_time_double * 1e6 + 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
thd->session_tracker.sysvars.mark_all_as_changed(thd);
|
||||||
|
thd->session_tracker.current_schema.mark_as_changed(thd);
|
||||||
|
thd->session_tracker.state_change.mark_as_changed(thd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1153,7 +1153,6 @@ static bool login_connection(THD *thd)
|
|||||||
my_net_set_write_timeout(net, connect_timeout);
|
my_net_set_write_timeout(net, connect_timeout);
|
||||||
|
|
||||||
error= check_connection(thd);
|
error= check_connection(thd);
|
||||||
thd->session_tracker.sysvars.mark_all_as_changed(thd);
|
|
||||||
thd->protocol->end_statement();
|
thd->protocol->end_statement();
|
||||||
|
|
||||||
if (unlikely(error))
|
if (unlikely(error))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user