mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
5.5 merge
This commit is contained in:
59
mysql-test/suite/rpl/r/rpl_password_boundaries.result
Normal file
59
mysql-test/suite/rpl/r/rpl_password_boundaries.result
Normal file
@ -0,0 +1,59 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
include/rpl_reset.inc
|
||||
[ on master ]
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl32@127.0.0.1 identified by '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
|
||||
set sql_log_bin=1;
|
||||
[ on slave ]
|
||||
include/stop_slave.inc
|
||||
change master to master_user='rpl32',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
|
||||
include/start_slave.inc
|
||||
[ on master ]
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
create table t1 (i int);
|
||||
insert into t1 values (1);
|
||||
[ on slave: synchronized ]
|
||||
[ on master ]
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl33@127.0.0.1 identified by '0123456789abcdef0123456789abcdef!';
|
||||
set sql_log_bin=1;
|
||||
[ on slave ]
|
||||
include/stop_slave.inc
|
||||
change master to master_user='rpl33',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef!';
|
||||
ERROR HY000: String '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012345' is too long for MASTER_PASSWORD (should be no longer than 96)
|
||||
change master to master_user='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
|
||||
ERROR HY000: String 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long for MASTER_USER (should be no longer than 47)
|
||||
change master to master_host='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc';
|
||||
ERROR HY000: String 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbb' is too long for MASTER_HOST (should be no longer than 180)
|
||||
[ on master ]
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl16cyr@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль';
|
||||
set sql_log_bin=1;
|
||||
[ on slave ]
|
||||
SET NAMES utf8;
|
||||
change master to master_user='rpl16cyr',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль';
|
||||
include/start_slave.inc
|
||||
[ on master ]
|
||||
drop table if exists t1;
|
||||
create table t1 (i int);
|
||||
insert into t1 values (1);
|
||||
[ on slave: synchronized ]
|
||||
[ on master ]
|
||||
set sql_log_bin=0;
|
||||
grant replication slave on *.* to rpl17mix@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль!';
|
||||
set sql_log_bin=1;
|
||||
[ on slave ]
|
||||
include/stop_slave.inc
|
||||
change master to master_user='rpl17mix',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль!';
|
||||
ERROR HY000: String 'воттакойужпарольвоттакойужпарольвот' is too long for MASTER_PASSWORD (should be no longer than 96)
|
||||
[ 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;
|
||||
change master to master_user='root',master_password='';
|
||||
include/start_slave.inc
|
||||
drop table if exists t1;
|
||||
include/rpl_end.inc
|
@ -93,7 +93,7 @@ Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 0
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_yes_tx 301
|
||||
Rpl_semi_sync_master_yes_tx 11
|
||||
[ on slave ]
|
||||
[ slave status after replicated inserts ]
|
||||
show status like 'Rpl_semi_sync_slave_status';
|
||||
@ -101,13 +101,13 @@ Variable_name Value
|
||||
Rpl_semi_sync_slave_status ON
|
||||
select count(distinct a) from t1;
|
||||
count(distinct a)
|
||||
300
|
||||
10
|
||||
select min(a) from t1;
|
||||
min(a)
|
||||
1
|
||||
select max(a) from t1;
|
||||
max(a)
|
||||
300
|
||||
10
|
||||
|
||||
# BUG#50157
|
||||
# semi-sync replication crashes when replicating a transaction which
|
||||
@ -133,6 +133,7 @@ SET SESSION AUTOCOMMIT= 1;
|
||||
#
|
||||
include/stop_slave.inc
|
||||
[ on master ]
|
||||
set global rpl_semi_sync_master_timeout= 5000;
|
||||
[ master status should be ON ]
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
Variable_name Value
|
||||
@ -142,7 +143,7 @@ Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 0
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_yes_tx 304
|
||||
Rpl_semi_sync_master_yes_tx 14
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_clients 1
|
||||
@ -157,7 +158,7 @@ Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 1
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_yes_tx 304
|
||||
Rpl_semi_sync_master_yes_tx 14
|
||||
insert into t1 values (100);
|
||||
[ master status should be OFF ]
|
||||
show status like 'Rpl_semi_sync_master_status';
|
||||
@ -165,10 +166,10 @@ Variable_name Value
|
||||
Rpl_semi_sync_master_status OFF
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 302
|
||||
Rpl_semi_sync_master_no_tx 12
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_yes_tx 304
|
||||
Rpl_semi_sync_master_yes_tx 14
|
||||
#
|
||||
# Test semi-sync status on master will be ON again when slave catches up
|
||||
#
|
||||
@ -198,10 +199,10 @@ Variable_name Value
|
||||
Rpl_semi_sync_master_status ON
|
||||
show status like 'Rpl_semi_sync_master_no_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 302
|
||||
Rpl_semi_sync_master_no_tx 12
|
||||
show status like 'Rpl_semi_sync_master_yes_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_yes_tx 304
|
||||
Rpl_semi_sync_master_yes_tx 14
|
||||
show status like 'Rpl_semi_sync_master_clients';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_clients 1
|
||||
@ -217,10 +218,10 @@ include/stop_slave.inc
|
||||
[ Semi-sync master status variables before FLUSH STATUS ]
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_no_tx 302
|
||||
Rpl_semi_sync_master_no_tx 12
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
|
||||
Variable_name Value
|
||||
Rpl_semi_sync_master_yes_tx 305
|
||||
Rpl_semi_sync_master_yes_tx 15
|
||||
FLUSH NO_WRITE_TO_BINLOG STATUS;
|
||||
[ Semi-sync master status variables after FLUSH STATUS ]
|
||||
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
|
||||
@ -307,13 +308,13 @@ reset slave;
|
||||
[ on master ]
|
||||
reset master;
|
||||
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;
|
||||
[ 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';
|
||||
include/start_slave.inc
|
||||
show status like 'Rpl_semi_sync_slave_status';
|
||||
Variable_name Value
|
||||
|
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