~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/r/rpl_misc_functions.result

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
stop slave;
 
2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
3
reset master;
 
4
reset slave;
 
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
6
start slave;
 
7
create table t1(id int, i int, r1 int, r2 int, p varchar(100));
 
8
insert into t1 values(1, connection_id(), 0, 0, "");
 
9
insert into t1 values(2, 0, rand()*1000, rand()*1000, "");
 
10
set sql_log_bin=0;
 
11
insert into t1 values(6, 0, rand(), rand(), "");
 
12
delete from t1 where id=6;
 
13
set sql_log_bin=1;
 
14
insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
 
15
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
 
16
select * into outfile 'rpl_misc_functions.outfile' from t1;
 
17
create table t2 like t1;
 
18
load data local infile 'MYSQLTEST_VARDIR/master-data/test/rpl_misc_functions.outfile' into table t2;
 
19
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
 
20
id      i       r1      r2      p       id      i       r1      r2      p
 
21
drop table t1;
 
22
DROP TABLE IF EXISTS t1;
 
23
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
 
24
col_a DOUBLE DEFAULT NULL);
 
25
CREATE PROCEDURE test_replication_sp1()
 
26
BEGIN
 
27
INSERT INTO t1 (col_a) VALUES (rand()), (rand());
 
28
INSERT INTO t1 (col_a) VALUES (rand());
 
29
END|
 
30
CREATE PROCEDURE test_replication_sp2()
 
31
BEGIN
 
32
CALL test_replication_sp1();
 
33
CALL test_replication_sp1();
 
34
END|
 
35
CREATE FUNCTION test_replication_sf() RETURNS DOUBLE DETERMINISTIC
 
36
BEGIN
 
37
RETURN (rand() + rand());
 
38
END|
 
39
CALL test_replication_sp1();
 
40
CALL test_replication_sp2();
 
41
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
 
42
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
 
43
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
 
44
select * from t1 into outfile "../tmp/t1_slave.txt";
 
45
create temporary table t1_slave select * from t1 where 1=0;
 
46
load data infile '../tmp/t1_slave.txt' into table t1_slave;
 
47
select count(*) into @aux from t1 join t1_slave using (id)
 
48
where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
 
49
SELECT @aux;
 
50
@aux
 
51
12
 
52
DROP TABLE t1, t1_slave;
 
53
DROP PROCEDURE test_replication_sp1;
 
54
DROP PROCEDURE test_replication_sp2;
 
55
DROP FUNCTION test_replication_sf;