On Thu, 26 Apr 2007 18:00:22 +0100, Tim Bunce <[EMAIL PROTECTED]> wrote:

> On Thu, Apr 26, 2007 at 12:48:26PM +0200, H.Merijn Brand wrote:
> > On Thu, 26 Apr 2007 09:11:50 +0100, Tim Bunce <[EMAIL PROTECTED]> wrote:
> > 
> > > On Wed, Apr 25, 2007 at 10:40:41PM +0100, Tim Bunce wrote:
> > > > On Wed, Apr 25, 2007 at 01:18:08PM +0200, H.Merijn Brand wrote:
> > > > > > ---
> > > > > > Don't use DBIS or dbis when you can use DBIc_STATE (imp_xxh).
> > > > > > DBIS is much slower, especially on perls built with threads enabled.
> > > > > > It's a macro that expands to a function call, whereas
> > > > > > DBIc_STATE (imp_xxh) is just accessing a field in the handle 
> > > > > > structure.
> > > > > 
> > > > > This does not apply to?:
> > > > > 
> > > > >     av = DBIS->get_fbav (imp_sth);
> > > > >     num_fields = AvFILL (av) + 1;
> > > > 
> > > > Yes. Ideally the code should have no DBIS (or dbis) in it at all. The 
> > > > only
> > > > exception would be any code that doesn't have a handle/imp_xxh handy.
> > > 
> > >  ... and can't be modified to have a handle/imp_xxh passed in.
> > 
> > I've lost you here. Is there a sane way to prevent DBIS in the tail of
> > the following snippet?
> 
> > AV *dbd_st_fetch (SV *sth, imp_sth_t *imp_sth)
> > {
> 
> >     av = DBIS->get_fbav (imp_sth);
> 
> Sure: av = DBIc_STATE (imp_sth)->get_fbav (imp_sth);

If I do that, I get

cc: "dbdimp.ec", line 1122: error 1588: "get_fbav" undefined.
cc: "dbdimp.ec", line 1122: error 1531: Invalid member of struct or union.
cc: "dbdimp.ec", line 1122: error 1533: Illegal function call.

> > I changed the error () function to use
> > 
> >  DBIh_SET_ERR_CHAR (h, imp_xxh, Nullch, error_num, text, SQLSTATE, Nullch);
> > 
> > and behold! my DBD now supports SQLSTATE throughout :)
> 
> :-)
> 
> > It's a shame that UNIFY didn't even document SQLSTATE, apart from
> >   "The SQLSTATE variable is provided for compatibility to the
> >    ANSI SQL2 draft standard."
> > 
> > So I have no idea how to extend my tests to see if the states make sense
> 
> If you don't then I certainly don't :-)

I'll see if I can dig up some `standards' about that and if Unify does
comply to them.

-- 
H.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using & porting perl 5.6.2, 5.8.x, 5.9.x   on HP-UX 10.20, 11.00, 11.11,
& 11.23, SuSE 10.0 & 10.2, AIX 4.3 & 5.2, and Cygwin. http://qa.perl.org
http://mirrors.develooper.com/hpux/            http://www.test-smoke.org
                        http://www.goldmark.org/jeff/stupid-disclaimers/

Reply via email to