mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-18 09:43:09 +00:00
31 lines
766 B
Perl
31 lines
766 B
Perl
package pt_online_schema_change_plugin;
|
|
|
|
use strict;
|
|
use warnings FATAL => 'all';
|
|
use English qw(-no_match_vars);
|
|
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
|
|
|
sub new {
|
|
my ($class, %args) = @_;
|
|
my $self = { %args };
|
|
return bless $self, $class;
|
|
}
|
|
|
|
sub after_create_new_table {
|
|
my ($self, %args) = @_;
|
|
my $new_tbl = $args{new_tbl};
|
|
my $dbh = $self->{cxn}->dbh;
|
|
my $row = $dbh->selectrow_arrayref("SHOW CREATE TABLE $new_tbl->{name}");
|
|
warn "after_create_new_table: $row->[1]\n\n";
|
|
}
|
|
|
|
sub after_alter_new_table {
|
|
my ($self, %args) = @_;
|
|
my $new_tbl = $args{new_tbl};
|
|
my $dbh = $self->{cxn}->dbh;
|
|
my $row = $dbh->selectrow_arrayref("SHOW CREATE TABLE $new_tbl->{name}");
|
|
warn "after_alter_new_table: $row->[1]\n\n";
|
|
}
|
|
|
|
1;
|