mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-14 07:06:28 +00:00
Add forked Maatkit tools in bin/ and their tests in t/.
This commit is contained in:
26
t/pt-archiver/samples/Plugin4.pm
Normal file
26
t/pt-archiver/samples/Plugin4.pm
Normal file
@@ -0,0 +1,26 @@
|
||||
package Plugin4;
|
||||
|
||||
sub new {
|
||||
my ( $class, %args ) = @_;
|
||||
$args{sth} = $args{dbh}->prepare(
|
||||
"INSERT INTO test.table_9 values(?,?,?)
|
||||
ON DUPLICATE KEY UPDATE b=b+1, c=c+values(c)
|
||||
");
|
||||
return bless(\%args, $class);
|
||||
}
|
||||
|
||||
sub is_archivable {1} # Always yes
|
||||
|
||||
sub before_delete {} # Take no action
|
||||
|
||||
sub before_insert {
|
||||
my ( $self, %args ) = @_;
|
||||
$self->{sth}->execute(@{$args{row}});
|
||||
}
|
||||
|
||||
sub custom_sth {} # no action
|
||||
sub before_begin {} # Take no action
|
||||
sub after_finish {} # Take no action
|
||||
|
||||
1;
|
||||
|
Reference in New Issue
Block a user