Re: "unrecognised attribute name or invalid value"

2012-05-15 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160


> The second argument to DBI::_new_dbh() must be an empty hashref.

Just to keep this straight in the archives, the argument does not 
*have* to be empty. I don't think any of the keys inside it are 
mandatory, but having one called 'Name' seems to be fairly standard.

- -- 
Greg Sabino Mullane g...@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201205151324
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iEYEAREDAAYFAk+ykUcACgkQvJuQZxSWSshqjACgxhBrO/FVI6NvfFV2JfuyzzFq
8gAAniIr0xJQyOm8oW7UUzIsLoPIJhMs
=Hnxd
-END PGP SIGNATURE-




Re: "unrecognised attribute name or invalid value"

2012-05-08 Thread Martin J. Evans

On 08/05/12 09:33, Martin J. Evans wrote:

On 07/05/12 13:59, Philip Stoev wrote:

Hello,

I am building a new XS-based DBD driver, using the best practices of cargo-cult 
programming as recommended in the manual.

However, on every connect() attempt, I get the following unsilencable warnings:

Can't set DBI::db=HASH(0x20e7098)->{State}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Errstr}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Driver}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Err}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.

How can I make them go away? Err and Errstr both work in my driver, so it seems 
to me I am handling them correctly.

Thank you!

Philip Stoev



Some code is trying to SET State/Errstr/Driver/Err on a connection handle. This 
is DBI.xs, dbih_set_attr_k.

perl -le 'use DBI;my $h = DBI->connect("dbi:ODBC:xxx","xxx","xxx"); $h->{State} 
= 1;'
Can't set DBI::db=HASH(0x9f77ea0)->{State}: unrecognised attribute name or 
invalid value at -e line 1.

Martin


Sorry, I did not see you'd already resolved this. For some reason I got your 
post twice.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com


Re: "unrecognised attribute name or invalid value"

2012-05-08 Thread Martin J. Evans

On 07/05/12 13:59, Philip Stoev wrote:

Hello,

I am building a new XS-based DBD driver, using the best practices of cargo-cult 
programming as recommended in the manual.

However, on every connect() attempt, I get the following unsilencable warnings:

Can't set DBI::db=HASH(0x20e7098)->{State}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Errstr}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Driver}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Err}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.

How can I make them go away? Err and Errstr both work in my driver, so it seems 
to me I am handling them correctly.

Thank you!

Philip Stoev



Some code is trying to SET State/Errstr/Driver/Err on a connection handle. This 
is DBI.xs, dbih_set_attr_k.

perl -le 'use DBI;my $h = DBI->connect("dbi:ODBC:xxx","xxx","xxx"); $h->{State} 
= 1;'
Can't set DBI::db=HASH(0x9f77ea0)->{State}: unrecognised attribute name or 
invalid value at -e line 1.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com


"unrecognised attribute name or invalid value"

2012-05-07 Thread Philip Stoev

Hello,

I am building a new XS-based DBD driver, using the best practices of 
cargo-cult programming as recommended in the manual.


However, on every connect() attempt, I get the following unsilencable 
warnings:


Can't set DBI::db=HASH(0x20e7098)->{State}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Errstr}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Driver}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Err}: unrecognised attribute name or 
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.


How can I make them go away? Err and Errstr both work in my driver, so it 
seems to me I am handling them correctly.


Thank you!

Philip Stoev



Re: "unrecognised attribute name or invalid value"

2012-05-07 Thread Philip Stoev

Thank you very much, that worked.

The second argument to DBI::_new_dbh() must be an empty hashref.

In addition, dbd_db_destroy() needs DBIc_IMPSET_off(imp_dbh)

Philip Stoev

- Original Message - 
From: "Greg Sabino Mullane" 

To: 
Sent: Monday, May 07, 2012 7:57 PM
Subject: Re: "unrecognised attribute name or invalid value"




-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160


Curiously, the warnings are only printed if the connection suceeds. If 
the

