1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

semi-manual merge, some more needs to be fixed in mysqltest.c in fully

manual mode


mysql-test/mysql-test-run.sh:
  Auto merged
sql/lex.h:
  Auto merged
Docs/manual.texi:
  merged
client/mysqltest.c:
  merged
This commit is contained in:
unknown
2001-01-17 20:42:27 -07:00
32 changed files with 528 additions and 118 deletions

View File

@ -194,11 +194,13 @@ if [ x$SOURCE_DIST = x1 ] ; then
MYSQLD="$BASEDIR/sql/mysqld"
MYSQL_TEST="$BASEDIR/client/mysqltest"
MYSQLADMIN="$BASEDIR/client/mysqladmin"
MYSQL="$BASEDIR/client/mysql"
INSTALL_DB="./install_test_db"
else
MYSQLD="$BASEDIR/bin/mysqld"
MYSQL_TEST="$BASEDIR/bin/mysqltest"
MYSQLADMIN="$BASEDIR/bin/mysqladmin"
MYSQL="$BASEDIR/bin/mysql"
INSTALL_DB="./install_test_db -bin"
fi
@ -235,6 +237,11 @@ SLAVE_MYSQLD=$MYSQLD #this can be changed later if we are doing gcov
#++
# Function Definitions
#--
wait_for_server_start ()
{
$MYSQL -e "select 1" --silent -w1 --host=127.0.0.1 --port=$1 \
>/dev/null
}
prompt_user ()
{
@ -325,6 +332,7 @@ gcov_collect () {
$ECHO "gcov info in $GCOV_MSG, errors in $GCOV_ERR"
}
start_master()
{
[ x$MASTER_RUNNING = 1 ] && return
@ -359,6 +367,7 @@ start_master()
else
$MYSQLD $master_args >> $MASTER_MYERR 2>&1 &
fi
wait_for_server_start $MASTER_MYPORT
MASTER_RUNNING=1
}
@ -404,6 +413,7 @@ start_slave()
else
$SLAVE_MYSQLD $slave_args >> $SLAVE_MYERR 2>&1 &
fi
wait_for_server_start $SLAVE_MYPORT
SLAVE_RUNNING=1
}
@ -412,7 +422,6 @@ mysql_start () {
start_master
start_slave
cd $MYSQL_TEST_DIR
sleep $SLEEP_TIME # Give mysqld time to start properly
return 1
}
@ -435,7 +444,6 @@ stop_slave ()
fi
fi
SLAVE_RUNNING=0
sleep $SLEEP_TIME # Give mysqld time to go down properly
fi
}
@ -458,7 +466,6 @@ stop_master ()
fi
fi
MASTER_RUNNING=0
sleep $SLEEP_TIME # Give mysqld time to go down properly
fi
}
@ -468,7 +475,10 @@ mysql_stop ()
$ECHO "Shutting-down MySQL daemon"
$ECHO ""
stop_master
$ECHO "Master shutdown finished"
stop_slave
$ECHO "Slave shutdown finished"
return 1
}

View File

@ -0,0 +1,5 @@
n
1
2
sum(length(word))
71

View File

@ -1,13 +1,13 @@
File Position Binlog_do_db Binlog_ignore_db
master-bin.001 73
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 1 73 Yes
127.0.0.1 root 9306 1 master-bin.001 73 Yes
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 1 73 No
127.0.0.1 root 9306 1 master-bin.001 73 No
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 1 73 Yes
127.0.0.1 root 9306 1 master-bin.001 73 Yes
Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db
127.0.0.1 root 9306 1 173 Yes
127.0.0.1 root 9306 1 master-bin.001 173 Yes
File Position Binlog_do_db Binlog_ignore_db
master-bin.001 73
n

View File

@ -7,12 +7,15 @@ load data infile '../../std_data/words.dat' into table t1;
drop table if exists foo;
create table foo(n int);
insert into foo values(1),(2);
save_master_pos;
connection slave;
sleep 2;
sync_with_master;
use test;
@r/rpl000001.a.result select * from foo;
@r/rpl000001.b.result select sum(length(word)) from t1;
select * from foo;
select sum(length(word)) from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -5,8 +5,13 @@ drop table if exists t1;
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL);
save_master_pos;
connection slave;
use test;
sleep 2;
sync_with_master;
@r/rpl000002.result select * from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -4,7 +4,12 @@ drop table if exists t1;
create table t1(n int primary key);
!insert into t1 values (1),(2),(2);
insert into t1 values (3);
save_master_pos;
connection slave;
sleep 2;
sync_with_master;
@r/rpl000003.result select * from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -16,4 +16,11 @@ drop table if exists t2;
load table t2 from master;
@r/rpl000004.a.result check table t1;
@r/rpl000004.b.result select count(*) from t2;
connection master;
set SQL_LOG_BIN=1;
drop table if exists t1,t2;
save_master_pos;
connection slave;
sync_with_master;
create table t1(n int);
drop table t1;

View File

