Re: promised trace flags change - a bit late

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Sun, Feb 06, 2011 at 02:39:09PM +0000, Martin J. Evans wrote:
> On 06/02/2011 13:00, Tim Bunce wrote:
> >On Sat, Feb 05, 2011 at 01:27:11PM +0000, Martin J. Evans wrote:
> >>>ok, the 3 new trace flags are in and I added macros (slight shame
> >>>you cannot use them in DBI.pm too but not a great deal).
> >I think they should be added to the ALIAS list in constant().
> >
> Which I've done but I'm not sure it you meant this was supposed to
> allow me to use them in DBI.pm as I still cannot. I don't really
> understand constant() it just seems to return the ix which I thought
> was the index number of the alias so I'm not sure what it is there
> for.

It is the 'index number' but by using the

    ALIAS:
        DBIf_FOO = DBIf_FOO

syntax you can set the index number for a specific name to a specific
value. In this case the value of the macro of that name. Kind'a cute.
So now DBIf_FOO is the name of a perl constant[*] that has the value of
the DBIf_FOO macro.

[*] These constants aren't real compile-time constants, sadly. They're
just AUTOLOADed functions that return a constant value. There are
probably better (faster and lighter-weight) ways of defining constants
in XS in modern perl versions. I've never got around to reworking this.

> >I've not tested any of the above. I'd be grateful if you could test it
> >out. t/09trace.t could be extended for that purpose. (I'm not sure how
> >much effort it would be to keep DBI::PurePerl in sync with this work.)
>
> I changed 09trace.t for new flags and it passes ok.
> 
> I don't know much about DBI::PurePerl (never used it) - it doesn't
> see to do anything with trace flags at all as far as I can see.

DBI::PurePerl mostly ducks the issue of selective tracing.
I suspect the 09trace.t tests just aren't noticing that.
Not a big issue.

Tim.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.