Bugzilla – Attachment 29190 Details for
Bug 12472
Unit Tests failing with "MySQL server has gone away"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12472 - Unit Tests failing with "MySQL server has gone away"
Bug-12472---Unit-Tests-failing-with-MySQL-server-h.patch (text/plain), 2.57 KB, created by
Kyle M Hall (khall)
on 2014-06-24 12:39:34 UTC
(
hide
)
Description:
Bug 12472 - Unit Tests failing with "MySQL server has gone away"
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-06-24 12:39:34 UTC
Size:
2.57 KB
patch
obsolete
>From 699e8739a5c89be02f8ee0726cef2ae3ba1cf285 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 24 Jun 2014 08:10:52 -0400 >Subject: [PATCH] Bug 12472 - Unit Tests failing with "MySQL server has gone away" > >This bug is related to bug 11891 which was recently pushed to master. >The issue is that the followup "Bug 11891: (follow-up) remove custom >storage class" ( commit id 967f5cb51321a6a08176c7718a6ab933b3b5f926 ) >removes the custom storage class that stopped DBIx::Class from >destroying the dbh handle when it was done using it. > >Test Plan: >1) Run 'perl t/db_dependent/Circulation.t' >2) Note the error > DBD::mysql::st execute failed: MySQL server has gone away at > /home/koha/kohaclone/C4/Members.pm line 881. >3) Apply this patch >4) Re-run 'perl t/db_dependent/Circulation.t' >5) No errors! >--- > Koha/Schema.pm | 2 +- > Koha/Storage.pm | 16 ++++++++++++++++ > t/db_dependent/Koha_Database.t | 4 +++- > 3 files changed, 20 insertions(+), 2 deletions(-) > create mode 100644 Koha/Storage.pm > >diff --git a/Koha/Schema.pm b/Koha/Schema.pm >index cffc631..111855c 100644 >--- a/Koha/Schema.pm >+++ b/Koha/Schema.pm >@@ -15,6 +15,6 @@ __PACKAGE__->load_namespaces; > # Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 > # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oDUxXckmfk6H9YCjW8PZTw > >+__PACKAGE__->storage_type('Koha::Storage'); > >-# You can replace this text with custom content, and it will be preserved on regeneration > 1; >diff --git a/Koha/Storage.pm b/Koha/Storage.pm >new file mode 100644 >index 0000000..599b6a1 >--- /dev/null >+++ b/Koha/Storage.pm >@@ -0,0 +1,16 @@ >+use utf8; >+package Koha::Storage; >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Storage::DBI'; >+sub DESTROY { >+ my $self = shift; >+ >+ # destroy just the object if not native to this process/thread >+ $self->_preserve_foreign_dbh; >+ >+ $self->_dbh(undef); >+} >+1; >diff --git a/t/db_dependent/Koha_Database.t b/t/db_dependent/Koha_Database.t >index 8e78e12..c669dbe 100644 >--- a/t/db_dependent/Koha_Database.t >+++ b/t/db_dependent/Koha_Database.t >@@ -4,7 +4,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 10; >+use Test::More tests => 11; > > BEGIN { > use_ok('Koha::Database'); >@@ -35,6 +35,8 @@ $schema->resultset('Category')->create({ > categorycode => 'GIFT-RUS', > description => $gift, > }); >+my $cat = $schema->resultset('Category')->find('GIFT-RUS'); >+ok( $cat, 'Found category with find' ); > my $desc = $schema->resultset('Category')->search({ > categorycode => 'GIFT-RUS', > })->single->get_column('description'); >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12472
: 29190