On Wed, Sep 11, 2002 at 08:50:51PM -0400, Steven N. Hirsch wrote:
> Tim,
>
> Two fixes and a suggestion follow. To be applied over my most recent
> diffs.
>
> The fixes ensure that $db_obj->state always gets called with a string of
> exactly five chars (it complains otherwise.)
>
> The suggested change to CallMethod prevents the logs from filling with
> errors in the case where we will be triggering hundreds or thousands of
> them quite knowingly (client app inserts in a loop where we suppress
> RaiseError and simply continue past some expected failure conditions, e.g.
> duplicate primary key.)
>
> By feeding the death message to Debug, we can still choose to watch if
> need be.
Yeap.
> sub proxy_set_err {
> my ($h,$errmsg) = @_;
> my ($err,$state) =
> - ($errmsg =~ s/ \[err=(.*?),state=(.*?)\]//) ? ($1,$2) : (1,5 x ' ');
> + ($errmsg =~ s/ \[err=(.*?),state=(.*?)\]//) ? ($1,$2) : (1,' ');
> return DBI::set_err($h, $err, $errmsg, $state);
> }
I think a better fix is to use ... : (1,'')
which is what I suggested originally. Was there a problem with that?
If state is '' but err is non-zero then the DBI will return state
as 'S1000' (general error).
> --- ProxyServer.pm 2002/09/10 01:37:40 1.5
> +++ ProxyServer.pm 2002/09/12 00:35:25 1.6
> @@ -195,7 +195,7 @@
> - my $state = $_[1]->state || '';
> + my $state = $_[1]->state || ' ';
I don't think that needs changing.
Tim.