[ic] SQL_Parser.pm

Stefan Hornburg racke at linuxia.de
Mon Jan 26 15:47:05 EST 2004


On Mon, 26 Jan 2004 12:48:15 -0500
Mike Heins <mike at perusion.com> wrote:

> Quoting Sandy Thomson (sandy at scotwebshops.com):
> > Hi,
> > I have been attempting to upgrade some of our shops to IC 5.0.0. However 
> > in doing so I have encountered issues with a new file called SQL_Parser.pm.
> > 
> > The version we are moving from is a cvs build of 4.8.7, and this does 
> > not seem to have this perl module in lib/Vend, so I assume pre 5.0.0 
> > interchange versions dealt with search tag expansion differently?
> > 
> > The errors I have been encountering are of the form:
> > x.x.x.x session_id:nobody - [26/January/2004:11:19:13 +0000] site 
> > www.site.com/sku_item SQL query failed: syntax error: unknown op 
> > 'o_sort' at /home/shops/interchange-5.0/lib/Vend/SQL_Parser.pm line 447.
> > >
> > > query was: SELECT code,o_group,o_value,o_label,o_widget,price FROM 
> > options where sku = 'sku_item'ORDER BY o_sort
> > 
> > The errors have been occuring whenever a page with product options is 
> > requested. I assume it is just an issue with interchange 5 (or our sites)?
> > 
> > Any hints?
> 
> Vend::SQL_Parser replaces SQL::Statement.
> 
> I don't see how anyone could figure out what is going on without
> seeing what you have in the failing page.
> 
> >From the error I see, assuming it is put in there properly (doubtful
> because it is wrapped) it looks like there is an incorrectly formattted
> query. But without seeing what generates it there is no way to tell.

But there is code in Options/Old48.pm which would generate a query without
a space between ' and ORDER BY:

	my $q = "SELECT " . join (",", @rf) . " FROM $tname where $fsel = $rsel";

	if(my $rsort = find_sort($opt)) {
		$q .= $rsort;
	}

I don't know what the SQL standard says, but MySQL parses this query while
SQL_Parser obviously doesn't.

Bye
	Racke

-- 
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team



More information about the interchange-users mailing list