Skip Menu |
 

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

Report information
The Basics
Id: 53416
Status: stalled
Priority: 0/
Queue: SQL-Statement

People
Owner: Nobody in particular
Requestors: mjp [...] cpan.org
Cc:
AdminCc:

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



Subject: TRIM(FROM) broken in select list
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1262752406-2395-40"
Content-Length: 0
Content-Type: text/html; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 656
SQL-Statement/SQL-Parser 1.23 cannot handle the "FROM" word in a TRIM() function in a SELECT clause.  Here's an excerpt of the attached demonstration script showing some failures:

    SELECT TRIM(BOTH 'x' FROM col) FROM tbl
    ------------------------------
    Can't find alias in FROM clause! at /home/mjp/.perl/5.10/lib/site_perl/5.10.1/SQL/Parser.pm line 2894, <DATA> line 8.

... and so on.  See also this discussion forum post:  http://stackoverflow.com/questions/1975526/do-sqlstatements-regex-and-trim-work-with-dbdcsv
Subject: trim-bug.orig
MIME-Version: 1.0
Content-Type: application/octet-stream; name="trim-bug.orig"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename="trim-bug.orig"
Content-Transfer-Encoding: base64
Content-Length: 838
Download trim-bug.orig
application/octet-stream 838b

Message body not shown because it is not plain text.

MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/html; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2386-1262774371-703.53416-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 285
Same for SUBSTRING() - this is, because the parser splits between the elements to select and tables to select from at the first found keyword /FROM/i.
I'm not sure whether this will be fixed in 1.xx series of S:S.

Thanks for reporting anyway.

Jens


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.