mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-35617: DROP USER should leave no active session for that user
DROP USER looks for sessions by the do-be-dropped user and if found: * fails with ER_CANNOT_USER in Oracle mode * continues with ER_ACTIVE_CONNECTIONS_FOR_USER_TO_DROP warning otherwise Every user being dropped is marked with flag that disallow establishing a new connections on behalf this user.
This commit is contained in:
@@ -195,7 +195,9 @@ call mtr.add_suppression("Access denied; you need (at least one of) the BINLOG R
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql
|
||||
--disconnect user1
|
||||
DROP TABLE t2,t1;
|
||||
--disable_warnings
|
||||
DROP USER user1@localhost;
|
||||
--enable_warnings
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.5 test
|
||||
|
@@ -46,6 +46,8 @@ Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
|
||||
include/check_slave_is_running.inc
|
||||
connection master;
|
||||
drop user replssl@localhost;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'replssl'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
drop table t1;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
|
@@ -30,6 +30,8 @@ n
|
||||
==== Delete new replication user ====
|
||||
connection master;
|
||||
DROP USER rpl@127.0.0.1;
|
||||
Warnings:
|
||||
Note 4240 Dropped users 'rpl'@'127.0.0.1' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
FLUSH PRIVILEGES;
|
||||
connection slave;
|
||||
==== Restart slave without privileges =====
|
||||
|
@@ -659,6 +659,8 @@ Expect 1
|
||||
1
|
||||
connection default;
|
||||
DROP USER evtest1@localhost;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'evtest1'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
Sleep 4 seconds
|
||||
SELECT COUNT(*) INTO @row_cnt FROM events_test.event_log;
|
||||
Sleep 4 seconds
|
||||
|
@@ -57,7 +57,9 @@ SELECT LAST_INSERT_ID();
|
||||
SELECT * from federated.t1;
|
||||
|
||||
DROP TABLE federated.t1;
|
||||
--disable_warnings
|
||||
drop user fed@127.0.0.1;
|
||||
--enable_warnings
|
||||
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
|
||||
connection slave;
|
||||
DROP TABLE federated.t1;
|
||||
|
@@ -274,7 +274,9 @@ select * from federated.t1;
|
||||
|
||||
# clean up test
|
||||
connection slave;
|
||||
disable_warnings;
|
||||
drop user test_fed@localhost;
|
||||
enable_warnings;
|
||||
drop database db_legitimate;
|
||||
drop database db_bogus;
|
||||
|
||||
|
@@ -25,7 +25,9 @@ drop table tt1;
|
||||
|
||||
connection slave;
|
||||
drop database db1;
|
||||
disable_warnings;
|
||||
drop user my@localhost;
|
||||
enable_warnings;
|
||||
|
||||
source include/federated_cleanup.inc;
|
||||
|
||||
|
@@ -92,6 +92,8 @@ UNINSTALL PLUGIN plg;
|
||||
Got one of the listed errors
|
||||
connection node_1;
|
||||
DROP USER 'userMW416'@'localhost';
|
||||
Warnings:
|
||||
Note 4226 Dropped users 'userMW416'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
information_schema
|
||||
|
@@ -33,3 +33,5 @@ DROP TABLE t2;
|
||||
SET GLOBAL read_only=FALSE;
|
||||
DROP TABLE t1;
|
||||
DROP USER foo@localhost;
|
||||
Warnings:
|
||||
Note 4226 Dropped users 'foo'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
|
@@ -167,6 +167,8 @@ disconnect foo_node_2;
|
||||
# Connect with node_1
|
||||
connection node_1;
|
||||
DROP USER foo@localhost;
|
||||
Warnings:
|
||||
Note 4226 Dropped users 'foo'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
DROP DATABASE test1;
|
||||
#
|
||||
# MDEV-10566: Create role statement replicated inconsistently in Galera Cluster
|
||||
|
@@ -44,5 +44,7 @@ i
|
||||
1
|
||||
connection node_1;
|
||||
DROP USER foo@localhost;
|
||||
Warnings:
|
||||
Note 4226 Dropped users 'foo'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
DROP TABLE t2;
|
||||
# End of tests
|
||||
|
@@ -1,4 +1,5 @@
|
||||
--source include/not_ubsan.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
let $REGEX_VERSION_ID=/$mysql_get_server_version/VERSION_ID/;
|
||||
let $REGEX_PASSWORD_LAST_CHANGED=/password_last_changed": [0-9]*/password_last_changed": #/;
|
||||
@@ -48,6 +49,7 @@ show create user mysqltest1;
|
||||
--echo # name does not match, password bad = failure
|
||||
--error 1
|
||||
--exec $try_auth -u mysqltest1 -pbad
|
||||
--source include/wait_until_count_sessions.inc
|
||||
--replace_result $dreplace "drop user 'USER'"
|
||||
eval $dreplace, mysqltest1;
|
||||
|
||||
@@ -68,6 +70,7 @@ show create user mysqltest1;
|
||||
--echo # name does not match, password bad = failure
|
||||
--error 1
|
||||
--exec $try_auth -u mysqltest1 -pbad
|
||||
--source include/wait_until_count_sessions.inc
|
||||
--replace_result $dreplace "drop user 'USER'"
|
||||
eval $dreplace, mysqltest1;
|
||||
|
||||
@@ -88,6 +91,7 @@ show create user mysqltest1;
|
||||
--echo # name does not match, password bad = failure
|
||||
--error 1
|
||||
--exec $try_auth -u mysqltest1 -pbad
|
||||
--source include/wait_until_count_sessions.inc
|
||||
--replace_result $dreplace "drop user 'USER'"
|
||||
eval $dreplace, mysqltest1;
|
||||
|
||||
@@ -108,6 +112,7 @@ show create user mysqltest1;
|
||||
--echo # name does not match, password bad = failure
|
||||
--error 1
|
||||
--exec $try_auth -u mysqltest1 -pbad
|
||||
--source include/wait_until_count_sessions.inc
|
||||
--replace_result $dreplace "drop user 'USER'"
|
||||
eval $dreplace, mysqltest1;
|
||||
|
||||
@@ -130,6 +135,7 @@ show create user mysqltest1;
|
||||
--echo # name does not match, password bad = failure
|
||||
--error 1
|
||||
--exec $try_auth -u mysqltest1 -pbad
|
||||
--source include/wait_until_count_sessions.inc
|
||||
--replace_result $dreplace "drop user 'USER'"
|
||||
eval $dreplace, mysqltest1;
|
||||
|
||||
@@ -146,6 +152,7 @@ show create user mysqltest1;
|
||||
--echo # password bad = failure
|
||||
--error 1
|
||||
--exec $try_auth -u mysqltest1 -pbad
|
||||
--source include/wait_until_count_sessions.inc
|
||||
drop user mysqltest1;
|
||||
|
||||
#
|
||||
@@ -198,6 +205,7 @@ show create user mysqltest1;
|
||||
--echo # SET PASSWORD helps
|
||||
set password for mysqltest1 = password('bla');
|
||||
--exec $try_auth -u mysqltest1 -pbla
|
||||
--source include/wait_until_count_sessions.inc
|
||||
--replace_result $dreplace "drop user 'USER'"
|
||||
eval $dreplace, mysqltest1;
|
||||
|
||||
@@ -219,6 +227,7 @@ show create user mysqltest1;
|
||||
--exec $try_auth -u mysqltest1 -pgood --plugin-dir=$plugindir/no
|
||||
--echo # no plugin, second password works = ok
|
||||
--exec $try_auth -u mysqltest1 -pworks --plugin-dir=$plugindir/no
|
||||
--source include/wait_until_count_sessions.inc
|
||||
drop user mysqltest1;
|
||||
|
||||
uninstall soname 'auth_ed25519';
|
||||
|
@@ -1,5 +1,6 @@
|
||||
let $PAM_PLUGIN_VERSION= $AUTH_PAM_SO;
|
||||
--source pam_init.inc
|
||||
--source include/count_sessions.inc
|
||||
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/pam_good.txt
|
||||
not very secret challenge
|
||||
@@ -83,6 +84,7 @@ alter user test_pam password expire;
|
||||
--error 1
|
||||
--exec $MYSQL_TEST -u test_pam -pgoodpassword < $MYSQLTEST_VARDIR/tmp/pam_good2.txt
|
||||
|
||||
--source include/wait_until_count_sessions.inc
|
||||
drop user test_pam;
|
||||
drop user pam_test;
|
||||
create user PAM_TEST identified via pam using 'mariadb_mtr';
|
||||
@@ -104,6 +106,7 @@ set global pam_winbind_workaround=1;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/pam_good2.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/pam_bad.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/pam_ugly.txt
|
||||
--source include/wait_until_count_sessions.inc
|
||||
drop user PAM_TEST;
|
||||
|
||||
--echo #
|
||||
@@ -121,6 +124,7 @@ show create user;
|
||||
EOF
|
||||
--exec $MYSQL_TEST -u pam_test < $MYSQLTEST_VARDIR/tmp/setpwd.txt
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/setpwd.txt
|
||||
--source include/wait_until_count_sessions.inc
|
||||
drop user pam_test;
|
||||
|
||||
let $count_sessions= 1;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
source include/platform.inc;
|
||||
source include/not_embedded.inc;
|
||||
source include/count_sessions.inc;
|
||||
|
||||
if (`select count(*) = 0 from information_schema.plugins where plugin_name = 'parsec'`)
|
||||
{
|
||||
@@ -41,6 +42,7 @@ if ($MTR_COMBINATION_WIN) {
|
||||
--echo # mysql -utest1 -ppwd --ssl-verify-server-cert -e "select test.have_ssl()"
|
||||
--exec $MYSQL --protocol tcp $host -utest1 -ppwd --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
|
||||
|
||||
source include/wait_until_count_sessions.inc;
|
||||
drop function have_ssl;
|
||||
drop user test1@'%';
|
||||
|
||||
@@ -57,4 +59,5 @@ disconnect con4;
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
connect con5, localhost, test2, "wrong_pwd";
|
||||
connection default;
|
||||
source include/wait_until_count_sessions.inc;
|
||||
drop user test2@'%';
|
||||
|
@@ -10,6 +10,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
||||
create role current_role;
|
||||
ERROR HY000: Operation CREATE ROLE failed for CURRENT_ROLE
|
||||
drop user current_user;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'foo'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
drop user current_role;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'current_role' at line 1
|
||||
drop role current_user;
|
||||
|
@@ -620,6 +620,8 @@ drop view test.v1, test.v2, test.v3, test.v4, test.v5;
|
||||
drop table t1, t2;
|
||||
drop role role1, role2;
|
||||
drop user foo@localhost;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'foo'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
drop database mysqltest1;
|
||||
use test;
|
||||
create user utest;
|
||||
|
@@ -327,7 +327,9 @@ drop view test.v1, test.v2, test.v3, test.v4, test.v5;
|
||||
drop table t1, t2;
|
||||
drop role role1, role2;
|
||||
drop user foo@localhost;
|
||||
--disable_warnings
|
||||
drop database mysqltest1;
|
||||
--enable_warnings
|
||||
use test;
|
||||
|
||||
##################################################
|
||||
|
@@ -2,6 +2,8 @@ create user foo@localhost;
|
||||
grant create user on *.* to foo@localhost;
|
||||
connect foo,localhost,foo,,;
|
||||
drop user foo@localhost;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'foo'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
select * from information_schema.applicable_roles;
|
||||
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
|
||||
show grants;
|
||||
|
@@ -54,6 +54,8 @@ ERROR HY000: String 'воттакойужпарольвоттакойужпар
|
||||
connection master;
|
||||
set sql_log_bin=0;
|
||||
drop user rpl32@127.0.0.1, rpl33@127.0.0.1, rpl16cyr@127.0.0.1, rpl17mix@127.0.0.1;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'rpl16cyr'@'127.0.0.1' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
set sql_log_bin=1;
|
||||
connection slave;
|
||||
change master to master_user='root',master_password='';
|
||||
|
@@ -57,6 +57,8 @@ include/assert.inc [Value returned by SSS and PS table for SSL_Key should be sam
|
||||
include/assert.inc [Value returned by SSS and PS table for SSL_Verify_Server_Certificate should be same.]
|
||||
connection master;
|
||||
drop user replssl@localhost;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'replssl'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
CHANGE MASTER TO
|
||||
|
@@ -22,6 +22,8 @@ connection slave;
|
||||
connection master;
|
||||
"Command: SHOW SLAVE HOSTS --> SHOW REPLICA HOSTS"
|
||||
DROP USER 'repl_user';
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'repl_user'@'%' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
connection slave;
|
||||
"Command: SHOW SLAVE IO/SQL THREAD --> SHOW REPLICA IO/SQL THREAD"
|
||||
STOP REPLICA IO_THREAD;
|
||||
|
@@ -18,6 +18,8 @@ include/check_slave_param.inc [Slave_IO_Running]
|
||||
connection master;
|
||||
SET SQL_LOG_BIN=0;
|
||||
DROP USER rpl@127.0.0.1;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'rpl'@'127.0.0.1' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
FLUSH PRIVILEGES;
|
||||
SET SQL_LOG_BIN=1;
|
||||
connection slave;
|
||||
|
@@ -30,6 +30,8 @@ n
|
||||
==== Delete new replication user ====
|
||||
connection master;
|
||||
DROP USER rpl@127.0.0.1;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'rpl'@'127.0.0.1' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
FLUSH PRIVILEGES;
|
||||
connection slave;
|
||||
==== Restart slave without privileges =====
|
||||
|
@@ -46,6 +46,8 @@ Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
|
||||
include/check_slave_is_running.inc
|
||||
connection master;
|
||||
drop user replssl@localhost;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'replssl'@'localhost' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
drop table t1;
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
@@ -55,5 +57,5 @@ master_ssl = 1,
|
||||
master_ssl_ca = '',
|
||||
master_ssl_cert = '',
|
||||
master_ssl_key = '';
|
||||
End of 5.0 tests
|
||||
# End of 5.0 tests
|
||||
include/rpl_end.inc
|
||||
|
@@ -112,6 +112,8 @@ master_ssl_verify_server_cert=0,
|
||||
master_ssl=1;
|
||||
connection master;
|
||||
drop user replssl@127.0.0.1;
|
||||
Warnings:
|
||||
Note 4227 Dropped users 'replssl'@'127.0.0.1' have active connections. Use KILL CONNECTION if they should not be used anymore.
|
||||
connection slave;
|
||||
drop user replssl@127.0.0.1;
|
||||
include/rpl_end.inc
|
||||
|
@@ -61,7 +61,9 @@ change master to master_user='root',master_password='', master_ssl=0;
|
||||
start slave;
|
||||
--source include/wait_for_slave_to_start.inc
|
||||
connection master;
|
||||
disable_warnings;
|
||||
drop user replssl@localhost;
|
||||
enable_warnings;
|
||||
drop table t1;
|
||||
|
||||
sync_slave_with_master;
|
||||
|
Reference in New Issue
Block a user