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

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_insert_ignore.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:
5
5
# Slave needs to be started with --innodb to store table in InnoDB.
6
6
# Same test for MyISAM (which had no bug).
7
7
 
 
8
--connection master
8
9
eval CREATE TABLE t1 (
9
10
 a int unsigned not null auto_increment primary key,
10
11
 b int unsigned,
32
33
INSERT INTO t2 VALUES (6, 6);
33
34
 
34
35
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
35
 
 
36
 
# Compare results
37
 
 
38
 
SELECT * FROM t1 ORDER BY a;
39
 
 
40
 
sync_slave_with_master;
41
 
SELECT * FROM t1 ORDER BY a;
42
 
 
43
 
# Now do the same for MyISAM
44
 
 
45
 
connection master;
46
 
drop table t1;
47
 
eval CREATE TABLE t1 (
48
 
 a int unsigned not null auto_increment primary key,
49
 
 b int unsigned,
50
 
 unique (b)
51
 
) ENGINE=$engine_type2;
52
 
 
53
 
INSERT INTO t1 VALUES (1, 1);
54
 
INSERT INTO t1 VALUES (2, 2);
55
 
INSERT INTO t1 VALUES (3, 3);
56
 
INSERT INTO t1 VALUES (4, 4);
57
 
 
58
 
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
59
 
 
60
 
SELECT * FROM t1 ORDER BY a;
61
 
 
62
 
sync_slave_with_master;
63
 
SELECT * FROM t1 ORDER BY a;
64
 
 
65
 
connection master;
 
36
--let $assert_cond= COUNT(*) = 6 FROM t1
 
37
--let $assert_text= Count of elements in t1 should be 6.
 
38
--source include/assert.inc
 
39
 
 
40
# Compare master and slave
 
41
--sync_slave_with_master
 
42
--let $diff_tables= master:test.t1 , slave:test.t1
 
43
--source include/diff_tables.inc
 
44
 
 
45
# BUG#59338 Inconsistency in binlog for statements that don't change any rows STATEMENT SBR
 
46
# An insert ignore that does not update anything must be written to the binary log in SBR
 
47
# and MIXED modes. We check this property by counting occurrences in t1 before and after
 
48
# the insert and comparing the binlog positions. The count should be the same in both points
 
49
# and the statement should be in the binary log.
 
50
--connection master
 
51
--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
 
52
--let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1)
 
53
--let $statement_file=INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a
 
54
--eval $statement_file
 
55
 
 
56
--let $assert_cond= COUNT(*) = 6 FROM t1
 
57
--let $assert_text= Count of elements in t1 should be 6.
 
58
--source include/assert.inc
 
59
 
 
60
if (`SELECT @@BINLOG_FORMAT = 'ROW'`)
 
61
{
 
62
  --let $binlog_position_cmp= =
 
63
  --let $assert_cond= [SHOW MASTER STATUS, Position, 1] $binlog_position_cmp $binlog_start
 
64
  --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
 
65
}
 
66
if (`SELECT @@BINLOG_FORMAT != 'ROW' && UPPER('$engine_type') = UPPER('Innodb')`)
 
67
{
 
68
  --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 2, 1\', Info, 1]\' LIKE \'%$statement_file\'
 
69
  --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
 
70
}
 
71
if (`SELECT @@BINLOG_FORMAT != 'ROW' && UPPER('$engine_type') = UPPER('MyIsam')`)
 
72
{
 
73
  --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 1, 1\', Info, 1]\' LIKE \'%$statement_file\'
 
74
  --let $assert_text= In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.
 
75
}
 
76
--source include/assert.inc
 
77
 
 
78
# Clean up
 
79
--connection master
66
80
drop table t1, t2;
67
 
sync_slave_with_master;
68
 
 
69
 
# End of 4.1 tests
 
81
--sync_slave_with_master