Re: promised trace flags change - a bit late
"Martin J. Evans" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.dbi.sybase.devel |
|---|---|
| Message-ID | <[email protected]> |
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.
>> All done in DBD::ODBC, tested and committed to trunk for next release.
> Great. Thanks.
>
Updated for the new TXN flag too now.
>> For other DBD authors following this (and assuming it makes the next
>> DBI release without modification) you can now replace your
>> dbd_verbose attribute with:
>>
>> if (DBIc_TRACE(imp_xxh, DBIf_TRACE_DBD, 0, 3)) {
>>
>> which will be true when trace level is> 3 or when someone set the
>> DBD trace flag. You can see DBD::ODBC's dbdimp.c for how I did it as
>> until 1.617 of DBI is released the DBIfxxx flags will not exist so I
>> worked around that for the situation when pre DBI 1.617 is used.
> I've added the per-method trace flags in r14684. And in r14686 I added
> a TXN bit and set either CON on TXN on the relevant methods.
>
I've added TXN to parse_trace_flag too.
I verified setting trace flag CON does now add some DBI connection tracing.
Similarly with TXN.
>> The only small issue I have is a small amount of DBI tracing is
>> output right at the start even when DBD tracing only is set:
> That should be fixed by r14685.
>
It is.
> 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.)
>
> Tim.
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.
Martin