Here is one way to fix it:
--- /usr/local/perl/lib/site_perl/5.16.1/SQL/Abstract/More.pm 2014-10-03
16:27:50.000000000 -0400
+++ More.pm 2014-10-13 15:48:54.407764200 -0400
@@ -230,9 +230,11 @@
push @post_select, shift @cols while @cols && $cols[0] =~ s/^-//;
foreach my $col (@cols) {
# extract alias, if any
- if ($col =~ /^(.*[^|\s]) # any non-empty string, not ending with ' '
or '|'
+ if ($col =~ /^\s* # ignore insignificant leading spaces
+ (.*[^|\s]) # any non-empty string, not ending with ' '
or '|'
\| # followed by a literal '|'
(\w+) # followed by a word (the alias))
+ \s* # ignore insignificant trailing spaces
$/x) {
$aliased_columns{$2} = $1;
$col = $self->column_alias($1, $2);
On Mon, Oct 13, 2014 at 1:17 AM, Bugs in SQL-Abstract-More via RT <
bug-SQL-Abstract-More@rt.cpan.org> wrote:
Show quoted text>
> Greetings,
>
> This message has been automatically generated in response to the
> creation of a trouble ticket regarding:
> "SQL::Abstract::More 1.25 bug",
> a summary of which appears below.
>
> There is no need to reply to this message right now. Your ticket has been
> assigned an ID of [rt.cpan.org #99455]. Your ticket is accessible
> on the web at:
>
>
https://rt.cpan.org/Ticket/Display.html?id=99455
>
> Please include the string:
>
> [rt.cpan.org #99455]
>
> in the subject line of all future correspondence about this issue. To do
> so,
> you may reply to this message.
>
> Thank you,
> bug-SQL-Abstract-More@rt.cpan.org
>
> -------------------------------------------------------------------------
> Hi SQL::Abstract::More developer.
>
> I've been using this module for a long time. Recently I updated it from
> 1.10 to 1.25 and got my code not working anymore. Let me quote what kind
> of changes I had to make to get it working again:
>
> ) = $sql -> select( -columns => [ 't3.description|switch_descr',
> 't1.assigned_by',
> - q[ concat_ws( ' ', t2.first_name,
> t2.last_name )|assigned_by_long ],
> + q[ concat_ws( ' ', t2.first_name,
> t2.last_name )|assigned_by_long],
>
> I think that regexp in newer version got changed and it doesn't account for
> a trailing space anymore while looking for a column name alias. As a
> result sql statement mentions non-existing column with '|' in its name.
> And script dies.
>
> Hope it's easily fixable, because I widely use this feature and have many
> scripts to check and change.
>
> Let me know if you need any other information.
>
> With best regards,
> Val
>