On Fri 29 Aug 2003 16:49, Tim Bunce <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 29, 2003 at 02:29:40PM +0200, H.Merijn Brand wrote:
> > On Thu 28 Aug 2003 20:59, Tim Bunce <[EMAIL PROTECTED]> wrote:
> > > On Thu, Aug 28, 2003 at 02:40:46PM +0200, H.Merijn Brand wrote:
> > > > 
> > > > One of the reasons I'm still holding on to DBI-1.35 is
> > > > 
> > > > Argument "" isn't numeric in null operation at 
> > > > /pro/lib/perl5/site_perl/5.8.0/PA-RISC2.0/DBI.pm line 632.
> > > > which is caused by attr 'Username' which is either undef or blank
> > > 
> > > I suspect the problem is in DBD::Unify. Does it happen for any other DBD's?
> > 
> > a5:/pro/3gl/CPAN/DBD-Unify-0.27 102 > grep Username *
> > a5:/pro/3gl/CPAN/DBD-Unify-0.27 103 > grep Username */*
> 
> I'm not sure why you're showing me greps. I think the problem is

To show that *I* am/was not using the Username attribute :)

> that DBD::Unify STORE is stringifying the value.
> 
> Hang on...  [wanders over to
> http://search.cpan.org/src/HMBRAND/DBD-Unify-0.26/dbdimp.ic]
> yes, your dbd_db_STORE_attrib function is doing
>       int on = SvIV (valuesv);
> instead of
>       int on = SvTRUE(valuesv);

I can assure you I did not invent that line myself :) It was blindly copied
from some other DBD driver, as stated in the header:

 * Main sources were Oracle (1.03), FreeTDS (0.02) and Ingres (0.24, 0.25)
 * whose writers seem to have copied from other sources too ;-)

[ Wanders over to Oracle-1.03 ...

lep a5:/pro/3gl/CPAN/DBD-Oracle-1.03 115 > grep -w on * | grep Sv
dbdimp.c:    int on = SvTRUE(valuesv);
dbdimp.c:    int on = SvTRUE(valuesv);
lep a5:/pro/3gl/CPAN/DBD-Oracle-1.03 116 >

Hmm, no that's OK ... Wanders to FreeTDS ...

lep a5:/pro/3gl/CPAN 119 > grep -rw on DBD-FreeTDS-0.02 | grep Sv
Exit 1
lep a5:/pro/3gl/CPAN 120 >

Hmm checking Ingres ...

lep a5:/pro/3gl/CPAN 123 > grep -rw on DBD-Ingres-0.25 | grep Sv
DBD-Ingres-0.25/dbdimp.psc:    int on = SvTRUE(valuesv);
DBD-Ingres-0.25/dbdimp.psc:    int on = SvTRUE(valuesv);
lep a5:/pro/3gl/CPAN 124 >

By then I was by no means an internals guy (and IMHO I'm still not),
so I'm sure I copied it from somewhere ]

Funny that the statement STORE did it right:

int dbd_st_STORE_attrib (SV *sth, imp_sth_t *imp_sth, SV *keysv, SV *valuesv)
{
    STRLEN kl;
    char   *key = SvPV (keysv,kl);
    SV     *cachesv = NULL;
    int    on = SvTRUE (valuesv);

I've removed the no warnings again, and changed SvIV () to SvTRUE ()

lep a5:/pro/3gl/CPAN/DBD-Unify-0.27 108 > make test
PERL_DL_NONLAZY=1 /pro/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 
'blib/lib', 'blib/arch')" t/*.t
t/01-base.........ok
t/02-connect......ok
t/03-general......ok
t/04-long.........ok
t/05-reauth.......ok
t/10-dbi-drv......ok
t/11-dbi-dbh......ok
t/12-dbi-sth......ok
t/20-uni-basic....ok
t/21-uni-regex....ok
t/27-uni-max......ok
t/30-reconnect....ok
t/99-done.........
To disable future max tests: setenv DBD_UNIFY_SKIP_27 1
skipped
        all skipped: no reason given
All tests successful, 1 test skipped.
Files=13, Tests=598,  9 wallclock secs ( 7.73 cusr +  0.65 csys =  8.38 CPU)
lep a5:/pro/3gl/CPAN/DBD-Unify-0.27 109 >

> > > > I have rewritten DBD-Unify (with pain in my heart) to replace
> > > > $dbh->{DBDverbose} (which IMHO is a perfectly good name, and should be adopted
> > > > by all drivers)
> > 
> > Oh, and I forgot to say: See, I do what I promised in Paris :)
> 
> :)
> 
> Tim.

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.0 & 633 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
     WinNT 4, Win2K pro & WinCE 2.11 often with Tk800.024 &/| DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/



Reply via email to