Commit 27e1a36d authored by unknown's avatar unknown

Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl

into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge


mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  Auto merged
mysql-test/suite/binlog/r/binlog_row_binlog.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Auto merged
mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test:
  Auto merged
mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
mysql-test/include/have_multi_ndb.inc:
  Manual merge.
mysql-test/suite/rpl_ndb/r/rpl_ndb_transaction.result:
  Manual merge.
mysql-test/suite/rpl_ndb/t/rpl_ndb_transaction.test:
  Manual merge.
parents 1754c58d c06d3d70
disable_query_log;
--require r/true.require
select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'innodb';
select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'innodb';
enable_query_log;
......@@ -4,18 +4,26 @@ connect (server2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
# Check that server1 has NDB support
connection server1;
let $engines_table= query_get_value(SHOW TABLES FROM information_schema LIKE 'engines', Tables_in_information_schema (engines), 1);
disable_query_log;
if (`SELECT 1 FROM dual WHERE '$engines_table' = 'engines'`)
{
--require r/true.require
select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
SELECT (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
--source include/ndb_not_readonly.inc
}
enable_query_log;
# Check that server2 has NDB support
connection server2;
let $engines_table= query_get_value(SHOW TABLES FROM information_schema LIKE 'engines', Tables_in_information_schema (engines), 1);
disable_query_log;
if (`SELECT 1 FROM dual WHERE '$engines_table' = 'engines'`)
{
--require r/true.require
select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'ndbcluster';
SELECT (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` FROM information_schema.engines WHERE engine = 'ndbcluster';
--source include/ndb_not_readonly.inc
}
enable_query_log;
# cleanup
......
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;
start slave;
drop table if exists t1, t2;
drop view if exists v1, v2, v3, not_exist_view;
create table t1 (a int);
create table t2 (b int);
create table t3 (c int);
create view v1 as select * from t1;
create view v2 as select * from t2;
create view v3 as select * from t3;
drop view not_exist_view;
ERROR 42S02: Unknown table 'not_exist_view'
drop view v1, not_exist_view;
ERROR 42S02: Unknown table 'not_exist_view'
select * from v1;
ERROR 42S02: Table 'test.v1' doesn't exist
drop view v2, v3;
select * from v1;
ERROR 42S02: Table 'test.v1' doesn't exist
select * from v2;
ERROR 42S02: Table 'test.v2' doesn't exist
select * from v3;
ERROR 42S02: Table 'test.v3' doesn't exist
......@@ -20,21 +20,17 @@ INSERT INTO t2 VALUES(2);
ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1;
USE mysqltest_sisyfos;
ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
SHOW DATABASES;
Database
information_schema
SHOW DATABASES LIKE 'mysql%';
Database (mysql%)
mysql
mysqltest_bob
mysqltest_prometheus
mysqltest_sisyfos
test
SHOW DATABASES;
Database
information_schema
SHOW DATABASES LIKE 'mysql%';
Database (mysql%)
mysql
mysqltest_prometheus
mysqltest_sisyfos
test
DROP DATABASE IF EXISTS mysqltest_sisyfos;
USE mysqltest_prometheus;
CREATE TABLE t1 (a INT);
......@@ -42,21 +38,17 @@ INSERT INTO t1 VALUES (1);
CREATE DATABASE mysqltest_sisyfos;
USE mysqltest_sisyfos;
CREATE TABLE t2 (a INT);
SHOW DATABASES;
Database
information_schema
SHOW DATABASES LIKE 'mysql%';
Database (mysql%)
mysql
mysqltest_bob
mysqltest_prometheus
mysqltest_sisyfos
test
SHOW DATABASES;
Database
information_schema
SHOW DATABASES LIKE 'mysql%';
Database (mysql%)
mysql
mysqltest_prometheus
mysqltest_sisyfos
test
USE mysqltest_prometheus;
SHOW TABLES;
Tables_in_mysqltest_prometheus
......
......@@ -30,13 +30,11 @@ drop database mysqltest2;
set sql_log_bin = 0;
create database mysqltest2;
create database mysqltest;
show databases;
Database
information_schema
show databases like 'mysql%';
Database (mysql%)
mysql
mysqltest
mysqltest2
test
create table mysqltest2.t1(n int, s char(20))ENGINE=MyISAM;
create table mysqltest2.t2(n int, s text)ENGINE=MyISAM;
insert into mysqltest2.t1 values (1, 'one'), (2, 'two'), (3, 'three');
......@@ -47,11 +45,9 @@ insert into mysqltest.t1 values (1, 'one test'), (2, 'two test'), (3, 'three tes
insert into mysqltest.t2 values (11, 'eleven test'), (12, 'twelve test'),
(13, 'thirteen test');
set sql_log_bin = 1;
show databases;
Database
information_schema
show databases like 'mysql%';
Database (mysql%)
mysql
test
create database mysqltest2;
create table mysqltest2.t1(n int, s char(20))ENGINE=MyISAM;
insert into mysqltest2.t1 values (1, 'original foo.t1');
......@@ -66,14 +62,12 @@ insert into mysqltest.t1 values (1, 'original bar.t1');
create table mysqltest.t3(n int, s char(20))ENGINE=MyISAM;
insert into mysqltest.t3 values (1, 'original bar.t3');
load data from master;
show databases;
Database
information_schema
show databases like 'mysql%';
Database (mysql%)
mysql
mysqltest
mysqltest2
mysqltest3
test
use mysqltest2;
show tables;
Tables_in_mysqltest2
......
set global server_id=1;
reset master;
drop table if exists t1,t2,t3;
create table t1 (a int);
select @@server_id;
@@server_id
1
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; drop table if exists t1,t2,t3
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
set global server_id=2;
create table t2 (b int);
select @@server_id;
@@server_id
2
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; drop table if exists t1,t2,t3
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
master-bin.000001 # Query 2 # use `test`; create table t2 (b int)
set global server_id=3;
create table t3 (c int);
select @@server_id;
@@server_id
3
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; drop table if exists t1,t2,t3
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
master-bin.000001 # Query 2 # use `test`; create table t2 (b int)
master-bin.000001 # Query 3 # use `test`; create table t3 (c int)
set global server_id=1;
drop table t1,t2,t3;
......@@ -42,9 +42,9 @@ USE mysqltest_sisyfos;
# The following should *not* be replicated
ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
SHOW DATABASES;
SHOW DATABASES LIKE 'mysql%';
sync_slave_with_master;
SHOW DATABASES;
SHOW DATABASES LIKE 'mysql%';
connection master;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
......@@ -55,9 +55,9 @@ CREATE DATABASE mysqltest_sisyfos;
USE mysqltest_sisyfos;
CREATE TABLE t2 (a INT);
let $VERSION=`select version()`;
SHOW DATABASES;
SHOW DATABASES LIKE 'mysql%';
sync_slave_with_master;
SHOW DATABASES;
SHOW DATABASES LIKE 'mysql%';
USE mysqltest_prometheus;
SHOW TABLES;
USE mysqltest_sisyfos;
......
......@@ -54,7 +54,7 @@ connection master;
set sql_log_bin = 0;
create database mysqltest2;
create database mysqltest;
show databases;
show databases like 'mysql%';
create table mysqltest2.t1(n int, s char(20))ENGINE=MyISAM;
create table mysqltest2.t2(n int, s text)ENGINE=MyISAM;
insert into mysqltest2.t1 values (1, 'one'), (2, 'two'), (3, 'three');
......@@ -71,7 +71,7 @@ connection slave;
sync_with_master;
# This should show that the slave is empty at this point
show databases;
show databases like 'mysql%';
# Create mysqltest2 and mysqltest3 on slave; we expect that LOAD DATA FROM
# MASTER will neither touch database mysqltest nor mysqltest3
create database mysqltest2;
......@@ -95,7 +95,7 @@ insert into mysqltest.t3 values (1, 'original bar.t3');
load data from master;
# Now let's check if we have the right tables and the right data in them
show databases;
show databases like 'mysql%';
use mysqltest2;
# LOAD DATA FROM MASTER uses only replicate_*_db rules to decide which
......
# Test for BUG#28908 Replication: set global server_id is not setting the session server_id
-- source include/have_log_bin.inc
let $saved_server_id=`select @@server_id`;
set global server_id=1;
reset master;
-- disable_warnings
drop table if exists t1,t2,t3;
-- enable_warnings
create table t1 (a int);
select @@server_id;
source include/show_binlog_events2.inc;
set global server_id=2;
create table t2 (b int);
select @@server_id;
source include/show_binlog_events2.inc;
set global server_id=3;
create table t3 (c int);
select @@server_id;
source include/show_binlog_events2.inc;
# cleanup
eval set global server_id=$saved_server_id;
drop table t1,t2,t3;
......@@ -94,46 +94,21 @@ a
1
--- on slave ---
STOP SLAVE;
SHOW SLAVE STATUS;
Slave_IO_State #
Master_Host 127.0.0.1
Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
Read_Master_Log_Pos #
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
Slave_IO_Running No
Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
Exec_Master_Log_Pos #
Relay_Log_Space #
Until_Condition None
Until_Log_File
Until_Log_Pos 0
Master_SSL_Allowed No
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No
Last_IO_Errno #
Last_IO_Error #
Last_SQL_Errno 0
SELECT "" AS Slave_IO_State;
Slave_IO_State
SELECT "" AS Last_SQL_Error;
Last_SQL_Error
SELECT "" AS Last_IO_Error;
Last_IO_Error
SELECT * FROM tinnodb ORDER BY a;
a
DROP TABLE tmyisam, tinnodb, tndb;
DROP TABLE tmyisam, tinnodb, tndb;
DROP TABLE tmyisam;
DROP TABLE tinnodb;
DROP TABLE tndb;
--- on master ---
DROP TABLE tmyisam;
DROP TABLE tinnodb;
DROP TABLE tndb;
......@@ -81,10 +81,10 @@ SELECT * FROM tmyisam ORDER BY a;
# the statement, and slave should roll back later when master is
# restarted.
# However, we the master to be alive so that we are sure it replicates
# the statement to the slave. So in the test case, we must therefore
# not crash the master. Instead, we fake the crash by just not writing
# the XID event to the binlog. This is done by the
# However, we want the master to be alive so that we are sure it
# replicates the statement to the slave. So in the test case, we must
# therefore not crash the master. Instead, we fake the crash by just
# not writing the XID event to the binlog. This is done by the
# --debug=d,do_not_write_xid flag in the .opt file.
# So, unlike if the master had crashed, the master *will* execute the
......@@ -110,13 +110,23 @@ SELECT * FROM tinnodb ORDER BY a;
--connection slave
--sleep 3
STOP SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
query_vertical SHOW SLAVE STATUS;
# the following statement should show that nothing has been replicated
source include/wait_for_slave_to_stop.inc;
let $tmp= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1);
eval SELECT "$tmp" AS Slave_IO_State;
let $tmp= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
eval SELECT "$tmp" AS Last_SQL_Error;
let $tmp= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1);
eval SELECT "$tmp" AS Last_IO_Error;
SELECT * FROM tinnodb ORDER BY a;
# clean up
# Clean up. We cannot do it on master and replicate over, because
# master binlog is in a bad state after last test. So we do it both on
# master and on slave.
DROP TABLE tmyisam;
DROP TABLE tinnodb;
DROP TABLE tndb;
--echo --- on master ---
connection master;
connection master;
DROP TABLE tmyisam, tinnodb, tndb;
......
# test case for bug#30998
# Drop View breaks replication if view does not exist
#
source include/master-slave.inc;
--disable_warnings
drop table if exists t1, t2;
drop view if exists v1, v2, v3, not_exist_view;
--enable_warnings
create table t1 (a int);
create table t2 (b int);
create table t3 (c int);
create view v1 as select * from t1;
create view v2 as select * from t2;
create view v3 as select * from t3;
--error 1051
drop view not_exist_view;
--error 1051
drop view v1, not_exist_view;
--error 1146
select * from v1;
drop view v2, v3;
save_master_pos;
connection slave;
sync_with_master;
--error 1146
select * from v1;
--error 1146
select * from v2;
--error 1146
select * from v3;
......@@ -1191,6 +1191,7 @@ static void fix_trans_mem_root(THD *thd, enum_var_type type)
static void fix_server_id(THD *thd, enum_var_type type)
{
server_id_supplied = 1;
thd->server_id= server_id;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment