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: ax = DBIc_STATE(imp_sth)->get_fbav(imp_sth);
> 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 :-)
Tim.