Re: [PATCH] Re: Some VMS errors in DBI trunk - dbi_vms_20100918.patch (1/1)

2010-09-20 Thread Jens Rehsack
2010/9/19 Craig A. Berry craigbe...@mac.com:
 In article 20100911171359.gb2...@timac.local,
  tim.bu...@pobox.com (Tim Bunce) wrote:

 On Thu, Sep 09, 2010 at 06:05:09PM -0500, Craig A. Berry wrote:
  In article 4c88ecbf.8040...@easysoft.com,
   martin.ev...@easysoft.com (Martin J. Evans) wrote:
 
   I ran DBI trunk on VMS (perl, v5.8.1 built for VMS_AXP) just to check it
   out.
   There were a lot of failures.

  I'm pretty sure DBI passed all tests on VMS sometime in the last year or
  two, so hopefully there's nothing too fundamental wrong.  I see what I
  can find.

 Wonderful. Many thanks Craig!

 I've attached a patch that gets VMS into about the same shape as other
 platforms, which is to say about 4-5 test failures mostly related to
 the z*51_dbmfile.t tests as of tr...@14425.  (The count is approximate
 since things are a bit of a moving target right now -- every time I've
 updated in the past week or so I've gotten new test failures and/or
 merge conflicts with what I've been trying to fix.)

 Here's what's in the patch:

 1.) On VMS, assignments to %ENV normally persist after Perl exits, so
 when setting something up for a test, they need to be torn down in an
 END block to prevent subsequent tests from getting unintended
 environment settings.

 2.)  A couple of the fake modules used for testing depend on readdir()
 returning at least one directory when passed an empty directory (it
 doesn't seem to matter *what* directory as long as there is something).
  While unixy platforms typically get away with this assumption by
 getting the dot and dot-dot directories, the standard explicitly says
 the presence of these must not be depended on (and they don't exist on
 VMS).  The path of least resistances was to make test_dir() in t/lib.pl
 create its own placeholder directory inside the temp directory it
 creates.

 3.)  On VMS, the .dir extension is reserved for directories, so
 SDBM_File creates its dir files with the .sdbm_dir extension.  A
 VMS-specific adjustment to 51dbm_file.t was needed for this.

 4.) On VMS, there is no such thing as a file with no extension.  A file
 with zero-length extension is, by default returned from readdir() with
 a trailing dot.  A couple of tweaks were needed in DBD::File to get rid
 of that dot.


 The things that still fail look like:

 t/zvxgp_50dbm_simple.t . ok
 Can't store item CODE(0x14284e0) at ../../lib/storable.pm (autosplit
 into [--.lib.auto.Storable]_freeze.al) line 339.
 DBD::Gofer::db selectall_arrayref failed: Cannot open
 disk$i64sys:[craig.dbi.test_output_60891]krueger.lck: no such file or
 director
 y (2) at /D0/CRAIG/DBI/blib/lib/DBD/File.pm line 690 at
 /D0/CRAIG/DBI/blib/lib/DBI/DBD/SqlEngine.pm line 793; DBD::DBM::st
 execute f
 ailed [for Statement select * from Krueger] at DBI::PurePerl
 DBI::st::execute line 118. at ./t/51dbm_file.t line 82
 Can't use an undefined value as an ARRAY reference at ./t/51dbm_file.t
 line 83.
 Compilation failed in require at t/zvxgp_51dbm_file.t line 6.
 # Tests were run but no plan was declared and done_testing() was not
 seen.


 whereas on Mac OS X they look like:


 t/zvxnp_51dbm_file.t ... 1/? DBD::DBM::db selectall_arrayref failed:
 Cannot open /Users/craig/dbi/test_output_31349/freddy.lck:No such file
 or directory (2) at /Users/craig/dbi/blib/lib/DBD/File.pm line 690 at
 /Users/craig/dbi/blib/lib/DBI/DBD/SqlEngine.pm line 793
  [for Statement select * from Krueger] at ./t/51dbm_file.t line 74
 Can't use an undefined value as an ARRAY reference at ./t/51dbm_file.t
 line 75.
 Compilation failed in require at t/zvxnp_51dbm_file.t line 6.
 # Tests were run but no plan was declared and done_testing() was not
 seen.
 t/zvxnp_51dbm_file.t ... Dubious, test returned 2 (wstat 512, 0x200)
 All 5 subtests passed

