[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ic] A fix for Vend/SQL_Parser.pm


Dear Interchange Developer Team.

I got a problem with the package Vend::SQL_Parser (version 2.10).

The following SQL - Statement produces some error messages in the
catalog error log :

SQL : select DISTINCT( Gruppe ),Gruppenummer from products WHERE
aktiv='1' and Sonderposten != 'S' ORDER BY Gruppe;

Log message :
> shop /cgi-bin/shop/display.html SQL query failed: Bad column name
(from DISTINCT( Gruppe )): 'DISTINCT( Gruppe )' at
/www/shop/icserver/lib/Vend/SQL_Parser.pm line 839.
>

It seems that the distinct check can not handle brackets at the moment
(\s does not include brackets):
$self->{distinct} = 1 if $raw =~ s/^distinct\s+//i;

The problem could be solved with the modification followed:

if ($raw =~ s/^distinct[\s(]+//i) {
	$self->{distinct} = 1;
	# delete last bracket if exists
	$raw =~ s/[\s\)]+$//i
}

Regards,

Lars

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.