Skip Menu |

This queue is for tickets about the SQL-Abstract CPAN distribution.

Report information
The Basics
Id: 65566
Status: resolved
Priority: 0/
Queue: SQL-Abstract

People
Owner: Nobody in particular
Requestors: jeremy [...] directfreight.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Pretty Print is causing round brackets to be removed.
Date: Wed, 9 Feb 2011 00:44:54 +0800
To: bug-DBIx-Class [...] rt.cpan.org
From: Jeremy Carman <jeremy [...] directfreight.com>
Issue: Turning DBIC_TRACE_PROFILE option on causes the pretty print to remove some ( ) from trace output. Example: SELECT COUNT( * ) FROM all_loads_hist_daily me WHERE city1 = 'test' AND city2 = 'test' AND comment = '' AND companyname = 'CARMAN BIG RIG' AND contactinfo = '555-555-5555' AND creditscore = '-1' AND entered_at = NOW( ) AND greenlight = '' AND height = '' AND latitude1 = '1.00' AND latitude2 = '1.00' AND length = '' AND longitude1 = '1.00' AND longitude2 = '1.00' AND md5sum = md5( CONCAT username, city1, state1, city2, state2, type, other, size, shipdate, receivedate, length, width, height, weight, payrate, paytype, comment ) AND other = '' AND payrate = '' AND paytype = 'Per Mile' AND receivedate = '0000-00-00' AND shipdate = '2011-02-08' AND size = '' AND state1 = 'MO' AND state2 = 'MO' AND transid = '' AND tripmiles = '-4' AND type = 'SD,AC,LB,' AND username = 'JJC111' AND whoentered = 'A' AND width = '' Show quoted text
-------- the search part of the code ------- $inserted = myapp->model("Legacy::$db")->search({ username => uc $user_data->username, city1 => $params->{city1}, state1 => $params->{state1}, city2 => $params->{city2}, state2 => $params->{state2}, type => $type, other => $params->{other} // '', size => $params->{load_size} // '', shipdate => $params->{date_avail}, receivedate => $params->{date_recieved} // '0000-00-00', length => $params->{length} // '', width => $params->{width} // '', height => $params->{height} // '', payrate => $params->{pay_rate}, paytype => $params->{pay_type}, comment => $params->{comments} // '', entered_at => \' = NOW()', whoentered => 'A', latitude1 => $latlon1[0], longitude1 => $latlon1[1], latitude2 => $latlon2[0], longitude2 => $latlon2[1], md5sum => \'= md5( CONCAT( username, city1, state1, city2, state2, type, other, size, shipdate, receivedate, length, width, height, weight, payrate, paytype, comment) )', companyname => $user_data->company, contactinfo => $user_data->contactinfo, creditscore => $user_data->creditrating, transid => $user_data->mcnumber, tripmiles => $mileage, greenlight => $user_data->greenlight, }, { key => 'md5sum', } ); Turning off DBIC_TRACE_PROFILE revealed that the extra set of ( ) was still there. I am using The current version of catalyst(0.08127). Linux, Kubuntu. Bash DBIC_TRACE_PROFILE=console DBIC_TRACE=1 perl myapp.pl Thanks!
On Tue Feb 08 11:45:05 2011, jeremy@directfreight.com wrote: Show quoted text
> Issue: Turning DBIC_TRACE_PROFILE option on causes the pretty print to > remove some ( ) from trace output. >
This is not a DBIx::Class bug, reassigning to SQL::Abstract. Please send a patch adding a failing line to t/14roundtripping.t [1]. Note how there is a test duplication on lines 15 and 28-30 - this is to avoid the paren-stripper masking its own problems. [1] http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/SQL-Abstract.git;a=blob;f=t/14roundtrippin.t;h=7df3010e53504fce36f8cc9ecbe2bd9badfc89fd;hb=HEAD
Since this bug was reported the parser became *a lot* smarter, and there are a number of tests which specifically deal with the problem described. Therefore changing the status to resolved (in case someone decides to followup).