mirror of
https://github.com/MariaDB/server.git
synced 2025-08-30 11:22:14 +03:00
5.5 merge
This commit is contained in:
112
mysql-test/suite/rpl/t/rpl_password_boundaries.test
Normal file
112
mysql-test/suite/rpl/t/rpl_password_boundaries.test
Normal file
@@ -0,0 +1,112 @@
|
||||
source include/not_embedded.inc;
|
||||
source include/master-slave.inc;
|
||||
source include/rpl_reset.inc;
|
||||
|
||||
# Suppress warnings that might be generated during the test
|
||||
disable_query_log;
|
||||
connection master;
|
||||
call mtr.add_suppression("Timeout waiting for reply of binlog");
|
||||
connection slave;
|
||||
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
|
||||
enable_query_log;
|
||||
|
||||
connection master;
|
||||
echo [ on master ];
|
||||
|
||||
# wait for dying connections (if any) to disappear
|
||||
let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
# 32*3-character ASCII password should work all right
|
||||
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl32@127.0.0.1 identified by '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
|
||||
set sql_log_bin=1;
|
||||
|
||||
connection slave;
|
||||
echo [ on slave ];
|
||||
source include/stop_slave.inc;
|
||||
change master to master_user='rpl32',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
echo [ on master ];
|
||||
drop table if exists t1;
|
||||
create table t1 (i int);
|
||||
insert into t1 values (1);
|
||||
sync_slave_with_master;
|
||||
echo [ on slave: synchronized ];
|
||||
|
||||
connection master;
|
||||
echo [ on master ];
|
||||
|
||||
# 32*3+1 -character ASCII password expected to fail
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl33@127.0.0.1 identified by '0123456789abcdef0123456789abcdef!';
|
||||
set sql_log_bin=1;
|
||||
|
||||
connection slave;
|
||||
echo [ on slave ];
|
||||
source include/stop_slave.inc;
|
||||
--error ER_WRONG_STRING_LENGTH
|
||||
change master to master_user='rpl33',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef!';
|
||||
|
||||
# Check also master_user and master_host
|
||||
--error ER_WRONG_STRING_LENGTH
|
||||
change master to master_user='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
|
||||
--error ER_WRONG_STRING_LENGTH
|
||||
change master to master_host='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc';
|
||||
|
||||
# 48-character cyrillic password should work all right
|
||||
connection master;
|
||||
echo [ on master ];
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl16cyr@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль';
|
||||
set sql_log_bin=1;
|
||||
|
||||
connection slave;
|
||||
echo [ on slave ];
|
||||
SET NAMES utf8;
|
||||
change master to master_user='rpl16cyr',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль';
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
echo [ on master ];
|
||||
drop table if exists t1;
|
||||
create table t1 (i int);
|
||||
insert into t1 values (1);
|
||||
sync_slave_with_master;
|
||||
echo [ on slave: synchronized ];
|
||||
|
||||
# 48+1-character cyrillic password should fail
|
||||
|
||||
connection master;
|
||||
echo [ on master ];
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl17mix@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль!';
|
||||
set sql_log_bin=1;
|
||||
|
||||
connection slave;
|
||||
echo [ on slave ];
|
||||
source include/stop_slave.inc;
|
||||
--error ER_WRONG_STRING_LENGTH
|
||||
change master to master_user='rpl17mix',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль!';
|
||||
|
||||
# Cleanup
|
||||
|
||||
connection master;
|
||||
echo [ on 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;
|
||||
set sql_log_bin=1;
|
||||
|
||||
connection slave;
|
||||
change master to master_user='root',master_password='';
|
||||
source include/start_slave.inc;
|
||||
|
||||
connection master;
|
||||
drop table if exists t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
connection master;
|
||||
--source include/rpl_end.inc
|
@@ -67,7 +67,7 @@ if ($value == No such row)
|
||||
{
|
||||
set sql_log_bin=0;
|
||||
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO';
|
||||
set global rpl_semi_sync_master_timeout= 5000; /* 5s */
|
||||
set global rpl_semi_sync_master_timeout= 60000; /* 60s */
|
||||
set sql_log_bin=1;
|
||||
}
|
||||
enable_query_log;
|
||||
@@ -177,7 +177,7 @@ let $_connections_semisync_slave= query_get_value(SHOW STATUS LIKE 'Threads_conn
|
||||
replace_result $_connections_normal_slave CONNECTIONS_NORMAL_SLAVE $_connections_semisync_slave CONNECTIONS_SEMISYNC_SLAVE;
|
||||
eval select $_connections_semisync_slave - $_connections_normal_slave as 'Should be 0';
|
||||
|
||||
let $i=300;
|
||||
let $i=10;
|
||||
echo [ insert records to table ];
|
||||
disable_query_log;
|
||||
while ($i)
|
||||
@@ -242,6 +242,7 @@ source include/stop_slave.inc;
|
||||
|
||||
connection master;
|
||||
echo [ on master ];
|
||||
set global rpl_semi_sync_master_timeout= 5000;
|
||||
|
||||
# The first semi-sync check should be on because after slave stop,
|
||||
# there are no transactions on the master.
|
||||
@@ -270,7 +271,7 @@ show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
|
||||
# Semi-sync status on master is now OFF, so all these transactions
|
||||
# will be replicated asynchronously.
|
||||
let $i=300;
|
||||
let $i=10;
|
||||
disable_query_log;
|
||||
while ($i)
|
||||
{
|
||||
@@ -475,14 +476,14 @@ if ($_tid)
|
||||
# Do not binlog the following statement because it will generate
|
||||
# different events for ROW and STATEMENT format
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
|
||||
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
|
||||
flush privileges;
|
||||
set sql_log_bin=1;
|
||||
connection slave;
|
||||
echo [ on slave ];
|
||||
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
|
||||
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
|
||||
flush privileges;
|
||||
change master to master_user='rpl',master_password='rpl';
|
||||
change master to master_user='rpl',master_password='rpl_password';
|
||||
source include/start_slave.inc;
|
||||
show status like 'Rpl_semi_sync_slave_status';
|
||||
connection master;
|
||||
|
Reference in New Issue
Block a user