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

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 500
Proposed branch: lp:~laurynas-biveinis/percona-server/bug890404-5.1
Merge into: lp:percona-server/5.1
Diff against target: 116 lines (+51/-5)
3 files modified
Percona-Server/mysql-test/r/percona_innodb_fake_changes.result (+22/-2)
Percona-Server/mysql-test/t/percona_innodb_fake_changes.test (+28/-2)
Percona-Server/storage/innodb_plugin/btr/btr0cur.c (+1/-1)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-server/bug890404-5.1
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Sergei Glushchenko (community) g2 Approve
Review via email: mp+129411@code.launchpad.net

Description of the change

Fix bug 890404 (valgrind warning from innodb_fake_changes patch) and
improve the fake changes testcase.

The Valgrind warning in bug 890404 is "conditional jump depends on
uninitialized value(s)" and the value in question is roll_ptr in
btr_cur_pessimistic_update(). Normally roll_ptr is set by
the btr_cur_upd_lock_and_undo() call and then read by one of the
row_upd_index_entry_sys_field() calls. With the fake changes enabled,
roll_ptr write is skipped but read is not.

Fixed by skipping row_upd_index_entry_sys_field() calls in case of
fake changes.

Extended the percona_innodb_fake_changes testcase by dropping table t2
at the start too if exists, and by adding table checks and checksum
comparisons for tables with data that have fake changes workload to
see that fake changes do not cause corruption nor leak through.

http://jenkins.percona.com/job/percona-server-5.1-param/439/

26611

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Approve g2

