Skip Menu |

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

Report information
The Basics
Id: 59834
Status: resolved
Priority: 0/
Queue: SQL-Statement

People
Owner: Nobody in particular
Requestors: jrw32982 [...] yahoo.com
Cc: h.m.brand [...] xs4all.nl
AdminCc:

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



Subject: SQL::Statement::Structure doc bugs: no functions for column_defs(), where->op()
The synopsis for SQL::Statement::Structure shows the use of column_defs() and where->op(). But these don't appear to be implemented. Trying to run the code in the synopsis fails. 0) Copy the synopsis to a script and add #!/usr/bin/perl 1) Comment out the LOAD line. 2) Run the script. Can't locate object method "column_defs" via package "SQL::Statement" 3) Comment out column_defs line. Can't locate object method "op" via package "SQL::Statement::Operation::And" Additionally, the order() function does not return a blessed object, but simply a hash. So, the call to the column() method also fails. Can't call method "column" on unblessed reference
On Thu Jul 29 15:05:13 2010, jrw wrote: Hi jrw, Show quoted text
> The synopsis for SQL::Statement::Structure shows the use of > column_defs() and where->op(). But these don't appear to be > implemented. Trying to run the code in the synopsis fails. > > 0) Copy the synopsis to a script and add #!/usr/bin/perl > 1) Comment out the LOAD line. > 2) Run the script. > > Can't locate object method "column_defs" via package "SQL::Statement"
Fixed in 1.30 Show quoted text
> 3) Comment out column_defs line. > > Can't locate object method "op" via package
"SQL::Statement::Operation::And" Fixed in 1.30 Show quoted text
> Additionally, the order() function does not return a blessed object, but > simply a hash. So, the call to the column() method also fails. > > Can't call method "column" on unblessed reference
This isn't fixable trivially, because the orders are converted to a blessed object after opening all tables and proved all column names (including those in ORDER BY clause). There're now 2 ways out: 1) I remove the order example from the SYNOPSIS of SQL::Statement::Structure 2) I refactor the SQL::Statement::OrderBy class to use lazy evaluation of column names as SQL::Statement::ColumnValue (lib/SQL/Statement/Term.pm). As requestor, do you have any preference? Best regards and thanks for contributing, Jens
Subject: Re: [rt.cpan.org #59834] SQL::Statement::Structure doc bugs: no functions for column_defs(), where->op()
Date: Sun, 15 Aug 2010 10:41:53 -0700 (PDT)
To: bug-SQL-Statement [...] rt.cpan.org
From: John Wiersba <jrw32982 [...] yahoo.com>
Thanks, Jens, for the fixes! I don't really have a preference for the fixes; fixing the doc is fine with me. I was just doing some investigation on potentially using this module and testing it and noticed the discrepancies between the documentation and the implementation, so I thought I'd report it. -- John Wiersba Show quoted text
________________________________ From: Jens Rehsack via RT <bug-SQL-Statement@rt.cpan.org> To: jrw32982@yahoo.com Cc: h.m.brand@xs4all.nl; Dan@DWright.Org Sent: Sun, August 15, 2010 11:19:10 AM Subject: [rt.cpan.org #59834] SQL::Statement::Structure doc bugs: no functions for column_defs(), where->op() <URL: https://rt.cpan.org/Ticket/Display.html?id=59834 > On Thu Jul 29 15:05:13 2010, jrw wrote: Hi jrw,
> The synopsis for SQL::Statement::Structure shows the use of > column_defs() and where->op(). But these don't appear to be > implemented. Trying to run the code in the synopsis fails. > > 0) Copy the synopsis to a script and add #!/usr/bin/perl > 1) Comment out the LOAD line. > 2) Run the script. > > Can't locate object method "column_defs" via package "SQL::Statement"
Fixed in 1.30
> 3) Comment out column_defs line. > > Can't locate object method "op" via package
"SQL::Statement::Operation::And" Fixed in 1.30
> Additionally, the order() function does not return a blessed object, but > simply a hash. So, the call to the column() method also fails. > > Can't call method "column" on unblessed reference
This isn't fixable trivially, because the orders are converted to a blessed object after opening all tables and proved all column names (including those in ORDER BY clause). There're now 2 ways out: 1) I remove the order example from the SYNOPSIS of SQL::Statement::Structure 2) I refactor the SQL::Statement::OrderBy class to use lazy evaluation of column names as SQL::Statement::ColumnValue (lib/SQL/Statement/Term.pm). As requestor, do you have any preference? Best regards and thanks for contributing, Jens
Documentation updated. Thanks again for pointing this out. Cheers, Jens