Merge lp:~laurynas-biveinis/percona-server/bug890404-5.5 into lp:percona-server/5.5

Proposed by Laurynas Biveinis on 2012-10-12
Status: Merged
Approved by: Stewart Smith on 2012-10-24
Approved revision: 315
Merged at revision: 337
Proposed branch: lp:~laurynas-biveinis/percona-server/bug890404-5.5
Merge into: lp:percona-server/5.5
Diff against target: 286 lines (+1/-105)
3 files modified
Percona-Server/mysql-test/r/percona_innodb_fake_changes.result (+0/-55)
Percona-Server/mysql-test/t/percona_innodb_fake_changes.test (+0/-49)
Percona-Server/storage/innobase/btr/btr0cur.c (+1/-1)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug890404-5.5
Reviewer Review Type Date Requested Status
Sergei Glushchenko (community) g2 2012-10-12 Approve on 2012-10-25
Stewart Smith (community) Approve on 2012-10-24
Review via email: mp+129413@code.launchpad.net

Description of the change

Merge bug 890404 fix from 5.1. An automerge with fileid resolution

http://jenkins.percona.com/job/percona-server-5.5-param/542/

26611

To post a comment you must log in.

Hi Laurynas,
It seems that something wrong with this MP. Instead of modifying testcase, patch removes old one and adds new one. Is it OK?

review: Needs Information
Stewart Smith (stewart) :
review: Approve

Sergei -

The fileid resolution (which must happen by removing the old file and recreating it again with the correct fileid) makes it seem this way.

Laurynas, thank you for the information.

