Skip Menu |

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

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

People
Owner: JZUCKER [...] cpan.org
Requestors: weimer [...] etes.de
Cc:
AdminCc:

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



Subject: Terminating semicolon and LIMIT clause
Hi, I have noticed that DBD::Google does not work when terminating a SELECT statement with a semicolon, if a LIMIT clause is included in the query. For example, $dbh->prepare("SELECT URL FROM google WHERE q=$search LIMIT 970,10;"); produces "SQL ERROR: Bad limit clause!" in SQL::Parser because the terminating semicolon shows up in $limit_clause. Without the semicolon the query will succeed, however this is a violation of the SQL standard. I would be glad if you could fix this error. Thanks, Hendrik
[guest - Fri Aug 12 07:57:06 2005]: Show quoted text
> I have noticed that DBD::Google does not work when terminating a > SELECT statement with a semicolon, if a LIMIT clause is included in > the query.
Actually, this is a problem with SQL::Parser, in the LIMIT_CLAUSE method (line 1178 in SQL::Parser version 1.13), and the way SQL::Parser is subclassed, I can't fix the error in DBD::Google. I'm going to move this ticket to the SQL::Parser queue.
Hendrik wrote: For example, $dbh->prepare("SELECT URL FROM google WHERE q=$search LIMIT 970,10;"); produces "SQL ERROR: Bad limit clause!" in SQL::Parser because the terminating semicolon shows up in $limit_clause. Without the semicolon the query will succeed, however this is a violation of the SQL standard. Um, it has nothing to do with the SQL standard. DBI never expects and should not accept trailing semicolons for any statements.