connection fails, there is no warnings.


Don't blindly pass along the $attr argument in your connect(),
but build your own hashref with just the args you need to connect.

- -- 
Greg Sabino Mullane g...@turnstep.com

End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201205071256
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iEYEAREDAAYFAk+n/toACgkQvJuQZxSWSshCgQCguTHlAoqzxca8NfhGTbeqdDWb
tpsAoKQ8pmZBCuNSV+/2j0cZ9/GCwzNt
=P+g8
-END PGP SIGNATURE-







Re: "unrecognised attribute name or invalid value"

2012-05-07 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160


> Curiously, the warnings are only printed if the connection suceeds. If the 
> connection fails, there is no warnings.

Don't blindly pass along the $attr argument in your connect(), 
but build your own hashref with just the args you need to connect.

- -- 
Greg Sabino Mullane g...@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201205071256
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iEYEAREDAAYFAk+n/toACgkQvJuQZxSWSshCgQCguTHlAoqzxca8NfhGTbeqdDWb
tpsAoKQ8pmZBCuNSV+/2j0cZ9/GCwzNt
=P+g8
-END PGP SIGNATURE-




Re: "unrecognised attribute name or invalid value"

2012-05-07 Thread Philip Stoev



On Mon, 7 May 2012 18:02:31 +0300, "Philip Stoev" 
wrote:

>> Can't set DBI::db=HASH(0x20e7098)->{State}: unrecognised attribute 
>> name

>> or
>> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
>> Can't set DBI::db=HASH(0x20e7098)->{Errstr}: unrecognised attribute 
>> name

>> or
>> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
>> Can't set DBI::db=HASH(0x20e7098)->{Driver}: unrecognised attribute 
>> name

>> or
>> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
>> Can't set DBI::db=HASH(0x20e7098)->{Err}: unrecognised attribute name 
>> or

>> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
>>
>> How can I make them go away? Err and Errstr both work in my driver, so 
>> it

>> seems to me I am handling them correctly.
>>

You should probably add them like this:

sub driver {
return $drh if $drh;

my($class, $attr) = @_;
$class .= "::dr";

$drh = DBI::_new_drh($class, {
'Name' => 'NuoDB',
'Version' => $VERSION,
'Err' => \my $err, # ADDED
'Errstr' => \my $errstr, # ADDED
'State' => \my $state, # ADDED
'Attribution' => 'Perl DBI DBD NuoDB driver by Philip Stoev 
',

});

return $drh;
}

Does that help?


Thank you for the suggestion, however unfortunately it does not work -- I 
tried it already.


Curiously, the warnings are only printed if the connection suceeds. If the 
connection fails, there is no warnings.


Philip Stoev 



Re: "unrecognised attribute name or invalid value"

2012-05-07 Thread H.Merijn Brand
On Mon, 7 May 2012 18:02:31 +0300, "Philip Stoev" 
wrote:

> >> Can't set DBI::db=HASH(0x20e7098)->{State}: unrecognised attribute name 
> >> or
> >> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
> >> Can't set DBI::db=HASH(0x20e7098)->{Errstr}: unrecognised attribute name 
> >> or
> >> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
> >> Can't set DBI::db=HASH(0x20e7098)->{Driver}: unrecognised attribute name 
> >> or
> >> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
> >> Can't set DBI::db=HASH(0x20e7098)->{Err}: unrecognised attribute name or
> >> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
> >>
> >> How can I make them go away? Err and Errstr both work in my driver, so it
> >> seems to me I am handling them correctly.
> >>
> >> Thank you!
> >
> > Did you look at other DBD XS drivers?
> >
> 
> Yes I did, I used the MySQL, Firebird, Oracle and ODBC drivers as reference 
> but I can not figure out what I am doing differently from them.
> 
> >
> > It might also help to actually share the code yoiu suspect: the code
> > you have written to implement connect (). We could comment on that.
> >
> 
> The perl portion of connect() is here
> 
> https://github.com/nuodb/nuodb-drivers/blob/master/perl_dbi/lib/DBD/NuoDB.pm#L38
> 
> The C++ portion is here:
> 
> https://github.com/nuodb/nuodb-drivers/blob/master/perl_dbi/dbdimp.cpp#L11
> 
> Thank you.

