Override ObjectDriver for TheSchwartz

TheSchwartz now uses Bugzilla database handle directly, this fixes double
utf-8 issues in TheSchwartz tables.
hinted-selects
Vitaliy Filippov 2014-11-12 15:49:26 +03:00
parent f6185e24e9
commit 037d79fcfc
2 changed files with 22 additions and 3 deletions

View File

@ -27,6 +27,7 @@ use strict;
use Bugzilla::Constants;
use Bugzilla::Error;
use Bugzilla::Install::Util qw(install_string);
use Bugzilla::JobQueue::ObjectDriver;
use base qw(TheSchwartz);
sub new {
@ -41,10 +42,12 @@ sub new {
# to write to it.
my $self = $class->SUPER::new(
databases => [{
dsn => Bugzilla->dbh_main->{private_bz_dsn},
user => $lc->{db_user},
pass => $lc->{db_pass},
prefix => 'ts_',
driver => Bugzilla::JobQueue::ObjectDriver->new(
dsn => Bugzilla->dbh_main->{private_bz_dsn},
username => $lc->{db_user},
password => $lc->{db_pass},
),
}],
);

View File

@ -0,0 +1,16 @@
#!/usr/bin/perl
package Bugzilla::JobQueue::ObjectDriver;
use strict;
use Bugzilla;
use base qw(Data::ObjectDriver::Driver::DBI);
sub init_db
{
return Bugzilla->dbh_main;
}
*dbh = *init_db;
1;
__END__