@ -7,8 +7,12 @@ INSERT t1 SET name='Jacob', age=2;
INSERT into t1 SET name='Caleb', age=1;
ALTER TABLE t1 ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY;
@r/rpl000005.result select * from t1;
save_master_pos;
connection slave;
sleep 2;
sync_with_master;
@r/rpl000005.result select * from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -12,3 +12,6 @@ load table foo from master;
@r/rpl000006.result select unix_timestamp(t) from foo;
connection master;
drop table foo;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -15,8 +15,12 @@ insert into foo values('five');
drop table if exists bar;
create table bar (m int);
insert into bar values(15);
save_master_pos;
connection slave;
sleep 2;
sync_with_master;
@r/rpl000007.result select foo.n,bar.m from foo,bar;
connection master;
drop table if exists bar,foo;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -17,8 +17,13 @@ insert into bar values(15);
drop table if exists choo;
create table choo (k int);
insert into choo values(55);
save_master_pos;
connection slave;
sleep 3;
sync_with_master;
@r/rpl000008.result select foo.n,bar.m,choo.k from foo,bar,choo;
connection master;
drop table if exists foo,bar,choo;
save_master_pos;
connection slave;
sync_with_master;
drop table if exists foo,bar,choo;

View File

@ -6,8 +6,9 @@ drop database if exists foo;
create database foo;
drop database if exists bar;
create database bar;
save_master_pos;
connection slave;
sleep 2;
sync_with_master;
drop table if exists foo.foo;
create table foo.foo (n int);
insert into foo.foo values(4);
@ -18,9 +19,15 @@ insert into foo.foo values(5);
drop table if exists bar.bar;
create table bar.bar (m int);
insert into bar.bar values(15);
save_master_pos;
connection slave;
sleep 2;
sync_with_master;
@r/rpl000009.result select foo.foo.n,bar.bar.m from foo.foo,bar.bar;
connection master;
drop database if exists bar;
drop database if exists foo;
save_master_pos;
connection slave;
sync_with_master;
drop database if exists bar;
drop database if exists foo;

View File

@ -8,8 +8,12 @@ drop table if exists t1;
create table t1 (n int not null auto_increment primary key);
insert into t1 values(NULL);
insert into t1 values(2);
save_master_pos;
connection slave;
sleep 5;
sync_with_master;
@r/rpl000010.result select n from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -4,16 +4,21 @@ use test;
drop table if exists t1;
create table t1 (n int);
insert into t1 values(1);
save_master_pos;
connection slave;
#give slave some breathing room to get started
sleep 2;
sync_with_master;
slave stop;
slave start;
connection master;
insert into t1 values(2);
save_master_pos;
connection slave;
#let slave catch up
sleep 2;
sync_with_master;
@r/rpl000011.result select * from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -14,13 +14,18 @@ disconnect master;
connection master1;
insert into t2 values(6);
disconnect master1;
connect (master2,localhost,root,,test,0,mysql-master.sock);
connection master2;
save_master_pos;
connection slave;
sleep 1;
sync_with_master;
@r/rpl000012.result select * from t2;
@r/rpl000012.status.result show status like 'Slave_open_temp_tables';
#
# Clean up
#
connect (master2,localhost,root,,test,0,mysql-master.sock);
connection master2;
drop table if exists t1,t2;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -1,5 +1,9 @@
source include/master-slave.inc;
connection master;
save_master_pos;
connection slave;
sync_with_master;
connection master;
drop table if exists t2;
create table t2(n int);
create temporary table t1 (n int);
@ -12,21 +16,19 @@ insert into t2 select * from t1;
disconnect master;
connection master1;
insert into t2 values(6);
sleep 2;
disconnect master1;
connect (master2,localhost,root,,test,0,mysql-master.sock);
connection master2;
save_master_pos;
connection slave;
let $1=12;
while ($1)
{
!slave start;
sleep 0.2;
dec $1;
}
sync_with_master;
@r/rpl000013.result select * from t2;
@r/rpl000013.status.result show status like 'Slave_open_temp_tables';
#
# Clean up
#
connect (master2,localhost,root,,test,0,mysql-master.sock);
connection master2;
drop table if exists t1,t2;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -2,11 +2,11 @@ source include/master-slave.inc;
source include/have_default_master.inc;
connection master;
show master status;
save_master_pos;
connection slave;
sleep 0.2;
sync_with_master;
show slave status;
change master to master_log_pos=73;
sleep 0.2;
slave stop;
change master to master_log_pos=73;
show slave status;
@ -20,9 +20,13 @@ create table if not exists foo(n int);
drop table if exists foo;
create table foo (n int);
insert into foo values (1),(2),(3);
save_master_pos;
connection slave;
change master to master_log_pos=73;
sleep 2;
sync_with_master;
select * from foo;
connection master;
drop table foo;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -18,8 +18,13 @@ connection master;
drop table if exists foo;
create table foo (n int);
insert into foo values (10),(45),(90);
save_master_pos;
connection slave;
sleep 2;
sync_with_master;
select * from foo;
connection master;
drop table foo;
save_master_pos;
connection slave;
sync_with_master;

View File

@ -15,8 +15,9 @@ connection master;
drop table if exists t1;
create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
save_master_pos;
connection slave;
sleep 2;
sync_with_master;
select * from t1;
connection master;
flush logs;
@ -24,12 +25,14 @@ drop table if exists t2;
create table t2(m int);
insert into t2 values (34),(67),(123);
flush logs;
sleep 0.3;
show master logs;
purge master logs to 'master-bin.003';
show master logs;
insert into t2 values (65);
save_master_pos;
connection slave;
sleep 2;
sync_with_master;
select * from t2;
drop table if exists t1,t2;
connection master;
drop table if exists t1,t2;