Merge lp:~percona-toolkit-dev/percona-toolkit/pt-deadlock-logger-logs-incorrect-ts-1295667 into lp:~percona-toolkit-dev/percona-toolkit/release-2.2.8

Proposed by Daniel Nichter on 2014-05-30
Status: Merged
Approved by: Daniel Nichter on 2014-05-30
Approved revision: 601
Merged at revision: 604
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/pt-deadlock-logger-logs-incorrect-ts-1295667
Merge into: lp:~percona-toolkit-dev/percona-toolkit/release-2.2.8
Diff against target: 40 lines (+16/-1)
1 file modified
bin/pt-deadlock-logger (+16/-1)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/pt-deadlock-logger-logs-incorrect-ts-1295667
Reviewer Review Type Date Requested Status
Daniel Nichter Approve on 2014-05-30
Review via email: mp+221474@code.launchpad.net
To post a comment you must log in.
600. By Daniel Nichter on 2014-05-30

Add DEFAULT CURRENT_TIMESTAMP to deadlocks table to prevent ON UPDATE DEFAULT CURRENT_TIMESTAMP.

601. By Daniel Nichter on 2014-05-30

Add trailing comma.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/pt-deadlock-logger'
--- bin/pt-deadlock-logger 2014-02-20 08:10:16 +0000
+++ bin/pt-deadlock-logger 2014-05-30 00:44:48 +0000
@@ -4440,12 +4440,27 @@
44404440
4441 my $dst;4441 my $dst;
4442 if ( my $dst_dsn = $o->get('dest') ) {4442 if ( my $dst_dsn = $o->get('dest') ) {
4443
4444 # set time_zone = SYSTEM , addresses https://bugs.launchpad.net/percona-toolkit/+bug/1295667
4445 my $set_tz = sub {
4446 my ($dbh) = @_;
4447 my $sql = "SET time_zone=SYSTEM /* pt-deadlock-logger */";
4448 eval {
4449 PTDEBUG && _d($dbh, $sql);
4450 $dbh->do($sql);
4451 };
4452 if ( $EVAL_ERROR ) {
4453 die "Failed to $sql: $EVAL_ERROR\n";
4454 }
4455 };
4456
4443 $dst = Cxn->new(4457 $dst = Cxn->new(
4444 dsn => $dst_dsn,4458 dsn => $dst_dsn,
4445 prev_dsn => ($src ? $src->dsn : undef),4459 prev_dsn => ($src ? $src->dsn : undef),
4446 parent => $o->get('daemonize'),4460 parent => $o->get('daemonize'),
4447 DSNParser => $dp,4461 DSNParser => $dp,
4448 OptionParser => $o,4462 OptionParser => $o,
4463 set => $set_tz,
4449 );4464 );
4450 }4465 }
44514466
@@ -5199,7 +5214,7 @@
51995214
5200 CREATE TABLE deadlocks (5215 CREATE TABLE deadlocks (
5201 server char(20) NOT NULL,5216 server char(20) NOT NULL,
5202 ts datetime NOT NULL,5217 ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
5203 thread int unsigned NOT NULL,5218 thread int unsigned NOT NULL,
5204 txn_id bigint unsigned NOT NULL,5219 txn_id bigint unsigned NOT NULL,
5205 txn_time smallint unsigned NOT NULL,5220 txn_time smallint unsigned NOT NULL,

Subscribers

People subscribed via source and target branches

to all changes: