~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to mysql-test/suite/engines/funcs/t/rpl_row_sp001.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120222223355-or06x1euyk8n0ldi
Tags: 5.1.61-0ubuntu0.10.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496
* Dropped patches unnecessary with 5.1.61:
  - debian/patches/90_mysql_safer_strmov.dpatch
  - debian/patches/51_ssl_test_certs.dpatch
  - debian/patches/52_CVE-2009-4030.dpatch
  - debian/patches/53_CVE-2009-4484.dpatch
  - debian/patches/54_CVE-2008-7247.dpatch
  - debian/patches/55_CVE-2010-1621.dpatch
  - debian/patches/56_CVE-2010-1850.dpatch
  - debian/patches/57_CVE-2010-1849.dpatch
  - debian/patches/58_CVE-2010-1848.dpatch
  - debian/patches/59_CVE-2010-1626.dpatch
  - debian/patches/60_CVE-2010-2008.dpatch
  - debian/patches/60_CVE-2010-3677.dpatch
  - debian/patches/60_CVE-2010-3678.dpatch
  - debian/patches/60_CVE-2010-3679.dpatch
  - debian/patches/60_CVE-2010-3680.dpatch
  - debian/patches/60_CVE-2010-3681.dpatch
  - debian/patches/60_CVE-2010-3682.dpatch
  - debian/patches/60_CVE-2010-3683.dpatch
  - debian/patches/60_CVE-2010-3833.dpatch
  - debian/patches/60_CVE-2010-3834.dpatch
  - debian/patches/60_CVE-2010-3835.dpatch
  - debian/patches/60_CVE-2010-3836.dpatch
  - debian/patches/60_CVE-2010-3837.dpatch
  - debian/patches/60_CVE-2010-3838.dpatch
  - debian/patches/60_CVE-2010-3839.dpatch
  - debian/patches/60_CVE-2010-3840.dpatch
  - debian/patches/61_disable_longfilename_test.dpatch
  - debian/patches/62_alter_table_fix.dpatch
  - debian/patches/63_cherrypick-upstream-49479.dpatch
  - debian/patches/10_readline_build_fix.dpatch
* debian/mysql-client-5.1.docs: removed EXCEPTIONS-CLIENT file
* debian/mysql-server-5.1.docs,debian/libmysqlclient16.docs,
  debian/libmysqlclient-dev.docs: removed, no longer necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#############################################################################
 
2
# This test is being created to test out the non deterministic items with   #
 
3
# row based replication.                                                    #
 
4
# Original Author: JBM                                                      #
 
5
# Original Date: Aug/09/2005                                                #
 
6
# Updated: Aug/29/2005
 
7
#############################################################################
 
8
# Test: Includes two stored procedure tests. First test uses SP to insert   #
 
9
#       values from RAND() and NOW() into a table.                          #
 
10
#       The second test uses SP with CASE structure to decide what to text  #
 
11
#       to update a given table with.                                       #
 
12
############################################################################
 
13
 
 
14
# Includes
 
15
-- source include/have_binlog_format_row.inc
 
16
-- source include/master-slave.inc
 
17
 
 
18
-- disable_query_log
 
19
-- disable_result_log
 
20
 
 
21
# Begin clean up test section
 
22
connection master;
 
23
--disable_warnings
 
24
DROP PROCEDURE IF EXISTS test.p1;
 
25
DROP PROCEDURE IF EXISTS test.p2;
 
26
DROP TABLE IF EXISTS test.t1;
 
27
DROP TABLE IF EXISTS test.t2;
 
28
 
 
29
-- enable_query_log
 
30
-- enable_result_log
 
31
 
 
32
# Begin test section 1 for non deterministic SP
 
33
let $message=<Begin test section 1 (non deterministic SP)>;
 
34
--source include/show_msg.inc
 
35
 
 
36
create table test.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n));
 
37
 
 
38
delimiter //;
 
39
create procedure test.p1()
 
40
begin
 
