How to change how much trace truncates?

How to change how much trace truncates?

am 10.02.2006 23:50:11 von moseley

I'd like to see all of the prepared_cached() and execute() statements
when tracing. Currently that output is truncated.

How do I change where it truncates?

Thanks,




--
Bill Moseley
moseley@hank.org

Re: How to change how much trace truncates?

am 11.02.2006 14:22:49 von Tim.Bunce

On Fri, Feb 10, 2006 at 02:50:11PM -0800, Bill Moseley wrote:
> I'd like to see all of the prepared_cached() and execute() statements
> when tracing. Currently that output is truncated.
>
> How do I change where it truncates?

From memory it's $DBI::max_neatlen - but it is in the docs.

Were the docs not clear enough?

Tim.

Re: How to change how much trace truncates?

am 13.02.2006 16:30:46 von sigzero

Tim Bunce wrote:
> On Fri, Feb 10, 2006 at 02:50:11PM -0800, Bill Moseley wrote:
>> I'd like to see all of the prepared_cached() and execute() statements
>> when tracing. Currently that output is truncated.
>>
>> How do I change where it truncates?
>
> From memory it's $DBI::max_neatlen - but it is in the docs.
>

Looking through the DBI docs, I find no trace (pun intended) of
$DBI->max_neatlen. I found a max_len as a bind value to increase memory
but that was as close as I got.

Robert

Re: How to change how much trace truncates?

am 14.02.2006 10:48:13 von Tim.Bunce

On Mon, Feb 13, 2006 at 10:30:46AM -0500, Robert Hicks wrote:
> Tim Bunce wrote:
> >On Fri, Feb 10, 2006 at 02:50:11PM -0800, Bill Moseley wrote:
> >>I'd like to see all of the prepared_cached() and execute() statements
> >>when tracing. Currently that output is truncated.
> >>
> >>How do I change where it truncates?
> >
> >From memory it's $DBI::max_neatlen - but it is in the docs.
>
> Looking through the DBI docs, I find no trace (pun intended) of
> $DBI->max_neatlen. I found a max_len as a bind value to increase memory
> but that was as close as I got.

Ah. Now I look at the docs I see that $DBI::neat_maxlen is only
mentioned in the docs for the neat() utility function:

=item C

$str = neat($value);
$str = neat($value, $maxlen);

Return a string containing a neat (and tidy) representation of the
supplied value.

Strings will be quoted, although internal quotes will I be escaped.
Values known to be numeric will be unquoted. Undefined (NULL) values
will be shown as C (without quotes).

If the string is flagged internally as utf8 then double quotes will
be used, otherwise single quotes are used and unprintable characters
will be replaced by dot (.).

For result strings longer than C<$maxlen> the result string will be
truncated to C<$maxlen-4> and "C<...'>" will be appended. If C<$maxlen> is 0
or C, it defaults to C<$DBI::neat_maxlen> which, in turn, defaults to 400.

This function is designed to format values for human consumption.
It is used internally by the DBI for L output. It should
typically I be used for formatting values for database use.
(See also L.)

=cut

I'll add mention of it into the TRACING section.

Thanks.

Tim.

Re: How to change how much trace truncates?

am 16.03.2006 14:57:21 von moseley

On Sat, Feb 11, 2006 at 01:22:49PM +0000, Tim Bunce wrote:
> On Fri, Feb 10, 2006 at 02:50:11PM -0800, Bill Moseley wrote:
> > I'd like to see all of the prepared_cached() and execute() statements
> > when tracing. Currently that output is truncated.
> >
> > How do I change where it truncates?
>
> >From memory it's $DBI::max_neatlen - but it is in the docs.

That does change what the prepare_cached() call shows, but not what
the execute() shows. Is there a similar setting so I can see all my
bind parameters?

What I'm after, of course, is a way to watch just the queries (I'm
tuning my ORM's selects). Postgresql can log queries, but (IIRC) it
won't show already prepared statements.

Thanks,

--
Bill Moseley
moseley@hank.org