I hope both are fixed in the current DBI trunk. I verified my changes from
yesterday on NetBSD and MacOS X within the common checkout and
from a bae directory containing spaces.

Would be great when you can prove it again.

Thanks,
Jens


Fancy DBD::DBM behaviour

2010-09-20 Thread Jens Rehsack
Hi all,

I currently rewrite SQL::Statment tests to run all tests (if possible)
against SQL::Statement and all suitable (and known to me)
DBI::DBD::SqlEngine based drivers.

During this I detected an error in a test which has a bad reaction
of DBD::DBM:

# $tdbh is a Test::DBH, which encapsulates some calls to abstract
# tests against SQL::Statement and real $dbh's
  1: ok( $tdbh-do( CREATE TABLE foo (col INT) ), 'create foo' ) or
diag( $dbh-errstr() );
  2: ok( $tdbh-do( SELECT CoL from foo WHERE 1=0 ), 'retrieve
-{NAME}' ) or diag( $dbh-errstr() );

This fails (as expected) in line 1 with At least 2 columns are
required for DBD::DBM tables ..., but leaves the dbm files lying
around and line 2 fails with Cannot modify readonly table at
lib/DBD/DBM.pm line 413..

I think, failed create should force DBI::SQL::Nano and SQL::Statement
force to remove the files, but is this a really correct/desired behavior
(e.g. how would DBD::CSV behave when invalid characters are in the
first line)?

Best regards,
Jens


Re: PgDay Stuttgart, Germany, 6-8/12/2010

2010-09-20 Thread Tim Bunce
On Wed, Sep 15, 2010 at 03:41:36PM +0200, Jens Rehsack wrote:
 2010/9/15 Tim Bunce tim.bu...@pobox.com:
  On Mon, Aug 09, 2010 at 10:13:03PM +0300, Gabor Szabo wrote:
  The next European PostgreSQL day is going to be between 6-8 December
  in Stuttgart, Germany.   http://www.pgday.eu/
 
  It seems like a very cool conference and it might be interesting to
  offer some Perl related talks there.  It might be interesting to talk
  on how to use Pg from Perl, DBIx::Class or PgTAP just to throw in a
  couple of ideas.
 
  The date for the London Perl Workshop has been set for the 4th December.
  http://conferences.yapceurope.org/lpw2010/
 
  I may try to combine the two, but it's a long-shot.

My ducks have all come into alignment and I've booked flights for London
and Stuttgart.

 'cause I have currently a contract in Stuttgart, I might join for one
 or two days.  Probably remember me a few days before ...

Excellent. Will do!

Tim.


Re: [PATCH] Re: Some VMS errors in DBI trunk - dbi_vms_20100918.patch (1/1)

2010-09-20 Thread Tim Bunce
On Mon, Sep 20, 2010 at 02:45:27PM +0200, Jens Rehsack wrote:
 2010/9/19 Craig A. Berry craigbe...@mac.com:
  In article 20100911171359.gb2...@timac.local,
   tim.bu...@pobox.com (Tim Bunce) wrote:
 
  On Thu, Sep 09, 2010 at 06:05:09PM -0500, Craig A. Berry wrote:
   In article 4c88ecbf.8040...@easysoft.com,
    martin.ev...@easysoft.com (Martin J. Evans) wrote:
  
I ran DBI trunk on VMS (perl, v5.8.1 built for VMS_AXP) just to check 
it
out.
There were a lot of failures.
 
   I'm pretty sure DBI passed all tests on VMS sometime in the last year or
   two, so hopefully there's nothing too fundamental wrong.  I see what I
   can find.
 
  Wonderful. Many thanks Craig!

  Here's what's in the patch:

[...] all makes sense.

I've committed your patch as r14436.

I saw one test failure (on OS X) due to the extra line in the t/zv*_
test files:

t/zvg_40profile.t .. 1/60 
#   Failed test at ./t/40profile.t line 85.
# Structures begin differing at:
#  $got-{Data}{do}{40profile.t line 80 via zvg_40profile.t line 3} = 
Does not exist
# $expected-{Data}{do}{40profile.t line 80 via zvg_40profile.t line 3} = 
ARRAY(0x115d060)
t/zvg_40profile.t .. 44/60 # Looks like you failed 1 test of 60.

I've checked in a fix for that as r14437.

Many thanks again Craig!

Tim.