Commit 46e4eabf authored by unknown's avatar unknown

Merge jmiller@bk-internal.mysql.com:/home/bk/mysql-5.1-new

into  mysql.com:/home/ndbdev/jmiller/clones/mysql-5.1-new


mysql-test/r/rpl_ndb_sync.result:
  manual merge
mysql-test/t/disabled.def:
  SCCS merged
mysql-test/t/rpl_ndb_sync.test:
  manual merge
parents c7766a95 545ac7f3
...@@ -46,7 +46,10 @@ CALL test.p2(); ...@@ -46,7 +46,10 @@ CALL test.p2();
SELECT release_lock("test"); SELECT release_lock("test");
SELECT * FROM test.t1; SELECT * FROM test.t1;
#show binlog events; #show binlog events;
# Added sleep for use with NDB to ensure that
# the injector thread will populate log before
# we switch to the slave.
sleep 5;
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
SELECT * FROM test.t1; SELECT * FROM test.t1;
......
...@@ -4,7 +4,7 @@ reset master; ...@@ -4,7 +4,7 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
create table t1 (a int); create table t1 (a int primary key);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1); insert into t1 values (1);
insert into t2 values (1); insert into t2 values (1);
......
...@@ -24,7 +24,7 @@ use mysqltest_to; ...@@ -24,7 +24,7 @@ use mysqltest_to;
select * from a; select * from a;
i i
3 3
create table t1 (a int); create table t1 (a int primary key);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1); insert into t1 values (1);
insert into t2 values (1); insert into t2 values (1);
......
...@@ -70,3 +70,4 @@ row2 new on slave 2 ...@@ -70,3 +70,4 @@ row2 new on slave 2
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State 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 Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
<Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master> <Slave_IO_State> 127.0.0.1 root MASTER_PORT 1 master-bin.000001 <Read_Master_Log_Pos> <Relay_Log_File> <Relay_Log_Pos> master-bin.000001 Yes Yes <Replicate_Ignore_Table> 0 0 <Exec_Master_Log_Pos> <Relay_Log_Space> None 0 No <Seconds_Behind_Master>
DROP TABLE IF EXISTS t1;
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 PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=NDBCLUSTER;
CREATE PROCEDURE test.p1()
BEGIN
INSERT INTO test.t1 VALUES (4);
SELECT get_lock("test", 100);
UPDATE test.t1 set a=a+4 WHERE a=4;
END|
CREATE PROCEDURE test.p2()
BEGIN
UPDATE test.t1 SET a=a+1;
END|
SELECT get_lock("test", 200);
get_lock("test", 200)
1
CALL test.p1();
CALL test.p2();
SELECT release_lock("test");
release_lock("test")
1
SELECT * FROM test.t1;
a
5
SELECT * FROM test.t1;
a
5
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=NDBCLUSTER;
CALL test.p2();
CALL test.p1();
get_lock("test", 100)
0
SELECT * FROM test.t1;
a
8
SELECT * FROM test.t1;
a
8
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
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;
create database if not exists mysqltest1;
DROP PROCEDURE IF EXISTS mysqltest1.p1;
DROP PROCEDURE IF EXISTS mysqltest1.p2;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t1;
CREATE TABLE IF NOT EXISTS mysqltest1.t1(name CHAR(16), birth DATE,PRIMARY KEY(name))ENGINE=NDBCLUSTER;
CREATE TABLE IF NOT EXISTS mysqltest1.t2(name CHAR(16), age INT ,PRIMARY KEY(name))ENGINE=NDBCLUSTER;
CREATE PROCEDURE mysqltest1.p1()
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE spa CHAR(16);
DECLARE spb INT;
DECLARE cur1 CURSOR FOR SELECT name,
(YEAR(CURDATE())-YEAR(birth))-(RIGHT(CURDATE(),5)<RIGHT(birth,5))
FROM mysqltest1.t1;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
OPEN cur1;
SET AUTOCOMMIT=0;
REPEAT
FETCH cur1 INTO spa, spb;
IF NOT done THEN
START TRANSACTION;
INSERT INTO mysqltest1.t2 VALUES (spa,spb);
COMMIT;
END IF;
UNTIL done END REPEAT;
SET AUTOCOMMIT=1;
CLOSE cur1;
END|
CREATE PROCEDURE mysqltest1.p2()
BEGIN
INSERT INTO mysqltest1.t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
END|
CALL mysqltest1.p2();
CALL mysqltest1.p1();
DROP PROCEDURE IF EXISTS mysqltest1.p1;
DROP PROCEDURE IF EXISTS mysqltest1.p2;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
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 PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE PROCEDURE test.p1(IN i INT)
BEGIN
DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (num INT,PRIMARY KEY(num))ENGINE=NDBCLUSTER;
START TRANSACTION;
INSERT INTO test.t1 VALUES(i);
savepoint t1_save;
INSERT INTO test.t1 VALUES (14);
ROLLBACK to savepoint t1_save;
COMMIT;
END|
< ---- Master selects-- >
-------------------------
CALL test.p1(12);
Warnings:
Note 1051 Unknown table 't1'
SELECT * FROM test.t1;
num
12
< ---- Slave selects-- >
------------------------
SELECT * FROM test.t1;
num
12
< ---- Master selects-- >
-------------------------
CALL test.p1(13);
SELECT * FROM test.t1;
num
13
< ---- Slave selects-- >
------------------------
SELECT * FROM test.t1;
num
13
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
...@@ -25,11 +25,13 @@ hex(c2) hex(c3) c1 ...@@ -25,11 +25,13 @@ hex(c2) hex(c3) c1
0 1 BCDEF 0 1 BCDEF
1 0 CD 1 0 CD
0 0 DEFGHIJKL 0 0 DEFGHIJKL
CREATE TEMPORARY TABLE cluster_replication.backup_info (id INT, backup_id INT) ENGINE=HEAP; CREATE TEMPORARY TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT)ENGINE=HEAP;
DELETE FROM cluster_replication.backup_info;
LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info; SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info;
@the_backup_id:=backup_id @the_backup_id:=backup_id
<the_backup_id> <the_backup_id>
DROP TABLE cluster_replication.backup_info;
UPDATE t1 SET c2=0 WHERE c3="row2"; UPDATE t1 SET c2=0 WHERE c3="row2";
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
hex(c1) hex(c2) c3 hex(c1) hex(c2) c3
......
...@@ -11,7 +11,7 @@ set @var1= "from-master-1"; ...@@ -11,7 +11,7 @@ set @var1= "from-master-1";
execute stmt1 using @var1; execute stmt1 using @var1;
set @var1= "from-master-2-'',"; set @var1= "from-master-2-'',";
execute stmt1 using @var1; execute stmt1 using @var1;
select * from t1; SELECT * FROM t1 ORDER BY n;
n n
from-master-1 from-master-1
from-master-2-'', from-master-2-'',
...@@ -19,7 +19,7 @@ set @var2= 'insert into t1 values (concat("from-var-", ?))'; ...@@ -19,7 +19,7 @@ set @var2= 'insert into t1 values (concat("from-var-", ?))';
prepare stmt2 from @var2; prepare stmt2 from @var2;
set @var1='from-master-3'; set @var1='from-master-3';
execute stmt2 using @var1; execute stmt2 using @var1;
select * from t1; SELECT * FROM t1 ORDER BY n;
n n
from-master-1 from-master-1
from-master-2-'', from-master-2-'',
......
...@@ -4,6 +4,9 @@ reset master; ...@@ -4,6 +4,9 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null); create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null);
create table t2 (a int auto_increment, primary key (a), b int); create table t2 (a int auto_increment, primary key (a), b int);
create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null); create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null);
......
...@@ -27,11 +27,12 @@ rpl_ndb_basic : Bug#16228 ...@@ -27,11 +27,12 @@ rpl_ndb_basic : Bug#16228
rpl_sp : Bug #16456 rpl_sp : Bug #16456
ndb_autodiscover : Needs to be fixed w.r.t binlog ndb_autodiscover : Needs to be fixed w.r.t binlog
ndb_autodiscover2 : Needs to be fixed w.r.t binlog ndb_autodiscover2 : Needs to be fixed w.r.t binlog
#ndb_alter_table_row : sometimes wrong error 1015!=1046 ndb_alter_table_row : sometimes wrong error 1015!=1046
ndb_gis : garbled msgs from corrupt THD* ndb_gis : garbled msgs from corrupt THD*
rpl_ndb_auto_inc : MySQL Bugs:17086 rpl_ndb_auto_inc : Bug #17086
rpl_ndb_relay_space : Bug 16993 rpl_ndb_relay_space : Bug #16993
ndb_binlog_ddl_multi : Bug #17038 ndb_binlog_ddl_multi : Bug #17038
rpl_ndb_log : MySQL Bugs: #17158 rpl_ndb_log : Bug #17158
rpl_ndb_sp007 : Bug #17290
subselect : Bug#15706 subselect : Bug#15706
ndb_load : Bug #17233 ndb_load : Bug #17233
...@@ -36,6 +36,9 @@ delimiter ;| ...@@ -36,6 +36,9 @@ delimiter ;|
CALL test.p1(); CALL test.p1();
SELECT * FROM test.t1 ORDER BY blob_column; SELECT * FROM test.t1 ORDER BY blob_column;
save_master_pos; save_master_pos;
# Need to allow some time when NDB engine is used for
# the injector thread to have time to populate binlog
sleep 10;
sync_slave_with_master; sync_slave_with_master;
connection slave; connection slave;
SELECT * FROM test.t1 ORDER BY blob_column; SELECT * FROM test.t1 ORDER BY blob_column;
......
source include/master-slave.inc; source include/master-slave.inc;
create table t1 (a int); create table t1 (a int primary key);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1); insert into t1 values (1);
insert into t2 values (1); insert into t2 values (1);
delete t1.* from t1, t2 where t1.a = t2.a; delete t1.* from t1, t2 where t1.a = t2.a;
save_master_pos; save_master_pos;
......
...@@ -36,7 +36,7 @@ select * from a; ...@@ -36,7 +36,7 @@ select * from a;
# BUG#3461 # BUG#3461
connection master; connection master;
create table t1 (a int); create table t1 (a int primary key);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1); insert into t1 values (1);
......
...@@ -109,3 +109,8 @@ SELECT * FROM t1; ...@@ -109,3 +109,8 @@ SELECT * FROM t1;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> --replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master>
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
connection master;
DROP TABLE IF EXISTS t1;
# End of 5.1 Test
#################################
# Wrapper for rpl_row_sp003.test#
# These tests have been wrapped #
# so the same code can be used #
# For different engines #
#################################
-- source include/have_ndb.inc
let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_sp003.test
#################################
# Wrapper for rpl_row_sp006.test#
# These tests have been wrapped #
# so the same code can be used #
# For different engines #
#################################
-- source include/have_ndb.inc
let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_sp006.test
#################################
# Wrapper for rpl_row_sp007.test#
# These tests have been wrapped #
# so the same code can be used #
# For different engines #
#################################
-- source include/have_ndb.inc
let $engine_type=NDBCLUSTER;
-- source extra/rpl_tests/rpl_row_sp007.test
...@@ -27,12 +27,13 @@ SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1; ...@@ -27,12 +27,13 @@ SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
# take a backup on master # take a backup on master
--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat --exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat
CREATE TEMPORARY TABLE cluster_replication.backup_info (id INT, backup_id INT) ENGINE=HEAP; CREATE TEMPORARY TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT)ENGINE=HEAP;
DELETE FROM cluster_replication.backup_info;
LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ',';
--replace_column 1 <the_backup_id> --replace_column 1 <the_backup_id>
SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info; SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info;
let the_backup_id=`select @the_backup_id` ; let the_backup_id=`select @the_backup_id` ;
DROP TABLE cluster_replication.backup_info;
# update a row # update a row
UPDATE t1 SET c2=0 WHERE c3="row2"; UPDATE t1 SET c2=0 WHERE c3="row2";
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
...@@ -129,3 +130,5 @@ connection slave; ...@@ -129,3 +130,5 @@ connection slave;
reset slave; reset slave;
# should now contain nothing # should now contain nothing
select * from cluster_replication.apply_status; select * from cluster_replication.apply_status;
# End 5.1 Test
# #
# Test of replicating user variables # Test of replicating user variables
# #
###########################################################
# 2006-02-08 By JBM added order by for use w/ NDB engine
###########################################################
source include/master-slave.inc; source include/master-slave.inc;
#save_master_pos; #save_master_pos;
...@@ -20,7 +23,7 @@ set @var1= "from-master-1"; ...@@ -20,7 +23,7 @@ set @var1= "from-master-1";
execute stmt1 using @var1; execute stmt1 using @var1;
set @var1= "from-master-2-'',"; set @var1= "from-master-2-'',";
execute stmt1 using @var1; execute stmt1 using @var1;
select * from t1; SELECT * FROM t1 ORDER BY n;
set @var2= 'insert into t1 values (concat("from-var-", ?))'; set @var2= 'insert into t1 values (concat("from-var-", ?))';
prepare stmt2 from @var2; prepare stmt2 from @var2;
...@@ -30,7 +33,7 @@ execute stmt2 using @var1; ...@@ -30,7 +33,7 @@ execute stmt2 using @var1;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
select * from t1; SELECT * FROM t1 ORDER BY n;
connection master; connection master;
......
...@@ -3,7 +3,14 @@ ...@@ -3,7 +3,14 @@
# Adding statement include due to Bug 12574 # Adding statement include due to Bug 12574
# TODO: Remove statement include once 12574 is patched # TODO: Remove statement include once 12574 is patched
--source include/have_binlog_format_statement.inc --source include/have_binlog_format_statement.inc
source include/master-slave.inc; --source include/master-slave.inc
--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
--enable_warnings
# #
# #12482: Triggers has side effects with auto_increment values # #12482: Triggers has side effects with auto_increment values
......
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