Commit 51fda104 authored by konstantin@mysql.com's avatar konstantin@mysql.com

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

into  mysql.com:/home/kostja/mysql/mysql-5.1-merge
parents 19018128 057b3f9e
......@@ -7,7 +7,7 @@ start slave;
SHOW VARIABLES LIKE 'relay_log_space_limit';
Variable_name Value
relay_log_space_limit 0
CREATE TABLE t1 (name varchar(64), age smallint(3));
CREATE TABLE t1 (name varchar(64), age smallint(3))ENGINE=MyISAM;
INSERT INTO t1 SET name='Andy', age=31;
INSERT t1 SET name='Jacob', age=2;
INSERT into t1 SET name='Caleb', age=1;
......
......@@ -17,8 +17,8 @@ BEGIN
DECLARE done INT DEFAULT 0;
DECLARE spa CHAR(16);
DECLARE spb,spc INT;
DECLARE cur1 CURSOR FOR SELECT id,data FROM test.t1;
DECLARE cur2 CURSOR FOR SELECT id2 FROM test.t2;
DECLARE cur1 CURSOR FOR SELECT id,data FROM test.t1 ORDER BY id;
DECLARE cur2 CURSOR FOR SELECT id2 FROM test.t2 ORDER BY id2;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
OPEN cur1;
OPEN cur2;
......@@ -46,13 +46,13 @@ END|
< ---- Master selects-- >
-------------------------
CALL test.p2();
SELECT * FROM test.t1;
SELECT * FROM test.t1 ORDER BY id;
id data
8 MySQL
20 ROCKS
11 Texas
10 kyle
SELECT * FROM test.t2;
11 Texas
20 ROCKS
SELECT * FROM test.t2 ORDER BY id2;
id2
1
2
......@@ -61,13 +61,13 @@ id2
< ---- Slave selects-- >
------------------------
SELECT * FROM test.t1;
SELECT * FROM test.t1 ORDER BY id;
id data
8 MySQL
20 ROCKS
11 Texas
10 kyle
SELECT * FROM test.t2;
11 Texas
20 ROCKS
SELECT * FROM test.t2 ORDER BY id2;
id2
1
2
......@@ -77,21 +77,21 @@ id2
< ---- Master selects-- >
-------------------------
CALL test.p1();
SELECT * FROM test.t3;
SELECT * FROM test.t3 ORDER BY id3;
id3 c
1 MySQL
2 ROCKS
2 kyle
3 Texas
4 kyle
4 ROCKS
< ---- Slave selects-- >
------------------------
SELECT * FROM test.t3;
SELECT * FROM test.t3 ORDER BY id3;
id3 c
1 MySQL
2 ROCKS
2 kyle
3 Texas
4 kyle
4 ROCKS
ALTER PROCEDURE test.p1 MODIFIES SQL DATA;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
......
......@@ -49,28 +49,28 @@ END;
END IF;
END|
CALL test.p1('a');
SELECT * FROM test.t2;
SELECT * FROM test.t2 ORDER BY a;
a
1
3
SELECT * FROM test.t2;
SELECT * FROM test.t2 ORDER BY a;
a
1
3
truncate test.t2;
call test.p1('b');
select * from test.t2;
select * from test.t2 ORDER BY a;
a
2
4
SELECT * FROM test.t2;
SELECT * FROM test.t2 ORDER BY a;
a
2
4
truncate test.t2;
SELECT * FROM test.t2;
SELECT * FROM test.t2 ORDER BY a;
a
SELECT * FROM test.t2;
SELECT * FROM test.t2 ORDER BY a;
a
DROP PROCEDURE test.p1;
DROP TABLE test.t1;
......
......@@ -21,15 +21,15 @@ CREATE TABLE mysqltest1.t5 (qty INT, price INT, total INT, PRIMARY KEY(qty));
INSERT INTO mysqltest1.t1 VALUES (1,'Thank'),(2,'it'),(3,'Friday');
INSERT INTO mysqltest1.t2 VALUES (1,'GOD'),(2,'is'),(3,'TGIF');
INSERT INTO mysqltest1.t4 VALUES(1, 3, 50),(2, 18, 3),(4, 4, 4);
CREATE VIEW mysqltest1.v2 AS SELECT qty, price, qty*price AS value FROM mysqltest1.t4;
CREATE VIEW mysqltest1.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM mysqltest1.t1 as t1, mysqltest1.t2 AS t2 WHERE mysqltest1.t1.a = mysqltest1.t2.a;
CREATE VIEW mysqltest1.v2 AS SELECT qty, price, qty*price AS value FROM mysqltest1.t4 ORDER BY qty;
CREATE VIEW mysqltest1.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM mysqltest1.t1 as t1, mysqltest1.t2 AS t2 WHERE mysqltest1.t1.a = mysqltest1.t2.a ORDER BY a;
CREATE VIEW mysqltest1.v3 AS SELECT * FROM mysqltest1.t1;
CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL CHECK OPTION;
SELECT * FROM mysqltest1.v2;
qty price value
3 50 150
18 3 54
4 4 16
18 3 54
SELECT * FROM mysqltest1.v1;
a c c2
1 Thank GOD
......@@ -38,8 +38,8 @@ a c c2
SELECT * FROM mysqltest1.v2;
qty price value
3 50 150
18 3 54
4 4 16
18 3 54
SELECT * FROM mysqltest1.v1;
a c c2
1 Thank GOD
......@@ -47,45 +47,45 @@ a c c2
3 Friday TGIF
INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2;
INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1;
SELECT * FROM mysqltest1.t5;
SELECT * FROM mysqltest1.t5 ORDER BY qty;
qty price total
3 50 150
18 3 54
4 4 16
SELECT * FROM mysqltest1.t3;
18 3 54
SELECT * FROM mysqltest1.t3 ORDER BY a;
a c c2
1 Thank GOD
2 it is
3 Friday TGIF
SELECT * FROM mysqltest1.t5;
SELECT * FROM mysqltest1.t5 ORDER BY qty;
qty price total
3 50 150
18 3 54
4 4 16
SELECT * FROM mysqltest1.t3;
18 3 54
SELECT * FROM mysqltest1.t3 ORDER BY a;
a c c2
1 Thank GOD
2 it is
3 Friday TGIF
INSERT INTO mysqltest1.v4 VALUES (4,'TEST');
SELECT * FROM mysqltest1.t1;
SELECT * FROM mysqltest1.t1 ORDER BY a;
a c
1 Thank
2 it
3 Friday
4 TEST
SELECT * FROM mysqltest1.v4;
SELECT * FROM mysqltest1.v4 ORDER BY a;
a c
2 it
3 Friday
4 TEST
SELECT * FROM mysqltest1.t1;
SELECT * FROM mysqltest1.t1 ORDER BY a;
a c
1 Thank
2 it
3 Friday
4 TEST
SELECT * FROM mysqltest1.v4;
SELECT * FROM mysqltest1.v4 ORDER BY a;
a c
2 it
3 Friday
......
......@@ -8,10 +8,10 @@ stop slave;
reset master;
reset slave;
reset master;
create table t1(n int not null auto_increment primary key);
create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
create table t1 (word char(20) not null);
create table t1 (word char(20) not null)ENGINE=MyISAM;
load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
select count(*) from t1;
count(*)
......@@ -20,41 +20,41 @@ drop table t1;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
master-bin.000001 # Intvar 1 # INSERT_ID=1
master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
master-bin.000001 # Query 1 # use `test`; drop table t1
show binlog events from 102 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
show binlog events from 102 limit 2;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
master-bin.000001 # Intvar 1 # INSERT_ID=1
show binlog events from 102 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
flush logs;
create table t5 (a int);
create table t5 (a int)ENGINE=MyISAM;
drop table t5;
start slave;
flush logs;
stop slave;
create table t1 (n int);
create table t1 (n int)ENGINE=MyISAM;
insert into t1 values (1);
drop table t1;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
master-bin.000001 # Intvar 1 # INSERT_ID=1
master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
master-bin.000001 # Query 1 # use `test`; drop table t1
......@@ -62,42 +62,42 @@ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
show binlog events in 'master-bin.000002';
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000002 # Query 1 # use `test`; create table t5 (a int)
master-bin.000002 # Query 1 # use `test`; create table t5 (a int)ENGINE=MyISAM
master-bin.000002 # Query 1 # use `test`; drop table t5
master-bin.000002 # Query 1 # use `test`; create table t1 (n int)
master-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=MyISAM
master-bin.000002 # Query 1 # use `test`; insert into t1 values (1)
master-bin.000002 # Query 1 # use `test`; drop table t1
show binary logs;
Log_name File_size
master-bin.000001 1393
master-bin.000002 514
master-bin.000001 1419
master-bin.000002 540
start slave;
show binary logs;
Log_name File_size
slave-bin.000001 1556
slave-bin.000002 352
slave-bin.000001 1595
slave-bin.000002 365
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)
slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
slave-bin.000001 # Intvar 1 # INSERT_ID=1
slave-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
slave-bin.000001 # Query 1 # use `test`; drop table t1
slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)
slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
slave-bin.000001 # Query 1 # use `test`; drop table t1
slave-bin.000001 # Query 1 # use `test`; create table t5 (a int)
slave-bin.000001 # Query 1 # use `test`; create table t5 (a int)ENGINE=MyISAM
slave-bin.000001 # Query 1 # use `test`; drop table t5
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
show binlog events in 'slave-bin.000002' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000002 # Query 1 # use `test`; create table t1 (n int)
slave-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=MyISAM
slave-bin.000002 # Query 1 # use `test`; insert into t1 values (1)
slave-bin.000002 # Query 1 # use `test`; drop table t1
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
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 514 # # master-bin.000002 Yes Yes # 0 0 514 # None 0 No #
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 540 # # master-bin.000002 Yes Yes # 0 0 540 # None 0 No #
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
......@@ -6,7 +6,8 @@
# Test: Tests SPs with cursors, flow logic, and alter sp. In addition the #
# tests SPs with insert and update operations. #
#############################################################################
# 2006-02-08 By JBM added ORDER BY for use with NDB engine
#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
......@@ -35,8 +36,8 @@ BEGIN
DECLARE done INT DEFAULT 0;
DECLARE spa CHAR(16);
DECLARE spb,spc INT;
DECLARE cur1 CURSOR FOR SELECT id,data FROM test.t1;
DECLARE cur2 CURSOR FOR SELECT id2 FROM test.t2;
DECLARE cur1 CURSOR FOR SELECT id,data FROM test.t1 ORDER BY id;
DECLARE cur2 CURSOR FOR SELECT id2 FROM test.t2 ORDER BY id2;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
OPEN cur1;
......@@ -68,28 +69,28 @@ delimiter ;|
let $message=< ---- Master selects-- >;
--source include/show_msg.inc
CALL test.p2();
SELECT * FROM test.t1;
SELECT * FROM test.t2;
SELECT * FROM test.t1 ORDER BY id;
SELECT * FROM test.t2 ORDER BY id2;
let $message=< ---- Slave selects-- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
SELECT * FROM test.t1 ORDER BY id;
SELECT * FROM test.t2 ORDER BY id2;
let $message=< ---- Master selects-- >;
--source include/show_msg.inc
connection master;
CALL test.p1();
sleep 6;
SELECT * FROM test.t3;
SELECT * FROM test.t3 ORDER BY id3;
let $message=< ---- Slave selects-- >;
--source include/show_msg.inc
connection slave;
SELECT * FROM test.t3;
SELECT * FROM test.t3 ORDER BY id3;
connection master;
......
......@@ -5,6 +5,8 @@
#############################################################################
#TEST: Taken and modfied from http://bugs.mysql.com/bug.php?id=12168 #
#############################################################################
# 2006-02-08 By JBM : Added order by for ndb engine use
#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
......@@ -68,29 +70,29 @@ END|
delimiter ;|
CALL test.p1('a');
SELECT * FROM test.t2;
SELECT * FROM test.t2 ORDER BY a;
save_master_pos;
connection slave;
sync_with_master;
SELECT * FROM test.t2;
SELECT * FROM test.t2 ORDER BY a;
connection master;
truncate test.t2;
# this next call fails, but should not
call test.p1('b');
select * from test.t2;
select * from test.t2 ORDER BY a;
save_master_pos;
connection slave;
sync_with_master;
SELECT * FROM test.t2;
SELECT * FROM test.t2 ORDER BY a;
connection master;
truncate test.t2;
SELECT * FROM test.t2;
SELECT * FROM test.t2 ORDER BY a;
save_master_pos;
connection slave;
sync_with_master;
SELECT * FROM test.t2;
SELECT * FROM test.t2 ORDER BY a;
connection master;
......
......@@ -5,7 +5,8 @@
#############################################################################
#TEST: row based replication of views #
#############################################################################
# 2006-02-08 By JBM added order by and sleep for use with ndb engine
#############################################################################
# Includes
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
......@@ -34,14 +35,19 @@ INSERT INTO mysqltest1.t2 VALUES (1,'GOD'),(2,'is'),(3,'TGIF');
INSERT INTO mysqltest1.t4 VALUES(1, 3, 50),(2, 18, 3),(4, 4, 4);
CREATE VIEW mysqltest1.v2 AS SELECT qty, price, qty*price AS value FROM mysqltest1.t4;
CREATE VIEW mysqltest1.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM mysqltest1.t1 as t1, mysqltest1.t2 AS t2 WHERE mysqltest1.t1.a = mysqltest1.t2.a;
CREATE VIEW mysqltest1.v2 AS SELECT qty, price, qty*price AS value FROM mysqltest1.t4 ORDER BY qty;
CREATE VIEW mysqltest1.v1 AS SELECT t1.a, t1.c, t2.c as c2 FROM mysqltest1.t1 as t1, mysqltest1.t2 AS t2 WHERE mysqltest1.t1.a = mysqltest1.t2.a ORDER BY a;
CREATE VIEW mysqltest1.v3 AS SELECT * FROM mysqltest1.t1;
CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL CHECK OPTION;
SELECT * FROM mysqltest1.v2;
SELECT * FROM mysqltest1.v1;
# Had to add a sleep for use with NDB
# engine. Injector thread would have not
# populated biblog and data would not be on
# the slave.
sleep 10;
sync_slave_with_master;
SELECT * FROM mysqltest1.v2;
SELECT * FROM mysqltest1.v1;
......@@ -50,20 +56,20 @@ connection master;
INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2;
INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1;
SELECT * FROM mysqltest1.t5;
SELECT * FROM mysqltest1.t3;
SELECT * FROM mysqltest1.t5 ORDER BY qty;
SELECT * FROM mysqltest1.t3 ORDER BY a;
sync_slave_with_master;
SELECT * FROM mysqltest1.t5;
SELECT * FROM mysqltest1.t3;
SELECT * FROM mysqltest1.t5 ORDER BY qty;
SELECT * FROM mysqltest1.t3 ORDER BY a;
connection master;
INSERT INTO mysqltest1.v4 VALUES (4,'TEST');
SELECT * FROM mysqltest1.t1;
SELECT * FROM mysqltest1.v4;
SELECT * FROM mysqltest1.t1 ORDER BY a;
SELECT * FROM mysqltest1.v4 ORDER BY a;
sync_slave_with_master;
SELECT * FROM mysqltest1.t1;
SELECT * FROM mysqltest1.v4;
SELECT * FROM mysqltest1.t1 ORDER BY a;
SELECT * FROM mysqltest1.v4 ORDER BY a;
connection master;
......
# Requires statement logging
-- source include/have_binlog_format_statement.inc
let $engine_type=MyISAM;
-- source extra/rpl_tests/rpl_log.test
......
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