Baby Moose Takes a Break

Its find a flaw here in the Moose-Pen

Well today did start out well and I began work on expanding Driver::DBI a little when I just wanted to check to see if that DBD::DBM driver of mine could do a little more that what I played with in '10_crud_basic.t' and I go it to take this SQL;


SELECT username as name,address, addresses.street FROM users join addresses on users.address = addresses.id

after adding in the 'addresses' table and a few rows. I thought that was a little odd as DBD::DBM is suppose to use DBI::SQL::Nano so to figure out what SHQ driver I was using I added this into some of code;

print $dbh->{sql_handler}

and that printed out

SQL::Statement

That means at some point in time that modules was installed on my Perl, and that is going to be a problem for mea as 'SQL::Statement' does not come bundled with DBI I want my Driver::DBI to test correctly with just a simple install of DBI.

Now there doesn't seem to be a way to tell DBD::DBM to use SQL::Statement or DBI::SQL::Nano so I had to use good old cpanminus to get rid of SQL::Statement and after that was done I was not getting ;


DBI::SQL::Nano
for that print statement and of course my '10_crud_basic.t' test is failing all over the palce;

ok 1 - Create function
ok 2 - One row effected
ok 3 - Update function
not ok 4 - Two rows effected
ok 5 - retrieve function
not ok 6 - One row returned
not ok 7 - username changed
not ok 8 - address changed
ok 9 - delete function
not ok 10 - One row Deleted
ok 11 - retrieve function
ok 12 - Nothing in DB
Now the situation is worse than it seems above because I am getting this warning in the output;

DBD::DBM::db prepare failed: Couldn't parse at C:/Dwimperl/perl/site/lib/DBI/DBD/SqlEngine.pm line 340
 [for Statement "UPDATE user SET address = ?"] at D:\GitHub\database-accessor-driver-dbi\lib/Database/Accessor/Driver/DBI.pm line 58.
Now the fix is simple enough, in DBI::SQL::Nano one has to have a where clause so I will have to add that in. To me however the real problem is this test;

eval{
   $user->update($utils->connect(),
                 $container);
};
if ($@) {
    fail("Update function error=$@");
}
else {
    pass("Update function");
}
ok($user->result()->effected == 2,"Two rows effected");
The 'eval' is not capturing my parsing error I will have to correct that as not reporting an error is a bad thing. So I guess I have a post for tomorrow now.

Sorry for the short post but here is a really cute Baby Moose Pic for yo;

DSC07114a.jpg

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations