mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge next-mr -> next-4284
This commit is contained in:
14
mysql-test/include/check_ipv6.inc
Normal file
14
mysql-test/include/check_ipv6.inc
Normal file
@ -0,0 +1,14 @@
|
||||
# Check if ipv6 is available. If not, server is crashing (see BUG#48915).
|
||||
--disable_query_log
|
||||
--disable_abort_on_error
|
||||
connect (checkcon123456789,::1,root,,test);
|
||||
if($mysql_errno)
|
||||
{
|
||||
skip wrong IP;
|
||||
}
|
||||
connection default;
|
||||
disconnect checkcon123456789;
|
||||
--enable_abort_on_error
|
||||
--enable_query_log
|
||||
# end check
|
||||
|
22
mysql-test/include/ipv6.inc
Normal file
22
mysql-test/include/ipv6.inc
Normal file
@ -0,0 +1,22 @@
|
||||
eval CREATE USER testuser@'$IPv6' identified by '1234';
|
||||
eval GRANT ALL ON test.* TO testuser@'$IPv6';
|
||||
eval SHOW GRANTS FOR testuser@'$IPv6';
|
||||
# deliver NULL instead of a valid number, see bug#34037
|
||||
eval SET @nip= inet_aton('$IPv6');
|
||||
SELECT @nip;
|
||||
SELECT inet_ntoa(@nip);
|
||||
# delivers a wrong value, see bug#34037
|
||||
SELECT USER();
|
||||
SELECT current_user();
|
||||
--disable_result_log
|
||||
SHOW PROCESSLIST;
|
||||
--enable_result_log
|
||||
connect (con1, $IPv6, root, , test, $MASTER_MYPORT);
|
||||
connection default;
|
||||
disconnect con1;
|
||||
eval REVOKE ALL ON test.* FROM testuser@'$IPv6';
|
||||
eval RENAME USER testuser@'$IPv6' to testuser1@'$IPv6';
|
||||
eval SET PASSWORD FOR testuser1@'$IPv6' = PASSWORD ('9876');
|
||||
SELECT USER();
|
||||
eval DROP USER testuser1@'$IPv6';
|
||||
|
7
mysql-test/include/ipv6_clients.inc
Normal file
7
mysql-test/include/ipv6_clients.inc
Normal file
@ -0,0 +1,7 @@
|
||||
--exec $MYSQLADMIN --no-defaults --default-character-set=latin1 -h $IPv6 -P $MASTER_MYPORT -u root ping
|
||||
--disable_result_log
|
||||
--exec $MYSQL_CHECK -h $IPv6 -P $MASTER_MYPORT -u root test
|
||||
--exec $MYSQL_DUMP -h $IPv6 -P $MASTER_MYPORT -u root test
|
||||
--exec $MYSQL_SHOW -h $IPv6 -P $MASTER_MYPORT -u root
|
||||
--exec $MYSQL --host=$IPv6 --port=$MASTER_MYPORT --user=root test -e "SELECT current_user();SELECT user();"
|
||||
--enable_result_log
|
@ -6,12 +6,29 @@
|
||||
# Since we expect STOP SLAVE to produce a warning as the slave is
|
||||
# stopped (the server was started with skip-slave-start), we disable
|
||||
# warnings when doing STOP SLAVE.
|
||||
#
|
||||
# $no_change_master If true, no change master will be done nor any reset slave.
|
||||
# This is to avoid touching the relay-log.info file allowing
|
||||
# the test to create one itself.
|
||||
# $skip_slave_start If true, the slave will not be started
|
||||
|
||||
connection slave;
|
||||
|
||||
#we expect STOP SLAVE to produce a warning as the slave is stopped
|
||||
#(the server was started with skip-slave-start)
|
||||
--disable_warnings
|
||||
stop slave;
|
||||
--disable_query_log
|
||||
if (!$no_change_master) {
|
||||
eval CHANGE MASTER TO MASTER_USER='root',
|
||||
MASTER_CONNECT_RETRY=1,
|
||||
MASTER_HOST='127.0.0.1',
|
||||
MASTER_PORT=$MASTER_MYPORT;
|
||||
}
|
||||
--enable_query_log
|
||||
source include/wait_for_slave_to_stop.inc;
|
||||
--enable_warnings
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
@ -20,17 +37,39 @@ use test;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
reset master;
|
||||
|
||||
--disable_query_log
|
||||
reset slave;
|
||||
if (!$no_change_master) {
|
||||
reset slave;
|
||||
}
|
||||
--enable_query_log
|
||||
connection slave;
|
||||
reset slave;
|
||||
|
||||
--disable_warnings
|
||||
# the first RESET SLAVE may produce a warning about non-existent
|
||||
# 'ndb_apply_status' table, because this table is created
|
||||
# asynchronously at the server startup and may not exist yet
|
||||
# if RESET SLAVE comes too soon after the server startup
|
||||
if (!$no_change_master) {
|
||||
reset slave;
|
||||
}
|
||||
--enable_warnings
|
||||
|
||||
# Clean up old test tables
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
|
||||
--disable_query_log
|
||||
#eval CHANGE MASTER TO MASTER_USER='root',
|
||||
# MASTER_CONNECT_RETRY=1,
|
||||
# MASTER_HOST='127.0.0.1',
|
||||
# MASTER_PORT=$MASTER_MYPORT;
|
||||
reset master;
|
||||
--enable_query_log
|
||||
start slave;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
|
||||
if (!$skip_slave_start) {
|
||||
start slave;
|
||||
source include/wait_for_slave_to_start.inc;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
# Replication tests need binlog
|
||||
#
|
||||
# $skip_slave_start If true, the slave will not be started
|
||||
source include/have_log_bin.inc;
|
||||
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
|
||||
@ -8,7 +10,10 @@ connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
|
||||
|
||||
-- source include/master-slave-reset.inc
|
||||
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
if (!$skip_slave_start) {
|
||||
connection master;
|
||||
sync_slave_with_master;
|
||||
}
|
||||
|
||||
# Set the default connection to 'master'
|
||||
connection master;
|
||||
|
@ -1,4 +1,4 @@
|
||||
--require r/not_ndb_default.require
|
||||
disable_query_log;
|
||||
select convert(@@table_type using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
|
||||
select convert(@@storage_engine using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
|
||||
enable_query_log;
|
||||
|
24
mysql-test/include/rpl_ip_mix.inc
Normal file
24
mysql-test/include/rpl_ip_mix.inc
Normal file
@ -0,0 +1,24 @@
|
||||
--echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
|
||||
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
|
||||
--echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
|
||||
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
|
||||
--echo connection master;
|
||||
connection master;
|
||||
reset master;
|
||||
source include/show_master_status.inc;
|
||||
save_master_pos;
|
||||
--echo connection slave;
|
||||
connection slave;
|
||||
reset slave;
|
||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
--echo Master-Host: $master_host
|
||||
eval change master to master_host='$IPv6';
|
||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
--echo Master-Host: $master_host
|
||||
--echo disconnect slave;
|
||||
disconnect slave;
|
||||
--echo disconnect master;
|
||||
disconnect master;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
|
24
mysql-test/include/rpl_ip_mix2.inc
Normal file
24
mysql-test/include/rpl_ip_mix2.inc
Normal file
@ -0,0 +1,24 @@
|
||||
--echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
|
||||
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
|
||||
--echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
|
||||
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
|
||||
--echo connection master;
|
||||
connection master;
|
||||
reset master;
|
||||
source include/show_master_status.inc;
|
||||
save_master_pos;
|
||||
--echo connection slave;
|
||||
connection slave;
|
||||
reset slave;
|
||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
--echo Master-Host: $master_host
|
||||
eval change master to master_host='$IPv6';
|
||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
--echo Master-Host: $master_host
|
||||
--echo disconnect slave;
|
||||
disconnect slave;
|
||||
--echo disconnect master;
|
||||
disconnect master;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
|
22
mysql-test/include/rpl_ipv6.inc
Normal file
22
mysql-test/include/rpl_ipv6.inc
Normal file
@ -0,0 +1,22 @@
|
||||
--echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
|
||||
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
|
||||
--echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
|
||||
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
|
||||
--echo connection master;
|
||||
connection master;
|
||||
reset master;
|
||||
source include/show_master_status.inc;
|
||||
save_master_pos;
|
||||
--echo connection slave;
|
||||
connection slave;
|
||||
reset slave;
|
||||
eval change master to master_host='$IPv6';
|
||||
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
|
||||
--echo Master-Host: $master_host
|
||||
--echo disconnect slave;
|
||||
disconnect slave;
|
||||
--echo disconnect master;
|
||||
disconnect master;
|
||||
--echo connection default;
|
||||
connection default;
|
||||
|
41
mysql-test/include/wait_for_ndb_to_binlog.inc
Normal file
41
mysql-test/include/wait_for_ndb_to_binlog.inc
Normal file
@ -0,0 +1,41 @@
|
||||
# ==== Purpose ====
|
||||
#
|
||||
# Several test primitives from mysql-test/extra/rpl_tests
|
||||
# shared for test cases for MyISAM, InnoDB, NDB and other
|
||||
# engines. But for NDB all events will be added by NDB
|
||||
# injector and now there are no way to detect the state of
|
||||
# NDB injector therefore this primitive waits 5 sec
|
||||
# if engine type is NDB.
|
||||
# In future that should be fixed by waiting of proper
|
||||
# state of NDB injector.
|
||||
#
|
||||
# ==== Usage ====
|
||||
#
|
||||
# let $engine_type= NDB;
|
||||
# --source include/wait_for_ndb_to_binlog.inc
|
||||
#
|
||||
# ==== Parameters =====
|
||||
#
|
||||
# $engine_type
|
||||
# Type of engine. If type is NDB then it waits $wait_time sec
|
||||
#
|
||||
# $wait_time
|
||||
# Test will wait $wait_time seconds
|
||||
|
||||
let $_wait_time= 5;
|
||||
|
||||
if (!$wait_time) {
|
||||
let $_wait_time= $wait_time;
|
||||
}
|
||||
|
||||
if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) {
|
||||
while (!$_wait_time) {
|
||||
let $_wait_time_internal= 10;
|
||||
while (!$_wait_time_internal) {
|
||||
sleep 0.1;
|
||||
dec $_wait_time_internal;
|
||||
}
|
||||
dec $_wait_time;
|
||||
}
|
||||
}
|
||||
|
@ -2,13 +2,16 @@
|
||||
#
|
||||
# SUMMARY
|
||||
#
|
||||
# Waits until the show statement ($show_statement) has at least within one of
|
||||
# the rows of the result set for the field ($field) a value which fulfils
|
||||
# Waits until the show statement ($show_statement) has one or all of the
|
||||
# rows of the result set for the field ($field) a value which fulfils
|
||||
# a condition ($condition), or the operation times out.
|
||||
#
|
||||
#
|
||||
# USAGE
|
||||
#
|
||||
# All rows of the result must fulfil the condition if $all_rows_fulfil is 1
|
||||
# else at least one of the result must fulfil the condition.
|
||||
# let $wait_for_all= 1;
|
||||
# let $show_statement= SHOW PROCESSLIST;
|
||||
# let $field= State;
|
||||
# let $condition= = 'Updating';
|
||||
@ -46,27 +49,56 @@ inc $max_run_time;
|
||||
|
||||
let $found= 0;
|
||||
let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time`;
|
||||
while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
|
||||
|
||||
if (`SELECT '$wait_for_all' != '1'`)
|
||||
{
|
||||
# Sleep a bit to avoid too heavy load.
|
||||
real_sleep 0.2;
|
||||
let $rowno= 1;
|
||||
let $process_result= 1;
|
||||
while (`SELECT $process_result = 1 AND $found = 0`)
|
||||
{
|
||||
let $field_value= query_get_value($show_statement, $field, $rowno);
|
||||
if (`SELECT '$field_value' $condition`)
|
||||
{
|
||||
let $found= 1;
|
||||
}
|
||||
if (`SELECT '$field_value' = 'No such row'`)
|
||||
{
|
||||
# We are behind the last row of the result set.
|
||||
let $process_result= 0;
|
||||
}
|
||||
inc $rowno;
|
||||
}
|
||||
while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
|
||||
{
|
||||
# Sleep a bit to avoid too heavy load.
|
||||
real_sleep 0.2;
|
||||
let $rowno= 1;
|
||||
let $process_result= 1;
|
||||
while (`SELECT $process_result = 1 AND $found = 0`)
|
||||
{
|
||||
let $field_value= query_get_value($show_statement, $field, $rowno);
|
||||
if (`SELECT '$field_value' $condition`)
|
||||
{
|
||||
let $found= 1;
|
||||
}
|
||||
if (`SELECT '$field_value' = 'No such row'`)
|
||||
{
|
||||
# We are behind the last row of the result set.
|
||||
let $process_result= 0;
|
||||
}
|
||||
inc $rowno;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (`SELECT '$wait_for_all' = '1'`)
|
||||
{
|
||||
while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
|
||||
{
|
||||
# Sleep a bit to avoid too heavy load.
|
||||
real_sleep 0.2;
|
||||
let $rowno= 1;
|
||||
let $process_result= 1;
|
||||
while (`SELECT $process_result = 1 AND $found = 0`)
|
||||
{
|
||||
let $field_value= query_get_value($show_statement, $field, $rowno);
|
||||
if (`SELECT '$field_value' = 'No such row'`)
|
||||
{
|
||||
let $found= 1;
|
||||
}
|
||||
if (`SELECT $found = 0 AND NOT '$field_value' $condition`)
|
||||
{
|
||||
let process_result= 0;
|
||||
}
|
||||
inc $rowno;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found)
|
||||
{
|
||||
echo # Timeout in include/wait_show_condition.inc for $wait_condition;
|
||||
|
Reference in New Issue
Block a user