41
 INSERT INTO test.t1 (f,d) VALUES (RAND(),NOW());
 
42
end//
 
43
delimiter ;//
 
44
 
 
45
# show binlog events; 
 
46
 
 
47
-- disable_query_log
 
48
-- disable_result_log
 
49
let $1=10;
 
50
while ($1)
 
51
{
 
52
  call test.p1();
 
53
  sleep 1;
 
54
  dec $1;
 
55
}
 
56
-- enable_result_log
 
57
-- enable_query_log
 
58
 
 
59
## Used for debugging
 
60
#show binlog events;
 
61
#select * from test.t1;
 
62
#sync_slave_with_master;
 
63
#select * from test.t1;
 
64
#connection master;
 
65
 
 
66
let $message=<End test section 1 (non deterministic SP)>;
 
67
--source include/show_msg.inc
 
68
 
 
69
 
 
70
CREATE TABLE test.t2 (a INT NOT NULL AUTO_INCREMENT, t CHAR(4), PRIMARY KEY(a));
 
71
 
 
72
delimiter //;
 
73
CREATE PROCEDURE test.p2(n int)
 
74
begin
 
75
CASE n
 
76
WHEN 1 THEN
 
77
 UPDATE test.t2 set t ='Tex';
 
78
WHEN 2 THEN
 
79
 UPDATE test.t2 set t ='SQL';
 
80
ELSE
 
81
 UPDATE test.t2 set t ='NONE';
 
82
END CASE;
 
83
end//
 
84
delimiter ;//
 
85
 
 
86
INSERT INTO test.t2 VALUES(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW'),(NULL,'NEW');
 
87
 
 
88
SELECT * FROM t2 ORDER BY a;
 
89
save_master_pos;
 
90
connection slave;
 
91
sync_with_master;
 
92
SELECT * FROM t2 ORDER BY a;
 
93
 
 
94
connection master;
 
95
call test.p2(1);
 
96
SELECT * FROM t2 ORDER BY a;
 
97
sync_slave_with_master;
 
98
SELECT * FROM t2 ORDER BY a;
 
99
 
 
100
 
 
101
connection master;
 
102
call test.p2(2);
 
103
SELECT * FROM t2 ORDER BY a;
 
104
save_master_pos;
 
105
connection slave;
 
106
sync_with_master;
 
107
SELECT * FROM t2 ORDER BY a;
 
108
 
 
109
connection master;
 
110
call test.p2(3);
 
111
SELECT * FROM t2 ORDER BY a;
 
112
save_master_pos;
 
113
connection slave;
 
114
sync_with_master;
 
115
SELECT * FROM t2 ORDER BY a;
 
116
 
 
117
##Used for debugging
 
118
#show binlog events;
 
119
 
 
120
# time to dump the databases and so we can see if they match
 
121
 
 
122
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp001_master.sql
 
123
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/sp001_slave.sql
 
124
 
 
125
# First lets cleanup
 
126
 
 
127
connection master;
 
128
DROP PROCEDURE test.p1;
 
129
DROP PROCEDURE test.p2;
 
130
DROP TABLE test.t1;
 
131
DROP TABLE test.t2;
 
132
sync_slave_with_master;
 
133
 
 
134
# Lets compare. Note: If they match test will pass, if they do not match
 
135
# the test will show that the diff statement failed and not reject file
 
136
# will be created. You will need to go to the mysql-test dir and diff
 
137
# the files your self to see what is not matching :-) Failed dump files
 
138
# will be located in $MYSQLTEST_VARDIR/tmp
 
139
 
 
140
diff_files $MYSQLTEST_VARDIR/tmp/sp001_master.sql $MYSQLTEST_VARDIR/tmp/sp001_slave.sql;
 
141
 
 
142
# If all is good, when can cleanup our dump files.
 
143
remove_file $MYSQLTEST_VARDIR/tmp/sp001_master.sql;
 
144
remove_file $MYSQLTEST_VARDIR/tmp/sp001_slave.sql;
 
145
 
 
146
# End of 5.0 test case