Skip Menu |

This queue is for tickets about the CHI-Driver-HandlerSocket CPAN distribution.

Report information
The Basics
Id: 77648
Status: open
Priority: 0/
Queue: CHI-Driver-HandlerSocket

People
Owner: Nobody in particular
Requestors: ACCA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.991
Fixed in: (no value)



Subject: Remote MySQL for tests + fix to pass all CHI tests
Hi Scott, CHIDriverTests-MySQLHandlerSocket.t does not allow to specify remote MySQL host. Attached please find a QND fix for this issue. The database can be entered in a form "XXX:host=YYY" The patch also allows to have all CHI tests passed. Besides immediate bug fixes it creates tables using InnoDB, as MyISAM seems to be inappropriate. Please see the details - http://www.pablowe.net/2011/03/handlersocket-edge-cases/ One outstanding issue remains - CHI/Driver/HandlerSocket/t/CHIDriverTests/Base.pm wants CHI::Driver::DBI to be installed, otherwise fails. While CHI::Driver::DBI does not seem to be necessary for CHI::Driver::HandlerSocket, I am not sure if it is mandatory for proper CHI operation. Many thanks for your fantastic job, I would be glad to be any help.
Subject: CHI-Driver-HandlerSocket-0.991.patch
diff -ur CHI-Driver-HandlerSocket-0.991-old/lib/CHI/Driver/HandlerSocket/t/CHIDriverTests/Base.pm CHI-Driver-HandlerSocket-0.991/lib/CHI/Driver/HandlerSocket/t/CHIDriverTests/Base.pm --- CHI-Driver-HandlerSocket-0.991-old/lib/CHI/Driver/HandlerSocket/t/CHIDriverTests/Base.pm 2011-03-11 14:49:29.000000000 -0500 +++ CHI-Driver-HandlerSocket-0.991/lib/CHI/Driver/HandlerSocket/t/CHIDriverTests/Base.pm 2012-06-05 18:05:00.000000000 -0400 @@ -33,13 +33,16 @@ }; } +sub host { 'localhost' }; + sub new_cache_options { my $self = shift; return ( $self->SUPER::new_cache_options(), dbh => $self->dbh, - create_table => 1 + create_table => 1, + host => $self->host, ); } diff -ur CHI-Driver-HandlerSocket-0.991-old/lib/CHI/Driver/HandlerSocket/t/CHIDriverTests/MySQLHandlerSocket.pm CHI-Driver-HandlerSocket-0.991/lib/CHI/Driver/HandlerSocket/t/CHIDriverTests/MySQLHandlerSocket.pm --- CHI-Driver-HandlerSocket-0.991-old/lib/CHI/Driver/HandlerSocket/t/CHIDriverTests/MySQLHandlerSocket.pm 2011-03-11 14:49:29.000000000 -0500 +++ CHI-Driver-HandlerSocket-0.991/lib/CHI/Driver/HandlerSocket/t/CHIDriverTests/MySQLHandlerSocket.pm 2012-06-05 18:04:09.000000000 -0400 @@ -11,16 +11,19 @@ } our $dbh; +our $host; sub runtests { my $class = shift; my %opts = @_; - $dbh = DBI->connect("DBI:mysql:database=$opts{database};host=localhost", $opts{user}, $opts{pass}) or + $dbh = DBI->connect("DBI:mysql:database=$opts{database}", $opts{user}, $opts{pass}) or die "failed to connect to database: $DBI::errstr"; + $host = $opts{host} // 'localhost'; $class->SUPER::runtests(); } sub dbh { return $dbh; } +sub host { return $host; } sub cleanup : Tests( shutdown ) { # unlink 't/dbfile.db'; diff -ur CHI-Driver-HandlerSocket-0.991-old/lib/CHI/Driver/HandlerSocket.pm CHI-Driver-HandlerSocket-0.991/lib/CHI/Driver/HandlerSocket.pm --- CHI-Driver-HandlerSocket-0.991-old/lib/CHI/Driver/HandlerSocket.pm 2011-03-11 20:46:18.000000000 -0500 +++ CHI-Driver-HandlerSocket-0.991/lib/CHI/Driver/HandlerSocket.pm 2012-06-05 21:06:14.652004748 -0400 @@ -208,7 +208,7 @@ # CREATE TABLE IF NOT EXISTS $table ( `key` VARCHAR( 300 ), `value` TEXT, PRIMARY KEY ( `key` ) ) CHARSET=utf8 # fails 220 tests $dbh->do( qq{ - CREATE TABLE IF NOT EXISTS $table ( `key` VARCHAR( 600 ), `value` BLOB, PRIMARY KEY ( `key` ) ) CHARSET=ASCII + CREATE TABLE IF NOT EXISTS $table ( `key` VARBINARY( 600 ), `value` BLOB, PRIMARY KEY ( `key` ) ) ENGINE=InnoDB } ) or croak $dbh->errstr; # from https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL/blob/master/docs-en/perl-client.en.txt: diff -ur CHI-Driver-HandlerSocket-0.991-old/t/CHIDriverTests-MySQLHandlerSocket.t CHI-Driver-HandlerSocket-0.991/t/CHIDriverTests-MySQLHandlerSocket.t --- CHI-Driver-HandlerSocket-0.991-old/t/CHIDriverTests-MySQLHandlerSocket.t 2011-03-11 14:49:29.000000000 -0500 +++ CHI-Driver-HandlerSocket-0.991/t/CHIDriverTests-MySQLHandlerSocket.t 2012-06-05 18:12:04.000000000 -0400 @@ -8,25 +8,28 @@ my $database; my $user; my $pass; +my $host; # Makefile.PL asks the user (if the user is reachable) for database login info to test with; that gets appeneded to the end of this file while(my $line = readline DATA) { no warnings 'uninitialized'; chomp $line; - (my $k, my $v) = split /=/, $line; + (my $k, my $v) = split /=/, $line, 2; $database = $v if $k eq 'database'; $user = $v if $k eq 'user'; $pass = $v if $k eq 'pass'; } if($user and $pass ) { + $database =~ /;host=(.+);*/o; + $host = $1 if $1; CHI::Driver::HandlerSocket::t::CHIDriverTests::MySQLHandlerSocket->runtests( user => $user, pass => $pass, database => $database, + host => $host, ); } __DATA__ -
Eeek! I never look here. I'm sorry, I didn't mean to ignore your work on this. I was doing some work on SOAP::WSDL and wound up here and saw this. I started to work on this, but CHI::Driver::HandlerSocket isn't working on my system at all at the moment: t/CHIDriverTests-MySQLHandlerSocket.t .. FATAL_COREDUMP: string_buffer::resize() realloc That seems related to my Perl version and environment, not C::D::HS. I'm stuck on a release until I can figure that out with the author of HandlerSocket. If I do another release, I'll update the bugtracker link to point to github, but in the mean time, please feel free to email me at scott@slowass.net or post issues on https://github.com/scrottie/CHI-Driver-HandlerSocket/issues. And thank you for your offer of help. That was some time ago, but if you're still interested in work on this, tell me your github username and I'll add you to the repo and get you co-maint on PAUSE.
Subject: Re: [rt.cpan.org #77648] Remote MySQL for tests + fix to pass all CHI tests
Date: Fri, 22 Aug 2014 00:21:57 -0400
To: bug-CHI-Driver-HandlerSocket [...] rt.cpan.org, scott [...] illogics.org, scott [...] slowass.net
From: Alexander <acca [...] cpan.org>
Hi Scott, no worries. It came out that the original HandlerSocket plugin is badly broken or better said never been finished. Thus you cannot chop CHI::Driver::HandlerSocket up to a usable state. I was planning to give it another chance using Percona distribution, but so far swamped with other things. On Thu, Aug 21, 2014 at 10:48 PM, SWALTERS via RT < bug-CHI-Driver-HandlerSocket@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=77648 > > > > Eeek! I never look here. I'm sorry, I didn't mean to ignore your work on > this. I was doing some work on SOAP::WSDL and wound up here and saw this. > > I started to work on this, but CHI::Driver::HandlerSocket isn't working on > my system at all at the moment: > > t/CHIDriverTests-MySQLHandlerSocket.t .. FATAL_COREDUMP: > string_buffer::resize() realloc > > That seems related to my Perl version and environment, not C::D::HS. I'm > stuck on a release until I can figure that out with the author of > HandlerSocket. > > If I do another release, I'll update the bugtracker link to point to > github, but in the mean time, please feel free to email me at > scott@slowass.net or post issues on > https://github.com/scrottie/CHI-Driver-HandlerSocket/issues. > > And thank you for your offer of help. That was some time ago, but if > you're still interested in work on this, tell me your github username and > I'll add you to the repo and get you co-maint on PAUSE. >
-- Sincerely yours, Alexander Kuznetsov