1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-08 17:02:21 +03:00

Merge mysql.com:/home/pz/mysql/mysql-4.1-root

into mysql.com:/home/pz/mysql/mysql-4.1


BitKeeper/etc/logging_ok:
  auto-union
include/mysql_com.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
This commit is contained in:
unknown
2002-10-27 13:13:31 +03:00
115 changed files with 985 additions and 642 deletions

View File

@ -4,7 +4,7 @@ connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,);
connection slave;
--error 0,1199
!slave stop;
!stop slave;
@r/slave-stopped.result show status like 'Slave_running';
connection master;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@ -13,7 +13,7 @@ connection slave;
reset slave;
# Clean up old test tables
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
@r/slave-running.result show status like 'Slave_running';
# Set the default connection to 'master'

View File

@ -192,6 +192,7 @@ CHARACTER_SET=latin1
DBUSER=""
START_WAIT_TIMEOUT=10
STOP_WAIT_TIMEOUT=10
TEST_REPLICATION=0
while test $# -gt 0; do
case "$1" in
@ -265,6 +266,9 @@ while test $# -gt 0; do
--user-test=*)
USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"`
;;
--rpl)
TEST_REPLICATION=1
;;
--mysqld=*)
TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"`
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $TMP"
@ -1289,15 +1293,22 @@ $ECHO $DASH72
if [ -z "$1" ] ;
then
if [ x$RECORD = x1 ]; then
$ECHO "Will not run in record mode without a specific test case."
else
for tf in $TESTDIR/*.$TESTSUFFIX
do
run_testcase $tf
done
$RM -f $TIMEFILE # Remove for full test
fi
if [ x$RECORD = x1 ]; then
$ECHO "Will not run in record mode without a specific test case."
else
if [ x$TEST_REPLICATION = x1 ]; then
for tf in $TESTDIR/rpl*.$TESTSUFFIX
do
run_testcase $tf
done
else
for tf in $TESTDIR/*.$TESTSUFFIX
do
run_testcase $tf
done
fi
$RM -f $TIMEFILE # Remove for full test
fi
else
while [ ! -z "$1" ]; do
tname=`$BASENAME $1 .test`

View File

@ -193,7 +193,7 @@ INSERT INTO t1 (art) VALUES ('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'
('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j');
select count(*) from t1 where upper(art) = 'J';
count(*)
602
213
select count(*) from t1 where art = 'J' or art = 'j';
count(*)
602

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists t1,t2,t3;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
@ -30,9 +30,9 @@ abandoned
abandoning
abandonment
abandons
slave stop;
stop slave;
set password for root@"localhost" = password('foo');
slave start;
start slave;
set password for root@"localhost" = password('');
create table t3(n int);
insert into t3 values(1),(2);
@ -45,13 +45,13 @@ sum(length(word))
141
drop table t1,t3;
reset master;
slave stop;
stop slave;
reset slave;
create table t1(n int);
select get_lock("hold_slave",10);
get_lock("hold_slave",10)
1
slave start;
start slave;
select release_lock("hold_slave");
release_lock("hold_slave")
1
@ -68,7 +68,7 @@ kill @id;
drop table t2;
Server shutdown in progress
set global sql_slave_skip_counter=1;
slave start;
start slave;
select count(*) from t1;
count(*)
5000

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists t1;
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
@ -17,7 +17,7 @@ show slave hosts;
Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 9999 2 1
drop table t1;
slave stop;
stop slave;
drop table if exists t2;
create table t2(id int auto_increment primary key, created datetime);
set timestamp=12345;
@ -25,7 +25,7 @@ insert into t2 set created=now();
select * from t2;
id created
1 1970-01-01 06:25:45
slave start;
start slave;
select * from t2;
id created
1 1970-01-01 06:25:45

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists t1;
create table t1(n int primary key);
insert into t1 values (1),(2),(2);

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
set SQL_LOG_BIN=0;
drop table if exists t1;
create table t1 (word char(20) not null, index(word));

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists t1;
CREATE TABLE t1 (name varchar(64), age smallint(3));
INSERT INTO t1 SET name='Andy', age=31;

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
set SQL_LOG_BIN=0,timestamp=200006;
drop table if exists t1;
create table t1(t timestamp not null,a char(1));

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists foo;
create table foo (n int);
insert into foo values(4);

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
use test;
drop table if exists foo;
create table foo (n int);

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop database if exists foo;
create database foo;
drop database if exists bar;

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists t1;
drop table if exists t1;
create table t1 (n int not null auto_increment primary key);

View File

@ -1,14 +1,14 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists t1;
create table t1 (n int);
insert into t1 values(1);
slave stop;
slave start;
stop slave;
start slave;
insert into t1 values(2);
select * from t1;
n

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists t1,t2,t3;
create table t2 (n int);
create temporary table t1 (n int);

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists t2;
create table t2(n int);
create temporary table t1 (n int);

View File

@ -14,7 +14,7 @@ master_password='',master_port=MASTER_PORT;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 7 4 slave-relay-bin.001 4 No No 0 0 0 4
slave start;
start slave;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 7 master-bin.001 79 slave-relay-bin.001 120 master-bin.001 Yes Yes 0 0 79 120

View File

@ -1,7 +1,7 @@
reset master;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
slave start;
start slave;
drop table if exists t1;
create table t1(n int);
insert into t1 values(24);

View File

@ -1,6 +1,6 @@
reset slave;
slave start;
show master logs;
start slave;
show binary logs;
Log_name
master-bin.001
master-bin.002

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop database if exists d1;
create database d1;
create table d1.t1 ( n int);

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists t1;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space

View File

@ -1,8 +1,8 @@
slave stop;
stop slave;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 1
@ -17,14 +17,14 @@ rpl_recovery_rank 2
show status like 'Rpl_status';
Variable_name Value
Rpl_status ACTIVE_SLAVE
slave start;
start slave;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 3
show status like 'Rpl_status';
Variable_name Value
Rpl_status ACTIVE_SLAVE
slave start;
start slave;
show variables like 'rpl_recovery_rank';
Variable_name Value
rpl_recovery_rank 4

View File

@ -1,16 +1,16 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=MASTER_PORT;
slave start;
slave stop;
start slave;
stop slave;
change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT;
slave start;
start slave;
flush logs;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
create table t1(n int);
insert into t1 values(get_lock("lock",2));
select get_lock("lock",2);

View File

@ -1,10 +1,10 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
slave stop;
start slave;
stop slave;
reset master;
reset slave;
reset master;
@ -36,9 +36,9 @@ show binlog events from 79 limit 2,1;
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 200 Query 1 200 use `test`; insert into t1 values (NULL)
flush logs;
slave start;
start slave;
flush logs;
slave stop;
stop slave;
create table t1 (n int);
insert into t1 values (1);
drop table t1;
@ -59,12 +59,12 @@ Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.002 4 Query 1 4 use `test`; create table t1 (n int)
master-bin.002 62 Query 1 62 use `test`; insert into t1 values (1)
master-bin.002 122 Query 1 122 use `test`; drop table t1
show master logs;
show binary logs;
Log_name
master-bin.001
master-bin.002
slave start;
show master logs;
start slave;
show binary logs;
Log_name
slave-bin.001
slave-bin.002

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
show master status;
File Position Binlog_do_db Binlog_ignore_db
master-bin.001 79
@ -11,17 +11,17 @@ show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 79 slave-relay-bin.002 120 master-bin.001 Yes Yes 0 0 79 124
change master to master_log_pos=73;
slave stop;
stop slave;
change master to master_log_pos=73;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 73 slave-relay-bin.001 4 master-bin.001 No No 0 0 73 4
slave start;
start slave;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 73 slave-relay-bin.001 4 master-bin.001 No Yes 0 0 73 4
change master to master_log_pos=173;
slave start;
start slave;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 master-bin.001 173 slave-relay-bin.001 4 master-bin.001 No Yes 0 0 173 4
@ -33,7 +33,7 @@ drop table if exists t1;
create table t1 (n int);
insert into t1 values (1),(2),(3);
change master to master_log_pos=79;
slave start;
start slave;
select * from t1;
n
1

View File

@ -1,20 +1,20 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
create table t1(n int auto_increment primary key);
insert into t1 values (2);
insert into t1 values(NULL);
insert into t1 values(NULL);
delete from t1 where n = 2;
slave start;
slave stop;
start slave;
stop slave;
create table t2(n int);
drop table t2;
insert into t1 values(NULL);
slave start;
start slave;
select * from t1;
n
1

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
SHOW SLAVE STATUS;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
SHOW SLAVE HOSTS;

View File

@ -1,13 +1,13 @@
slave start;
start slave;
Could not initialize master info structure, check permisions on master.info
slave start;
start slave;
Could not initialize master info structure, check permisions on master.info
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
Could not initialize master info
reset slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
reset master;
slave start;
start slave;
drop table if exists t1, t2, t3, t4;
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables");
@ -25,7 +25,7 @@ drop table if exists t2;
create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123);
flush logs;
show master logs;
show binary logs;
Log_name
master-bin.001
master-bin.002
@ -39,9 +39,9 @@ insert into t2 values(1234);
set insert_id=1234;
insert into t2 values(NULL);
set global sql_slave_skip_counter=1;
slave start;
start slave;
purge master logs to 'master-bin.003';
show master logs;
show binary logs;
Log_name
master-bin.003
insert into t2 values (65);
@ -60,7 +60,7 @@ insert into temp_table values ("testing temporary tables part 2");
drop table if exists t3;
create table t3 (n int);
create table t4 select * from temp_table;
show master logs;
show binary logs;
Log_name
master-bin.003
master-bin.004

View File

@ -1,9 +1,9 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
drop table if exists t1;
create table t1 (n int not null primary key);
insert into t1 values (1);

View File

@ -1,16 +1,16 @@
slave stop;
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
slave start;
start slave;
create table t2(n int);
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL),(NULL);
truncate table t1;
insert into t1 values (4),(NULL);
slave stop;
slave start;
stop slave;
start slave;
insert into t1 values (NULL),(NULL);
flush logs;
truncate table t1;

View File

@ -93,13 +93,13 @@ c int not null comment 'int column'
show create table t1 ;
Table Create Table
t1 CREATE TABLE `t1` (
`test_set` set('val1','val2','val3') NOT NULL default '',
`test_set` set('val1','val2','val3') character set latin1 NOT NULL default '',
`name` char(20) character set latin1 default 'O''Brien' COMMENT 'O''Brien as default',
`c` int(11) NOT NULL default '0' COMMENT 'int column'
) TYPE=MyISAM CHARSET=latin1 COMMENT='it''s a table'
show full columns from t1;
Field Type Null Key Default Extra Privileges Comment
test_set set('val1','val2','val3') select,insert,update,references
test_set set('val1','val2','val3') character set latin1 select,insert,update,references
name char(20) character set latin1 YES O'Brien select,insert,update,references O'Brien as default
c int(11) 0 select,insert,update,references int column
drop table t1;

View File

@ -198,4 +198,22 @@ EXPLAIN SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY No tables used
2 SUBSELECT searchconthardwarefr3 index NULL PRIMARY 41 NULL 2 where used; Using index
SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03';
date
2002-08-03
SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03');
(SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03')
2002-08-03
SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1;
1
1
1
1
SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1;
Subselect returns more than 1 record
EXPLAIN SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION SELECT 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY searchconthardwarefr3 index NULL topic 3 NULL 2 Using index
2 SUBSELECT No tables used
3 UNION No tables used
drop table searchconthardwarefr3;

View File

@ -1626,13 +1626,13 @@ create table t1 (a enum (' ','a','b') not null);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('','a','b') NOT NULL default ''
`a` enum('','a','b') character set latin1 NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1
drop table t1;
create table t1 (a enum (' ','a','b ') not null default 'b ');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('','a','b') NOT NULL default 'b'
`a` enum('','a','b') character set latin1 NOT NULL default 'b'
) TYPE=MyISAM CHARSET=latin1
drop table t1;

View File

@ -61,8 +61,8 @@ blob_col blob YES NULL select,insert,update,references
tinyblob_col tinyblob YES NULL select,insert,update,references
mediumblob_col mediumblob select,insert,update,references
longblob_col longblob select,insert,update,references
options enum('one','two','tree') MUL one select,insert,update,references
flags set('one','two','tree') select,insert,update,references
options enum('one','two','tree') character set latin1 MUL one select,insert,update,references
flags set('one','two','tree') character set latin1 select,insert,update,references
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 auto A 0 NULL NULL BTREE
@ -190,8 +190,8 @@ date_time datetime YES NULL select,insert,update,references
new_blob_col varchar(20) character set latin1 YES NULL select,insert,update,references
tinyblob_col tinyblob YES NULL select,insert,update,references
mediumblob_col mediumblob select,insert,update,references
options enum('one','two','tree') MUL one select,insert,update,references
flags set('one','two','tree') select,insert,update,references
options enum('one','two','tree') character set latin1 MUL one select,insert,update,references
flags set('one','two','tree') character set latin1 select,insert,update,references
new_field varchar(10) character set latin1 new select,insert,update,references
show full columns from t2;
Field Type Null Key Default Extra Privileges Comment
@ -216,8 +216,8 @@ date_time datetime YES NULL select,insert,update,references
new_blob_col varchar(20) character set latin1 YES NULL select,insert,update,references
tinyblob_col tinyblob YES NULL select,insert,update,references
mediumblob_col mediumblob select,insert,update,references
options enum('one','two','tree') one select,insert,update,references
flags set('one','two','tree') select,insert,update,references
options enum('one','two','tree') character set latin1 one select,insert,update,references
flags set('one','two','tree') character set latin1 select,insert,update,references
new_field varchar(10) character set latin1 new select,insert,update,references
select t1.auto,t2.auto from t1,t2 where t1.auto=t2.auto and ((t1.string<>t2.string and (t1.string is not null or t2.string is not null)) or (t1.tiny<>t2.tiny and (t1.tiny is not null or t2.tiny is not null)) or (t1.short<>t2.short and (t1.short is not null or t2.short is not null)) or (t1.medium<>t2.medium and (t1.medium is not null or t2.medium is not null)) or (t1.long_int<>t2.long_int and (t1.long_int is not null or t2.long_int is not null)) or (t1.longlong<>t2.longlong and (t1.longlong is not null or t2.longlong is not null)) or (t1.real_float<>t2.real_float and (t1.real_float is not null or t2.real_float is not null)) or (t1.real_double<>t2.real_double and (t1.real_double is not null or t2.real_double is not null)) or (t1.utiny<>t2.utiny and (t1.utiny is not null or t2.utiny is not null)) or (t1.ushort<>t2.ushort and (t1.ushort is not null or t2.ushort is not null)) or (t1.umedium<>t2.umedium and (t1.umedium is not null or t2.umedium is not null)) or (t1.ulong<>t2.ulong and (t1.ulong is not null or t2.ulong is not null)) or (t1.ulonglong<>t2.ulonglong and (t1.ulonglong is not null or t2.ulonglong is not null)) or (t1.time_stamp<>t2.time_stamp and (t1.time_stamp is not null or t2.time_stamp is not null)) or (t1.date_field<>t2.date_field and (t1.date_field is not null or t2.date_field is not null)) or (t1.time_field<>t2.time_field and (t1.time_field is not null or t2.time_field is not null)) or (t1.date_time<>t2.date_time and (t1.date_time is not null or t2.date_time is not null)) or (t1.new_blob_col<>t2.new_blob_col and (t1.new_blob_col is not null or t2.new_blob_col is not null)) or (t1.tinyblob_col<>t2.tinyblob_col and (t1.tinyblob_col is not null or t2.tinyblob_col is not null)) or (t1.mediumblob_col<>t2.mediumblob_col and (t1.mediumblob_col is not null or t2.mediumblob_col is not null)) or (t1.options<>t2.options and (t1.options is not null or t2.options is not null)) or (t1.flags<>t2.flags and (t1.flags is not null or t2.flags is not null)) or (t1.new_field<>t2.new_field and (t1.new_field is not null or t2.new_field is not null)));
auto auto

View File

@ -3,13 +3,13 @@ create table t1 (a set (' ','a','b') not null);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` set('','a','b') NOT NULL default ''
`a` set('','a','b') character set latin1 NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1
drop table t1;
create table t1 (a set (' ','a','b ') not null default 'b ');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` set('','a','b') NOT NULL default 'b'
`a` set('','a','b') character set latin1 NOT NULL default 'b'
) TYPE=MyISAM CHARSET=latin1
drop table t1;

View File

@ -1,4 +1,5 @@
-- source include/have_bdb.inc
# test for bug reported by Mark Steele
drop table if exists t1;

View File

@ -12,11 +12,11 @@ select * from t1;
save_master_pos;
connection slave;
sync_with_master;
slave stop;
stop slave;
connection master;
set password for root@"localhost" = password('foo');
connection slave;
slave start;
start slave;
connection master;
#
# Give slave time to do at last one failed connect retry
@ -43,7 +43,7 @@ sync_with_master;
connection master;
reset master;
connection slave;
slave stop;
stop slave;
reset slave;
connection master;
@ -62,7 +62,7 @@ enable_query_log;
# Try to cause a large relay log lag on the slave
connection slave;
select get_lock("hold_slave",10);
slave start;
start slave;
#hope this is long enough for I/O thread to fetch over 16K relay log data
sleep 3;
select release_lock("hold_slave");
@ -100,7 +100,7 @@ wait_for_slave_to_stop;
# show slave status;
set global sql_slave_skip_counter=1;
slave start;
start slave;
select count(*) from t1;
connection master1;
drop table t1;

View File

@ -3,18 +3,14 @@ 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;
sync_with_master;
sync_slave_with_master;
select * from t1;
connection master;
--replace_result $SLAVE_MYPORT 9999
show slave hosts;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
slave stop;
sync_slave_with_master;
stop slave;
connection master;
drop table if exists t2;
create table t2(id int auto_increment primary key, created datetime);
@ -23,11 +19,9 @@ insert into t2 set created=now();
select * from t2;
save_master_pos;
connection slave;
slave start;
start slave;
sync_with_master;
select * from t2;
connection master;
drop table t2;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;

View File

@ -2,20 +2,14 @@ source include/master-slave.inc;
drop table if exists t1;
create table t1 (n int);
insert into t1 values(1);
save_master_pos;
connection slave;
sync_with_master;
slave stop;
slave start;
sync_slave_with_master;
stop slave;
start slave;
connection master;
insert into t1 values(2);
save_master_pos;
connection slave;
#let slave catch up
sync_with_master;
sync_slave_with_master;
select * from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;

View File

@ -18,7 +18,7 @@ eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT;
--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
slave start;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
@ -26,12 +26,8 @@ connection master;
drop table if exists t1;
create table t1 (n int);
insert into t1 values (10),(45),(90);
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;

View File

@ -5,17 +5,13 @@ reset master;
grant replication slave on *.* to replicate@localhost identified by 'aaaaaaaaaaaaaaab';
grant replication slave on *.* to replicate@127.0.0.1 identified by 'aaaaaaaaaaaaaaab';
connection slave;
slave start;
start slave;
connection master;
drop table if exists t1;
create table t1(n int);
insert into t1 values(24);
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;

View File

@ -10,18 +10,14 @@ server_stop master;
server_start master;
connection slave;
reset slave;
slave start;
start slave;
connection master;
show master logs;
show binary logs;
drop table if exists t1;
create table t1(n int);
insert into t1 values (3351);
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;

View File

@ -7,18 +7,16 @@ show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
create table t1(n int);
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
connection slave_sec;
slave start;
start slave;
sync_with_master;
show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
connection slave_ter;
slave start;
start slave;
sync_with_master;
show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';

View File

@ -7,13 +7,13 @@ connection slave;
--replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$MASTER_MYPORT;
slave start;
start slave;
connection master;
slave stop;
stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$SLAVE_MYPORT;
slave start;
start slave;
flush logs;
sleep 5;
--replace_result $SLAVE_MYPORT SLAVE_PORT

View File

@ -2,7 +2,7 @@ source include/master-slave.inc;
#clean up slave binlogs
connection slave;
slave stop;
stop slave;
reset master;
reset slave;
let $VERSION=`select version()`;
@ -26,10 +26,10 @@ flush logs;
save_master_pos;
connection slave;
slave start;
start slave;
sync_with_master;
flush logs;
slave stop;
stop slave;
connection master;
# Create some entries for second log
@ -40,12 +40,12 @@ drop table t1;
--replace_result $VERSION VERSION
show binlog events;
show binlog events in 'master-bin.002';
show master logs;
show binary logs;
save_master_pos;
connection slave;
slave start;
start slave;
sync_with_master;
show master logs;
show binary logs;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION
show binlog events in 'slave-bin.001' from 4;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT $VERSION VERSION

View File

@ -3,25 +3,23 @@
#
source include/master-slave.inc;
show master status;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
change master to master_log_pos=73;
sleep 5;
slave stop;
stop slave;
change master to master_log_pos=73;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
slave start;
start slave;
sleep 5;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
change master to master_log_pos=173;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
slave start;
start slave;
sleep 2;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
@ -34,11 +32,9 @@ insert into t1 values (1),(2),(3);
save_master_pos;
connection slave;
change master to master_log_pos=79;
slave start;
start slave;
sync_with_master;
select * from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;

View File

@ -4,9 +4,7 @@ source include/master-slave.inc;
# first, cause a duplicate key problem on the slave
create table t1(n int auto_increment primary key);
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
insert into t1 values (2);
connection master;
insert into t1 values(NULL);
@ -16,11 +14,11 @@ connection slave;
sleep 3; # there is no way around this sleep - we have to wait until
# the slave tries to run the query, fails and aborts slave thread
delete from t1 where n = 2;
slave start;
start slave;
sync_with_master;
#now the buggy slave would be confused on the offset but it can replicate
#in order to make it break, we need to stop/start the slave one more time
slave stop;
stop slave;
connection master;
# to be able to really confuse the slave, we need some non-auto-increment
# events in the log
@ -29,7 +27,7 @@ drop table t2;
insert into t1 values(NULL);
save_master_pos;
connection slave;
slave start;
start slave;
#now the truth comes out - if the slave is buggy, it will never sync because
#the slave thread is not able to read events
sync_with_master;
@ -37,7 +35,5 @@ select * from t1;
#clean up
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;

View File

@ -15,10 +15,10 @@ system cat /dev/null > var/slave-data/master.info;
system chmod 000 var/slave-data/master.info;
connection slave;
--error 1201
slave start;
start slave;
system chmod 600 var/slave-data/master.info;
--error 1201
slave start;
start slave;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
# Will get error 13 on Unix systems becasue file is not readable
!eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
@ -28,7 +28,7 @@ eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master
connection master;
reset master;
connection slave;
slave start;
start slave;
connection master;
drop table if exists t1, t2, t3, t4;
@ -40,9 +40,7 @@ create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables");
create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
select * from t1;
@ -52,12 +50,10 @@ drop table if exists t2;
create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123);
flush logs;
show master logs;
show binary logs;
create table t3 select * from temp_table;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t3;
connection master;
@ -83,21 +79,17 @@ wait_for_slave_to_stop;
#restart slave skipping one event
set global sql_slave_skip_counter=1;
slave start;
start slave;
connection master;
save_master_pos;
#let slave catch up
connection slave;
sync_with_master;
sync_slave_with_master;
connection master;
purge master logs to 'master-bin.003';
show master logs;
show binary logs;
insert into t2 values (65);
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
select * from t2;
@ -121,12 +113,12 @@ while ($1)
}
enable_query_log;
create table t4 select * from temp_table;
show master logs;
show binary logs;
show master status;
save_master_pos;
connection slave;
#slave stop;
#slave start;
#stop slave;
#start slave;
sync_with_master;
select * from t4;
@ -140,6 +132,4 @@ unlock tables;
#clean up
connection master;
drop table if exists t1,t2,t3,t4;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;

View File

@ -9,22 +9,16 @@ insert into t1 values (NULL),(NULL);
truncate table t1;
# We have to use 4 in the following to make this test work with all table types
insert into t1 values (4),(NULL);
save_master_pos;
connection slave;
sync_with_master;
slave stop;
slave start;
sync_slave_with_master;
stop slave;
start slave;
connection master;
insert into t1 values (NULL),(NULL);
flush logs;
truncate table t1;
insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
connection master;
drop table t1,t2;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;

View File

@ -108,4 +108,10 @@ INSERT INTO searchconthardwarefr3 (topic,date,pseudo) VALUES
('43506','2002-10-02','joce'),('40143','2002-08-03','joce');
EXPLAIN SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03';
EXPLAIN SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03');
SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03';
SELECT (SELECT DISTINCT date FROM searchconthardwarefr3 WHERE date='2002-08-03');
SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1;
-- error 1240
SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1;
EXPLAIN SELECT 1 FROM searchconthardwarefr3 WHERE 1=(SELECT 1 UNION SELECT 1);
drop table searchconthardwarefr3;