Skip Menu |

This queue is for tickets about the SQL-Statement CPAN distribution.

Report information
The Basics
Id: 49583
Status: resolved
Priority: 0/
Queue: SQL-Statement

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

Bug Information
Severity: Important
Broken in:
  • 1.15
  • 1.20
Fixed in: 1.22



Subject: Test failures with recent DBI
In t/03executeDBD.t ok($sth->execute($_),$sth->{f_stmt}->command); should be ok($sth->execute(),$sth->{f_stmt}->command); This old bug was silent until a recent version of DBD::File started checking for it. ---- t/05create.t also fails, but the solution isn't obvious to me. For that matter, who's at fault isn't obvious to me. t/05create.t ......... DBD::File::db do failed: You passed 1 parameters where 0 required [for Statement "CREATE TEMP TABLE aoa AS IMPORT(?)"] at t/05create.t line 21. DBD::File::db do failed: You passed 1 parameters where 0 required [for Statement "CREATE TEMP TABLE aoa AS IMPORT(?)"] at t/05create.t line 21. # Looks like your test exited with 255 before it could output anything. t/05create.t ......... Dubious, test returned 255 (wstat 65280, 0xff00) Failed 5/5 subtests ---- Tested with SQL::Statement 1.20 and DBD::File 0.37 from DBI-1.609.
Subject: Tests fail due to multiple «You passed 1 parameters where 0 required» errors
Hi, I am forwarding you the Debian bug report #531238: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531238 I am quoting the most relevant parts. Just to explain our jargon: «FTBFS» means «Fails To Build From Source», and «upstream» means you, the module's author. Part of the Perl group's policies is to run tests on all modules - and SQL::Statement's tests fail: • Ryan Niebur <ryanryan52@gmail.com> opened the bug on May 30 saying: This package fails to build from source under sbuild using up to date sid. Attached is the build log. • Niko Tyni <ntyni@debian.org> mentioned on June 1: This regression is most probably a result of this libdbi-perl upstream change in 1.608: Fixes to DBD::File (H.Merijn Brand) [...] Fail and set errstr on parameter count mismatch in execute () (no time to look at it further, sorry) • I prepared the attached patch, which fixes the failure for test 03 • However, I could not (in a hurry) fix test 05: However, I hoped this trick would also work for t/05create.t. It does not. The offending part (quoting lines 20-21) here is: /============================================================ |my $aoa = [['c1','c2'],[1,9],[2,8] ]; |$dbh->do("CREATE TEMP TABLE aoa AS IMPORT(?)",{},$aoa); \============================================================ But, even patching it to work as the DBI manpage suggests: /============================================================ | my $rows_deleted = $dbh->do(q{ | DELETE FROM table | WHERE status = ? | }, undef, 'DONE') or die $dbh->errstr; \============================================================ It fails: /============================================================ |$ t/05create.t |1..5 |SQL::Statement v.1.15 |DBD::File::db do failed: You passed 1 parameters where 0 required [for Statement "CREATE TEMP TABLE +ao|a AS IMPORT(?)"] at t/05create.t line 21. |DBD::File::db do failed: You passed 1 parameters where 0 required [for Statement "CREATE TEMP TABLE +ao|a AS IMPORT(?)"] at t/05create.t line 21. |# Looks like your test exited with 255 before it could output anything. \============================================================ Note that this test checks for extended SQL syntax defined through SQL::Statement::Syntax¹, and, given my time constraints right now, I cannot devote more time to understanding it. I will forward this bug report as it is _now_ upstream and hope for their answer :) ¹ http://search.cpan.org/~rehsack/SQL-Statement-1.20/lib/SQL/Statement/Syntax.pod#IMPORT() Please note that I checked whether newer versions of SQL-Statement fixed this bug — I tried with the newest non-devel version (1.20), and it is stll present. Thank you for your work!
Subject: 0001-Fixed-parameter-count-mismatch-on-t-03.patch
From 4ac241b4907a52dd6188c96eb5af7a9e6529c38e Mon Sep 17 00:00:00 2001 From: Gunnar Wolf <gwolf@gwolf.org> Date: Wed, 9 Sep 2009 17:04:28 -0500 Subject: [PATCH] Fixed parameter count mismatch on t/03 --- t/03executeDBD.t | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/t/03executeDBD.t b/t/03executeDBD.t index 12852f3..8e31ffd 100755 --- a/t/03executeDBD.t +++ b/t/03executeDBD.t @@ -44,7 +44,8 @@ for (split /\n/, DELETE FROM phrase WHERE id = 2 } ){ $sth = $dbh->prepare($_); - ok($sth->execute($_),$sth->{f_stmt}->command); +# ok($sth->execute($_),$sth->{f_stmt}->command); + ok($sth->execute(),$sth->{f_stmt}->command); } $sth = $dbh->prepare("SELECT UPPER('a') AS A,phrase FROM phrase"); -- 1.6.3.3
Hi Gunnar, IIRC the bug is fixed in 1.21_1 - but thanks for the patch. Jens
Resolved in 1.22