review: Approve (g2)
Revision history for this message
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Percona-Server/mysql-test/r/percona_innodb_fake_changes.result'
--- Percona-Server/mysql-test/r/percona_innodb_fake_changes.result 2011-11-24 02:00:54 +0000
+++ Percona-Server/mysql-test/r/percona_innodb_fake_changes.result 2012-10-12 12:38:32 +0000
@@ -1,4 +1,4 @@
1DROP TABLE IF EXISTS t1;1DROP TABLE IF EXISTS t1, t2, t3;
2# Checking variables2# Checking variables
3SHOW VARIABLES LIKE 'innodb_fake_changes';3SHOW VARIABLES LIKE 'innodb_fake_changes';
4Variable_name Value4Variable_name Value
@@ -36,6 +36,12 @@
36COMMIT;36COMMIT;
37ERROR HY000: Got error 131 during COMMIT37ERROR HY000: Got error 131 during COMMIT
38SET innodb_fake_changes=default;38SET innodb_fake_changes=default;
39# Verify that the fake changes to t1 did not leak through
40CHECK TABLE t1;
41Table Op Msg_type Msg_text
42test.t1 check status OK
43should_be_1
441
39DROP TABLE t1;45DROP TABLE t1;
40# DDL must result in error46# DDL must result in error
41CREATE TABLE t1 (a INT) ENGINE=InnoDB;47CREATE TABLE t1 (a INT) ENGINE=InnoDB;
@@ -51,5 +57,19 @@
51ALTER TABLE t1 ENGINE=MyISAM;57ALTER TABLE t1 ENGINE=MyISAM;
52ERROR HY000: Got error 131 during COMMIT58ERROR HY000: Got error 131 during COMMIT
53ROLLBACK;59ROLLBACK;
60SET innodb_fake_changes=0;
61CREATE TABLE t3 (a INT primary key, b text) ENGINE=InnoDB;
62INSERT INTO t3 VALUES (1,'');
63COMMIT;
64SET innodb_fake_changes=1;
65UPDATE t3 set b=lpad('b',11000,'c') where a=1;
66COMMIT;
67ERROR HY000: Got error 131 during COMMIT
54SET innodb_fake_changes=default;68SET innodb_fake_changes=default;
55DROP TABLE t1;69# Verify that the fake changes to t3 did not leak through
70CHECK TABLE t3;
71Table Op Msg_type Msg_text
72test.t3 check status OK
73should_be_1
741
75DROP TABLE t1, t3;
5676
=== modified file 'Percona-Server/mysql-test/t/percona_innodb_fake_changes.test'
--- Percona-Server/mysql-test/t/percona_innodb_fake_changes.test 2011-11-24 02:00:54 +0000
+++ Percona-Server/mysql-test/t/percona_innodb_fake_changes.test 2012-10-12 12:38:32 +0000
@@ -1,7 +1,7 @@
1--source include/have_innodb_plugin.inc1--source include/have_innodb_plugin.inc
22
3--disable_warnings3--disable_warnings
4DROP TABLE IF EXISTS t1;4DROP TABLE IF EXISTS t1, t2, t3;
5--enable_warnings5--enable_warnings
66
77
@@ -19,6 +19,7 @@
19--echo # DML should be fine19--echo # DML should be fine
20CREATE TABLE t1 (a INT) ENGINE=InnoDB;20CREATE TABLE t1 (a INT) ENGINE=InnoDB;
21INSERT INTO t1 VALUES (1);21INSERT INTO t1 VALUES (1);
22let $t1_checksum_1= `CHECKSUM TABLE t1 EXTENDED`;
22SET autocommit=0;23SET autocommit=0;
23SET innodb_fake_changes=1;24SET innodb_fake_changes=1;
24BEGIN;25BEGIN;
@@ -29,6 +30,12 @@
29--error 118030--error 1180
30COMMIT;31COMMIT;
31SET innodb_fake_changes=default;32SET innodb_fake_changes=default;
33--echo # Verify that the fake changes to t1 did not leak through
34CHECK TABLE t1;
35let $t1_checksum_2= `CHECKSUM TABLE t1 EXTENDED`;
36--disable_query_log
37eval SELECT "$t1_checksum_1" LIKE "$t1_checksum_2" AS should_be_1;
38--enable_query_log
32DROP TABLE t1;39DROP TABLE t1;
3340
34--echo # DDL must result in error41--echo # DDL must result in error
@@ -45,5 +52,24 @@
45--error 118052--error 1180
46ALTER TABLE t1 ENGINE=MyISAM;53ALTER TABLE t1 ENGINE=MyISAM;
47ROLLBACK;54ROLLBACK;
55
56# Test for bug 890404: uninitialized value warning in btr_cur_pessimistic_update
57SET innodb_fake_changes=0;
58CREATE TABLE t3 (a INT primary key, b text) ENGINE=InnoDB;
59INSERT INTO t3 VALUES (1,'');
60COMMIT;
61let $t3_checksum_1= `CHECKSUM TABLE t3 EXTENDED`;
62SET innodb_fake_changes=1;
63
64UPDATE t3 set b=lpad('b',11000,'c') where a=1;
65--error ER_ERROR_DURING_COMMIT
66COMMIT;
67
48SET innodb_fake_changes=default;68SET innodb_fake_changes=default;
49DROP TABLE t1;69--echo # Verify that the fake changes to t3 did not leak through
70CHECK TABLE t3;
71let $t3_checksum_2= `CHECKSUM TABLE t3 EXTENDED`;
72--disable_query_log
73eval SELECT "$t3_checksum_1" LIKE "$t3_checksum_2" AS should_be_1;
74--enable_query_log
75DROP TABLE t1, t3;
5076
=== modified file 'Percona-Server/storage/innodb_plugin/btr/btr0cur.c'
--- Percona-Server/storage/innodb_plugin/btr/btr0cur.c 2012-08-20 03:14:02 +0000
+++ Percona-Server/storage/innodb_plugin/btr/btr0cur.c 2012-10-12 12:38:32 +0000
@@ -2334,7 +2334,7 @@
2334 itself. Thus the following call is safe. */2334 itself. Thus the following call is safe. */
2335 row_upd_index_replace_new_col_vals_index_pos(new_entry, index, update,2335 row_upd_index_replace_new_col_vals_index_pos(new_entry, index, update,
2336 FALSE, *heap);2336 FALSE, *heap);
2337 if (!(flags & BTR_KEEP_SYS_FLAG)) {2337 if (!(flags & BTR_KEEP_SYS_FLAG) && !trx->fake_changes) {
2338 row_upd_index_entry_sys_field(new_entry, index, DATA_ROLL_PTR,2338 row_upd_index_entry_sys_field(new_entry, index, DATA_ROLL_PTR,
2339 roll_ptr);2339 roll_ptr);
2340 row_upd_index_entry_sys_field(new_entry, index, DATA_TRX_ID,2340 row_upd_index_entry_sys_field(new_entry, index, DATA_TRX_ID,

Subscribers

People subscribed via source and target branches