On Fri, Feb 20, 2004 at 12:19:31PM +0100, Steffen Goeldner wrote:
> Tim Bunce wrote:
> > Have you tried using the new set_err semantics for warnings DBD::ADO?
>
> DBD::ADO currently uses the err=0 feature:
>
> $DBD::ADO::err = 0 unless $DBD::ADO::errcum & 1 << 31; # oledberr.h
>
> to suppress warnings (which works even with older DBI's).
> I tested DBI 1.41 separately (not yet with DBD::ADO) and
> don't expect any DBD::ADO specific problems.
> BTW: Should warnings like
>
> warn("Commit ineffective while AutoCommit is on")
> warn('$h->rows count is incomplete before all rows fetched.')
> Carp::carp("DSN component '$_' is not in 'name=value' format")
>
> henceforth use set_err( 0, ...)? Or is there still a case for
> plain warn/Carp::carp?
Good question.
I think I'm happy with those being warn()/carp() and disabled
via $h->{Warn}=0. The err=0 warning mechanism really needs the
code to be checking for them. (Printing them if PrintError is
set is a pragmatic compromise.) In reality many non-trivial
applications set PrintError=0.
Umm, I guess your question could be reformulated as: "Should the
DBI define a default HandleError sub that prints warnings"
or "Should the DBI have a PrintWarn attribute that prints warnings,
which could be default to on".
I think the PrintWarn approach is a good one. I'll add it.
Thanks.
Tim.