~ubuntu-branches/ubuntu/raring/mysql-5.5/raring-proposed

« 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): Clint Byrum
  • Date: 2012-02-14 23:59:22 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20120214235922-cux5uek1e5l0hje9
Tags: 5.5.20-0ubuntu1
* New upstream release.
* d/mysql-server-5.5.mysql.upstart: Fix stop on to make sure mysql is
  fully stopped before shutdown commences. (LP: #688541) Also simplify
  start on as it is redundant.
* d/control: Depend on upstart version which has apparmor profile load
  script to prevent failure on upgrade from lucid to precise.
  (LP: #907465)
* d/apparmor-profile: need to allow /run since that is the true path
  of /var/run files. (LP: #917542)
* d/control: mysql-server-5.5 has files in it that used to be owned
  by libmysqlclient-dev, so it must break/replace it. (LP: #912487)
* d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
  change compiler back to system default.
* d/rules: Turn off embedded libedit/readline.(Closes: #659566)

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
INSERT INTO t2 VALUES (4, 3);
32
32
INSERT INTO t2 VALUES (5, 4);
33
33
INSERT INTO t2 VALUES (6, 6);
34
 
 
 
34
--disable_warnings ONCE
35
35
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
36
36
--let $assert_cond= COUNT(*) = 6 FROM t1
37
37
--let $assert_text= Count of elements in t1 should be 6.
51
51
--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
52
52
--let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1)
53
53
--let $statement_file=INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a
 
54
--disable_warnings ONCE
54
55
--eval $statement_file
55
56
 
56
57
--let $assert_cond= COUNT(*) = 6 FROM t1
57
58
--let $assert_text= Count of elements in t1 should be 6.
58
59
--source include/assert.inc
59
60
 
60
 
if (`SELECT @@BINLOG_FORMAT = 'ROW'`)
 
61
if (`SELECT @@BINLOG_FORMAT != 'STATEMENT'`)
61
62
{
62
63
  --let $binlog_position_cmp= =
63
64
  --let $assert_cond= [SHOW MASTER STATUS, Position, 1] $binlog_position_cmp $binlog_start
64
65
  --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
}
66
 
if (`SELECT @@BINLOG_FORMAT != 'ROW'`)
 
67
if (`SELECT @@BINLOG_FORMAT = 'STATEMENT'`)
67
68
{
68
69
  --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 2, 1\', Info, 1]\' LIKE \'%$statement_file\'
69
70
  --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
}
71
 
--source include/assert.inc
 
72
 
 
73
--source include/assert.inc
 
74
 
 
75
# An insert duplicate that does not update anything must be written to the binary
 
76
# log in SBR and MIXED modes. We check this property by summing a before and after
 
77
# the update and comparing the binlog positions. The sum should be the same at both
 
78
# points and the statement should be in the binary log.
 
79
--disable_warnings
 
80
DROP TABLE t1;
 
81
DROP TABLE t2;
 
82
--enable_warnings
 
83
eval CREATE TABLE t1 (
 
84
 a INT UNSIGNED NOT NULL PRIMARY KEY
 
85
) ENGINE=$engine_type;
 
86
 
 
87
eval CREATE TABLE t2 (
 
88
 a INT UNSIGNED
 
89
) ENGINE=$engine_type;
 
90
 
 
91
INSERT INTO t1 VALUES (1);
 
92
INSERT INTO t2 VALUES (1);
 
93
 
 
94
--let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1)
 
95
--let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1)
 
96
--let $statement_file=INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a
 
97
--disable_warnings ONCE
 
98
--eval $statement_file
 
99
 
 
100
--let $assert_cond= SUM(a) = 1 FROM t1
 
101
--let $assert_text= Sum of elements in t1 should be 1.
 
102
--source include/assert.inc
 
103
 
 
104
if (`SELECT @@BINLOG_FORMAT != 'STATEMENT'`)
 
105
{
 
106
  --let $binlog_position_cmp= =
 
107
  --let $assert_cond= [SHOW MASTER STATUS, Position, 1] $binlog_position_cmp $binlog_start
 
108
  --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.
 
109
}
 
110
if (`SELECT @@BINLOG_FORMAT = 'STATEMENT'`)
 
111
{
 
112
  --let $assert_cond= \'[\'SHOW BINLOG EVENTS IN "$binlog_file" FROM $binlog_start LIMIT 1, 1\', Info, 1]\' LIKE \'%$statement_file\'
 
113
  --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.
 
114
}
 
115
--source include/assert.inc
 
116
 
72
117
 
73
118
# Clean up
74
119
--connection master