You should probably add them like this:

sub driver {
return $drh if $drh;

my($class, $attr) = @_;
$class .= "::dr";

$drh = DBI::_new_drh($class, {
'Name'  => 'NuoDB',
'Version'   => $VERSION,
'Err'   => \my $err,# ADDED
'Errstr'=> \my $errstr, # ADDED
'State' => \my $state,  # ADDED
'Attribution'   => 'Perl DBI DBD NuoDB driver by Philip Stoev 
',
});

return $drh;
}

Does that help?

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.14   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/


Re: "unrecognised attribute name or invalid value"

2012-05-07 Thread Philip Stoev
Can't set DBI::db=HASH(0x20e7098)->{State}: unrecognised attribute name 
or

invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Errstr}: unrecognised attribute name 
or

invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Driver}: unrecognised attribute name 
or

invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Err}: unrecognised attribute name or
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.

How can I make them go away? Err and Errstr both work in my driver, so it
seems to me I am handling them correctly.

Thank you!


Did you look at other DBD XS drivers?



Yes I did, I used the MySQL, Firebird, Oracle and ODBC drivers as reference 
but I can not figure out what I am doing differently from them.




It might also help to actually share the code yoiu suspect: the code
you have written to implement connect (). We could comment on that.



The perl portion of connect() is here

https://github.com/nuodb/nuodb-drivers/blob/master/perl_dbi/lib/DBD/NuoDB.pm#L38

The C++ portion is here:

https://github.com/nuodb/nuodb-drivers/blob/master/perl_dbi/dbdimp.cpp#L11

Thank you.

Philip Stoev 



Re: "unrecognised attribute name or invalid value"

2012-05-07 Thread H.Merijn Brand
On Mon, 7 May 2012 17:00:34 +0300, "Philip Stoev" 
wrote:

> Hello,
> 
> I am building a new XS-based DBD driver, using the best practices of
> cargo-cult programming as recommended in the manual.
> 
> However, on every connect() attempt, I get the following unsilencable
> warnings:
> 
> Can't set DBI::db=HASH(0x20e7098)->{State}: unrecognised attribute name or
> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
> Can't set DBI::db=HASH(0x20e7098)->{Errstr}: unrecognised attribute name or
> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
> Can't set DBI::db=HASH(0x20e7098)->{Driver}: unrecognised attribute name or
> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
> Can't set DBI::db=HASH(0x20e7098)->{Err}: unrecognised attribute name or
> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
> 
> How can I make them go away? Err and Errstr both work in my driver, so it
> seems to me I am handling them correctly.
> 
> Thank you!

Did you look at other DBD XS drivers?

When writing DBD::Unify, I found several XS drivers very informative
and I stole^Wlooked at their code very carefully to see how I were to
do it. DBD::Oracle might be the most complete, but DBD::Pg has grown a
lot too since I started in DBD XS world.

It might also help to actually share the code yoiu suspect: the code
you have written to implement connect (). We could comment on that.

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.14   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/


"unrecognised attribute name or invalid value"

2012-05-07 Thread Philip Stoev

Hello,

I am building a new XS-based DBD driver, using the best practices of
cargo-cult programming as recommended in the manual.

However, on every connect() attempt, I get the following unsilencable
warnings:

Can't set DBI::db=HASH(0x20e7098)->{State}: unrecognised attribute name or
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Errstr}: unrecognised attribute name or
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Driver}: unrecognised attribute name or
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
Can't set DBI::db=HASH(0x20e7098)->{Err}: unrecognised attribute name or
invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.

How can I make them go away? Err and Errstr both work in my driver, so it
seems to me I am handling them correctly.

Thank you!

Philip Stoev