Merge lp:~percona-toolkit-dev/percona-toolkit/fix-1099836-pt-osc-mariadb-2.1.9 into lp:percona-toolkit/2.1

Proposed by Brian Fraser
Status: Merged
Approved by: Daniel Nichter
Approved revision: 525
Merged at revision: 525
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/fix-1099836-pt-osc-mariadb-2.1.9
Merge into: lp:percona-toolkit/2.1
Diff against target: 73 lines (+18/-2)
3 files modified
bin/pt-online-schema-change (+6/-1)
lib/TableParser.pm (+1/-1)
sandbox/start-sandbox (+11/-0)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-1099836-pt-osc-mariadb-2.1.9
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+145638@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Missing updated sandbox/start-sandbox that can start MariaDB?

Let's add back this comment too:

26 + # Error: 1062 SQLSTATE: 23000 ( ER_DUP_ENTRY )
27 + # Message: Duplicate entry '%ld' for key '%s'
28 + # MariaDB 5.5.28+ has this as a warning; See https://bugs.launchpad.net/percona-toolkit/+bug/1099836

review: Needs Fixing
525. By Brian Fraser

Re-added comments to the skipped MariaDB warning in pt-osc, and ported back the changes to enable MariaDB sandboxes

Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/pt-online-schema-change'
2--- bin/pt-online-schema-change 2013-01-30 15:04:19 +0000
3+++ bin/pt-online-schema-change 2013-01-30 16:02:23 +0000
4@@ -3270,7 +3270,7 @@
5 die "I need a $arg argument" unless $args{$arg};
6 }
7 my ($dbh, $db, $tbl) = @args{@required_args};
8- my $q = $self->{Quoter};
9+ my $q = $self->{Quoter} || 'Quoter';
10 my $db_tbl = $q->quote($db, $tbl);
11 PTDEBUG && _d('Checking', $db_tbl);
12
13@@ -9777,6 +9777,10 @@
14 # Ignore this warning because we have purposely set statement-based
15 # replication.
16 1592 => 1,
17+ # Error: 1062 SQLSTATE: 23000 ( ER_DUP_ENTRY )
18+ # Message: Duplicate entry '%ld' for key '%s'
19+ # MariaDB 5.5.28+ has this as a warning; See https://bugs.launchpad.net/percona-toolkit/+bug/1099836
20+ 1062 => 1,
21 );
22
23 # Warn once per-table for these error codes if the error message
24@@ -9851,6 +9855,7 @@
25 . "Specify --statistics to see a count of all "
26 . "suppressed warnings and errors.\n";
27 }
28+ warn $err;
29 }
30 }
31 else {
32
33=== modified file 'lib/TableParser.pm'
34--- lib/TableParser.pm 2013-01-03 00:19:16 +0000
35+++ lib/TableParser.pm 2013-01-30 16:02:23 +0000
36@@ -302,7 +302,7 @@
37 die "I need a $arg argument" unless $args{$arg};
38 }
39 my ($dbh, $db, $tbl) = @args{@required_args};
40- my $q = $self->{Quoter};
41+ my $q = $self->{Quoter} || 'Quoter';
42 my $db_tbl = $q->quote($db, $tbl);
43 PTDEBUG && _d('Checking', $db_tbl);
44
45
46=== modified file 'sandbox/start-sandbox'
47--- sandbox/start-sandbox 2012-12-21 12:45:30 +0000
48+++ sandbox/start-sandbox 2013-01-30 16:02:23 +0000
49@@ -27,6 +27,13 @@
50 fi
51 }
52
53+mysql_upgrade_on() {
54+ local cnf_file="$1"
55+ local upgrade="$(which mysql_upgrade)"
56+
57+ $upgrade --defaults-file=$cnf_file --skip-write-binlog
58+}
59+
60 make_sandbox() {
61 # Make the sandbox dir and extract the base files.
62 rm -rf /tmp/$port || die "Failed to rm /tmp/$port"
63@@ -138,6 +145,10 @@
64 /tmp/$port/use -e "CREATE TABLE IF NOT EXISTS percona_test.sentinel (id INT PRIMARY KEY, ping VARCHAR(64) NOT NULL DEFAULT '')";
65 /tmp/$port/use -e "REPLACE INTO percona_test.sentinel (id, ping) VALUES (1, '')";
66
67+ if [ -n "${MYSQL_UPGRADE:-""}" ]; then
68+ mysql_upgrade_on /tmp/$port/my.sandbox.cnf
69+ fi
70+
71 # If the sandbox is a slave, start the slave.
72 if [ "$type" = "slave" ]; then
73 /tmp/$port/use -e "change master to master_host='127.0.0.1', master_user='msandbox', master_password='msandbox', master_port=$master_port"

Subscribers

People subscribed via source and target branches