Skip Menu |

This queue is for tickets about the Class-DBI-Plugin-Type CPAN distribution.

Report information
The Basics
Id: 128135
Status: open
Priority: 0/
Queue: Class-DBI-Plugin-Type

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

Bug Information
Severity: (no value)
Broken in: 0.02
Fixed in: (no value)



CC: ishigaki [...] cpan.org
Subject: t/1.t fails (with newest DBD::SQLite?)
The test suite started to fail on my smoker systems: ... # Failed test 'notes is text' # at t/1.t line 28. # undef # doesn't match '(?^:text|blob)' # Failed test 'tasted is a date' # at t/1.t line 29. # got: undef # expected: 'date' # Failed test 'price is decimal' # at t/1.t line 30. # undef # doesn't match '(?^:^decimal)' # Failed test 'id is integer' # at t/1.t line 31. # undef # doesn't match '(?^:^int)' # Failed test 'name is varchar' # at t/1.t line 32. # undef # doesn't match '(?^:^varchar)' # Looks like you failed 5 tests of 6. t/1.t .. Dubious, test returned 5 (wstat 1280, 0x500) Failed 5/6 subtests ... It seems that this happens if the latest DBD::SQLite is installed.
On Sun Dec 30 18:16:29 2018, SREZIC wrote: Show quoted text
> The test suite started to fail on my smoker systems: > > ... > # > Failed test 'notes is text' > # > at t/1.t line 28. > # > undef > # > doesn't match '(?^:text|blob)' > > # Failed test 'tasted is a date' > # at t/1.t line 29. > # got: undef > # expected: 'date' > > # Failed test 'price is decimal' > # at t/1.t line 30. > # undef > # doesn't match '(?^:^decimal)' > > # Failed test 'id is integer' > # at t/1.t line 31. > # undef > # doesn't match '(?^:^int)' > > # Failed test 'name is varchar' > # at t/1.t line 32. > # undef > # doesn't match '(?^:^varchar)' > # Looks like you failed 5 tests of 6. > t/1.t .. > Dubious, test returned 5 (wstat 1280, 0x500) > Failed 5/6 subtests > ... > > > It seems that this happens if the latest DBD::SQLite is installed.
FYI, this is because type_info_all() was implemented as of DBD::SQLite 1.61_02.
RT-Send-CC: ishigaki [...] cpan.org
Thanks for pointing to the changes in DBD::SQLite. I wonder where this leaves us, i.e. which changes are necessary in Class-DBI-Plugin-Type?
Niko Tyni came up with the attached patch.
Subject: 0001-Fix-compatibility-with-DBD-SQLite-1.61_02.patch
From b8cd9d0d853fdca08488f261d5856801e2ce2771 Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Mon, 21 Jan 2019 21:07:59 +0200 Subject: [PATCH] Fix compatibility with DBD-SQLite >= 1.61_02 type_info() now returns an array of mostly undefined values, breaking the t/1.t tests. Add a guard for definedness so we still take the other branch in this case. Bug: https://rt.cpan.org/Public/Bug/Display.html?id=128135 Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919006 --- Type.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Type.pm b/Type.pm index 688ca35..986fecd 100644 --- a/Type.pm +++ b/Type.pm @@ -29,7 +29,7 @@ sub import { @hash{@{$sth->{NAME}}} = map { my $info = scalar $self->db_Main->type_info($_); - if ($info) { $info->{TYPE_NAME} } + if ($info and defined $info->{TYPE_NAME}) { $info->{TYPE_NAME} } else { $_ } # Typeless databases (SQLite) } @{$sth->{TYPE}}; -- 2.20.1