Skip Menu |
 

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

Report information
The Basics
Id: 86692
Status: new
Priority: 0/
Queue: SQL-Statement

People
Owner: Nobody in particular
Requestors: randolph [...] deepcloud.com.au
Cc:
AdminCc:

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



X-Source:
From randolph [...] deepcloud.com.au Thu Jul 4 00: 52:38 2013
MIME-Version: 1.0
X-Source-Args:
X-Spam-Status: No, score=-4.394 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, HTML_FONT_SIZE_LARGE=0.001, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, PERCENT_RANDOM=1.838, RCVD_IN_DNSWL_HI=-5, SPF_SOFTFAIL=0.665] autolearn=ham
X-Source-Dir:
X-Spam-Flag: NO
X-Virus-Checked: Checked
Content-Type: multipart/related; boundary="B_3455794333_17803879"
Message-ID: <CDFB3C98.10C84%randolph [...] deepcloud.com.au>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Source-Auth:
X-Source-Sender: cpe-110-148-137-150.vxl8.lon.bigpond.net.au ([10.0.0.2]) [110.148.137.150]:58097
X-Antiabuse: This header was added to track abuse, please include it with any abuse report
X-Antiabuse: Primary Hostname - trailblazer.websitewelcome.com
X-Antiabuse: Original Domain - rt.cpan.org
X-Antiabuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-Antiabuse: Sender Address Domain - deepcloud.com.au
X-Spam-Score: -4.394
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id C80E0240E4B for <cpan-bug+SQL-Statement [...] hipster.bestpractical.com>; Thu, 4 Jul 2013 00:52:38 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qgSAK78LxRqL for <cpan-bug+SQL-Statement [...] hipster.bestpractical.com>; Thu, 4 Jul 2013 00:52:37 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id C9A86240BA6 for <bug-SQL-Statement [...] rt.cpan.org>; Thu, 4 Jul 2013 00:52:36 -0400 (EDT)
Received: (qmail 4356 invoked by alias); 4 Jul 2013 04:52:35 -0000
Received: from gateway01.websitewelcome.com (HELO gateway01.websitewelcome.com) (69.41.248.19) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 03 Jul 2013 21:52:27 -0700
Received: by gateway01.websitewelcome.com (Postfix, from userid 5007) id 3D48959FE16B9; Wed, 3 Jul 2013 23:52:14 -0500 (CDT)
Received: from trailblazer.websitewelcome.com (trailblazer.websitewelcome.com [174.120.17.226]) by gateway01.websitewelcome.com (Postfix) with ESMTP id 31B7F59FE1699 for <bug-SQL-Statement [...] rt.cpan.org>; Wed, 3 Jul 2013 23:52:14 -0500 (CDT)
Received: from cpe-110-148-137-150.vxl8.lon.bigpond.net.au ([110.148.137.150]:58097 helo=[10.0.0.2]) by trailblazer.websitewelcome.com with esmtps (TLSv1:DES-CBC3-SHA:168) (Exim 4.80) (envelope-from <randolph [...] deepcloud.com.au>) id 1UubWf-0000f1-2t for bug-SQL-Statement [...] rt.cpan.org; Wed, 03 Jul 2013 23:52:14 -0500
Delivered-To: cpan-bug+SQL-Statement [...] hipster.bestpractical.com
User-Agent: Microsoft-Entourage/12.0.0.071130
Subject: UDF parse bug
Return-Path: <randolph [...] deepcloud.com.au>
Thread-Index: Ac54cjyu7z2aZoXcWkyGSi0K1cAdzw==
X-RT-Mail-Extension: sql-statement
X-Original-To: cpan-bug+SQL-Statement [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Date: Thu, 04 Jul 2013 14:52:08 +1000
X-Spam-Level:
Thread-Topic: UDF parse bug
X-Email-Count: 0
X-Bwhitelist: no
To: <bug-SQL-Statement [...] rt.cpan.org>
From: Randolph Pullen <randolph [...] deepcloud.com.au>
X-RT-Interface: Email
Content-Length: 0
Content-Type: multipart/alternative; boundary="B_3455794333_17769408"
Content-Length: 0
content-type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: ascii
Content-Length: 2232
Download (untitled) / with headers
text/plain 2.1k
I use SQL::Statement to parse and then generate other code rather than executing SQL. My extended Parser adds some function stubs as shown below. Since upgrading to 1.33 I am having some problems with UDF's these throwing up errors in Parser.pm These work: select octet_length(a) from rpp3; select charextract(caller, 3) from cdr select lowercase(a) from rpp3; select rpad(a,2) from rpp3; select shift(b,2) from rpp3; ...but these don't: select ltrim(a) from rpp3; select rtrim(a) from rpp3; Parser.pm reports: Unknown function 'ltrim' (same with rtrim) select nvl(caller, '2222') from cdr; becomes select nvl (caller,?0?) FROM cdr; locate(), replace(), nvl2(), ifnull() and others using constant parameters exhibit the same problem. ie: Only in these cases, the fullorg field appears wrong: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $VAR1 = { 'subname' => 'SQL::Statement::Functions::SQL_FUNCTION_NVL', 'value' => [ { 'value' => 'caller', 'type' => 'column', 'fullorg' => 'caller' }, { 'value' => '2222', 'type' => 'string', 'fullorg' => '2222' } ], 'name' => 'nvl', 'type' => 'function', 'fullorg' => 'nvl (caller,?0?)', 'alias' => 'nvl' }; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Is this a bug or are users expected to reconstruct the field by other means? My UDF package looks like this: package MyFunctions; use strict; use warnings; use vars qw(@ISA $VERSION); require SQL::Statement::Term; $VERSION = '1.0'; #string funcs sub SQL_FUNCTION_SHIFT{ } ; sub SQL_FUNCTION_RTRIM{ } ; sub SQL_FUNCTION_LTRIM{ } ; sub SQL_FUNCTION_RPAD{ } ; sub SQL_FUNCTION_RIGHT{ } ; sub SQL_FUNCTION_OCTET_LENGTH{ } ; sub SQL_FUNCTION_IFNULL{ } ; sub SQL_FUNCTION_NVL2{ } ; sub SQL_FUNCTION_REPLACE{ } ; etc... My Parsers instantiation method looks like: sub new { my $class = shift; my $dialect = shift || 'ANSI'; my $flags = shift; my $parent = $class->can("SUPER::new"); my $self = $class->SUPER::new($dialect ,$flags); $self->LOAD('LOAD MyFunctions'); return bless $self, $class; } Randolph Pullen Architect & Co-Founder DeepCloud E: randolph@deepcloud.com.au P: +61 42089 5221 www.DeepCloud.co
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: ascii
Content-Length: 4172
Content-Type: image/jpeg; name="image.jpg"
Content-Transfer-Encoding: base64
Content-ID: <3455794328_17795534>
Content-Length: 6610
Download image.jpg
image/jpeg 6.4k
image.jpg


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.