review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'Percona-Server/mysql-test/r/percona_innodb_fake_changes.result'
2--- Percona-Server/mysql-test/r/percona_innodb_fake_changes.result 1970-01-01 00:00:00 +0000
3+++ Percona-Server/mysql-test/r/percona_innodb_fake_changes.result 2012-10-12 12:45:16 +0000
4@@ -0,0 +1,75 @@
5+DROP TABLE IF EXISTS t1, t2, t3;
6+# Checking variables
7+SHOW VARIABLES LIKE 'innodb_fake_changes';
8+Variable_name Value
9+innodb_fake_changes OFF
10+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
11+VARIABLE_VALUE
12+OFF
13+SET innodb_fake_changes=1;
14+SHOW VARIABLES LIKE 'innodb_fake_changes';
15+Variable_name Value
16+innodb_fake_changes ON
17+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
18+VARIABLE_VALUE
19+ON
20+SET innodb_fake_changes=default;
21+SHOW VARIABLES LIKE 'innodb_fake_changes';
22+Variable_name Value
23+innodb_fake_changes OFF
24+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
25+VARIABLE_VALUE
26+OFF
27+# Explicit COMMIT should fail when innodb_fake_changes is enabled
28+# DML should be fine
29+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
30+INSERT INTO t1 VALUES (1);
31+SET autocommit=0;
32+SET innodb_fake_changes=1;
33+BEGIN;
34+INSERT INTO t1 VALUES (2);
35+UPDATE t1 SET a=0;
36+DELETE FROM t1 LIMIT 1;
37+SELECT * FROM t1;
38+a
39+1
40+COMMIT;
41+ERROR HY000: Got error 131 during COMMIT
42+SET innodb_fake_changes=default;
43+# Verify that the fake changes to t1 did not leak through
44+CHECK TABLE t1;
45+Table Op Msg_type Msg_text
46+test.t1 check status OK
47+should_be_1
48+1
49+DROP TABLE t1;
50+# DDL must result in error
51+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
52+SET autocommit=0;
53+SET innodb_fake_changes=1;
54+BEGIN;
55+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
56+ERROR HY000: Can't create table 'test.t2' (errno: 131)
57+DROP TABLE t1;
58+ERROR 42S02: Unknown table 't1'
59+TRUNCATE TABLE t1;
60+ERROR HY000: Got error 131 during COMMIT
61+ALTER TABLE t1 ENGINE=MyISAM;
62+ERROR HY000: Got error 131 during COMMIT
63+ROLLBACK;
64+SET innodb_fake_changes=0;
65+CREATE TABLE t3 (a INT primary key, b text) ENGINE=InnoDB;
66+INSERT INTO t3 VALUES (1,'');
67+COMMIT;
68+SET innodb_fake_changes=1;
69+UPDATE t3 set b=lpad('b',11000,'c') where a=1;
70+COMMIT;
71+ERROR HY000: Got error 131 during COMMIT
72+SET innodb_fake_changes=default;
73+# Verify that the fake changes to t3 did not leak through
74+CHECK TABLE t3;
75+Table Op Msg_type Msg_text
76+test.t3 check status OK
77+should_be_1
78+1
79+DROP TABLE t1, t3;
80
81=== removed file 'Percona-Server/mysql-test/r/percona_innodb_fake_changes.result'
82--- Percona-Server/mysql-test/r/percona_innodb_fake_changes.result 2012-04-18 23:25:36 +0000
83+++ Percona-Server/mysql-test/r/percona_innodb_fake_changes.result 1970-01-01 00:00:00 +0000
84@@ -1,55 +0,0 @@
85-DROP TABLE IF EXISTS t1;
86-# Checking variables
87-SHOW VARIABLES LIKE 'innodb_fake_changes';
88-Variable_name Value
89-innodb_fake_changes OFF
90-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
91-VARIABLE_VALUE
92-OFF
93-SET innodb_fake_changes=1;
94-SHOW VARIABLES LIKE 'innodb_fake_changes';
95-Variable_name Value
96-innodb_fake_changes ON
97-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
98-VARIABLE_VALUE
99-ON
100-SET innodb_fake_changes=default;
101-SHOW VARIABLES LIKE 'innodb_fake_changes';
102-Variable_name Value
103-innodb_fake_changes OFF
104-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
105-VARIABLE_VALUE
106-OFF
107-# Explicit COMMIT should fail when innodb_fake_changes is enabled
108-# DML should be fine
109-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
110-INSERT INTO t1 VALUES (1);
111-SET autocommit=0;
112-SET innodb_fake_changes=1;
113-BEGIN;
114-INSERT INTO t1 VALUES (2);
115-UPDATE t1 SET a=0;
116-DELETE FROM t1 LIMIT 1;
117-SELECT * FROM t1;
118-a
119-1
120-COMMIT;
121-ERROR HY000: Got error 131 during COMMIT
122-SET innodb_fake_changes=default;
123-DROP TABLE t1;
124-# DDL must result in error
125-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
126-SET autocommit=0;
127-SET innodb_fake_changes=1;
128-BEGIN;
129-CREATE TABLE t2 (a INT) ENGINE=InnoDB;
130-ERROR HY000: Can't create table 'test.t2' (errno: 131)
131-DROP TABLE t1;
132-ERROR 42S02: Unknown table 't1'
133-TRUNCATE TABLE t1;
134-ERROR HY000: Got error 131 during COMMIT
135-ALTER TABLE t1 ENGINE=MyISAM;
136-ERROR HY000: Got error 131 during COMMIT
137-ROLLBACK;
138-SET innodb_fake_changes=default;
139-DROP TABLE t1;
140
141=== added file 'Percona-Server/mysql-test/t/percona_innodb_fake_changes.test'
142--- Percona-Server/mysql-test/t/percona_innodb_fake_changes.test 1970-01-01 00:00:00 +0000
143+++ Percona-Server/mysql-test/t/percona_innodb_fake_changes.test 2012-10-12 12:45:16 +0000
144@@ -0,0 +1,75 @@
145+--source include/have_innodb.inc
146+
147+--disable_warnings
148+DROP TABLE IF EXISTS t1, t2, t3;
149+--enable_warnings
150+
151+
152+--echo # Checking variables
153+SHOW VARIABLES LIKE 'innodb_fake_changes';
154+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
155+SET innodb_fake_changes=1;
156+SHOW VARIABLES LIKE 'innodb_fake_changes';
157+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
158+SET innodb_fake_changes=default;
159+SHOW VARIABLES LIKE 'innodb_fake_changes';
160+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
161+
162+--echo # Explicit COMMIT should fail when innodb_fake_changes is enabled
163+--echo # DML should be fine
164+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
165+INSERT INTO t1 VALUES (1);
166+let $t1_checksum_1= `CHECKSUM TABLE t1 EXTENDED`;
167+SET autocommit=0;
168+SET innodb_fake_changes=1;
169+BEGIN;
170+INSERT INTO t1 VALUES (2);
171+UPDATE t1 SET a=0;
172+DELETE FROM t1 LIMIT 1;
173+SELECT * FROM t1;
174+--error 1180
175+COMMIT;
176+SET innodb_fake_changes=default;
177+--echo # Verify that the fake changes to t1 did not leak through
178+CHECK TABLE t1;
179+let $t1_checksum_2= `CHECKSUM TABLE t1 EXTENDED`;
180+--disable_query_log
181+eval SELECT "$t1_checksum_1" LIKE "$t1_checksum_2" AS should_be_1;
182+--enable_query_log
183+DROP TABLE t1;
184+
185+--echo # DDL must result in error
186+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
187+SET autocommit=0;
188+SET innodb_fake_changes=1;
189+BEGIN;
190+--error 1005
191+CREATE TABLE t2 (a INT) ENGINE=InnoDB;
192+--error 1051
193+DROP TABLE t1;
194+--error 1180
195+TRUNCATE TABLE t1;
196+--error 1180
197+ALTER TABLE t1 ENGINE=MyISAM;
198+ROLLBACK;
199+
200+# Test for bug 890404: uninitialized value warning in btr_cur_pessimistic_update
201+SET innodb_fake_changes=0;
202+CREATE TABLE t3 (a INT primary key, b text) ENGINE=InnoDB;
203+INSERT INTO t3 VALUES (1,'');
204+COMMIT;
205+let $t3_checksum_1= `CHECKSUM TABLE t3 EXTENDED`;
206+SET innodb_fake_changes=1;
207+
208+UPDATE t3 set b=lpad('b',11000,'c') where a=1;
209+--error ER_ERROR_DURING_COMMIT
210+COMMIT;
211+
212+SET innodb_fake_changes=default;
213+--echo # Verify that the fake changes to t3 did not leak through
214+CHECK TABLE t3;
215+let $t3_checksum_2= `CHECKSUM TABLE t3 EXTENDED`;
216+--disable_query_log
217+eval SELECT "$t3_checksum_1" LIKE "$t3_checksum_2" AS should_be_1;
218+--enable_query_log
219+DROP TABLE t1, t3;
220
221=== removed file 'Percona-Server/mysql-test/t/percona_innodb_fake_changes.test'
222--- Percona-Server/mysql-test/t/percona_innodb_fake_changes.test 2012-04-18 23:25:36 +0000
223+++ Percona-Server/mysql-test/t/percona_innodb_fake_changes.test 1970-01-01 00:00:00 +0000
224@@ -1,49 +0,0 @@
225---source include/have_innodb.inc
226-
227---disable_warnings
228-DROP TABLE IF EXISTS t1;
229---enable_warnings
230-
231-
232---echo # Checking variables
233-SHOW VARIABLES LIKE 'innodb_fake_changes';
234-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
235-SET innodb_fake_changes=1;
236-SHOW VARIABLES LIKE 'innodb_fake_changes';
237-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
238-SET innodb_fake_changes=default;
239-SHOW VARIABLES LIKE 'innodb_fake_changes';
240-SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='innodb_fake_changes';
241-
242---echo # Explicit COMMIT should fail when innodb_fake_changes is enabled
243---echo # DML should be fine
244-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
245-INSERT INTO t1 VALUES (1);
246-SET autocommit=0;
247-SET innodb_fake_changes=1;
248-BEGIN;
249-INSERT INTO t1 VALUES (2);
250-UPDATE t1 SET a=0;
251-DELETE FROM t1 LIMIT 1;
252-SELECT * FROM t1;
253---error 1180
254-COMMIT;
255-SET innodb_fake_changes=default;
256-DROP TABLE t1;
257-
258---echo # DDL must result in error
259-CREATE TABLE t1 (a INT) ENGINE=InnoDB;
260-SET autocommit=0;
261-SET innodb_fake_changes=1;
262-BEGIN;
263---error 1005
264-CREATE TABLE t2 (a INT) ENGINE=InnoDB;
265---error 1051
266-DROP TABLE t1;
267---error 1180
268-TRUNCATE TABLE t1;
269---error 1180
270-ALTER TABLE t1 ENGINE=MyISAM;
271-ROLLBACK;
272-SET innodb_fake_changes=default;
273-DROP TABLE t1;
274
275=== modified file 'Percona-Server/storage/innobase/btr/btr0cur.c'
276--- Percona-Server/storage/innobase/btr/btr0cur.c 2012-09-17 13:08:32 +0000
277+++ Percona-Server/storage/innobase/btr/btr0cur.c 2012-10-12 12:45:16 +0000
278@@ -2441,7 +2441,7 @@
279 itself. Thus the following call is safe. */
280 row_upd_index_replace_new_col_vals_index_pos(new_entry, index, update,
281 FALSE, *heap);
282- if (!(flags & BTR_KEEP_SYS_FLAG)) {
283+ if (!(flags & BTR_KEEP_SYS_FLAG) && !trx->fake_changes) {
284 row_upd_index_entry_sys_field(new_entry, index, DATA_ROLL_PTR,
285 roll_ptr);
286 row_upd_index_entry_sys_field(new_entry, index, DATA_TRX_ID,

Subscribers

People subscribed via source and target branches