OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



DB Error: You have an error in your SQL syntax near 'USING

Open Harvester Systems support questions and answers, bug reports, and development issues.

Moderators: jmacgreg, michael, John

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

DB Error: You have an error in your SQL syntax near 'USING

Postby Jordi Prats » Tue Aug 29, 2006 8:57 am

Dear colleagues,

I have a problem when I try to collect metadata of a repository.

When I have the first collect operation the system runs ok, but when I execute /tools/harvest.php 1, I receive the following error message:

Selected archive: Universitat Politècnica de Catalunya - DSpace.E-prints
Not flushing an existing 128 records.
Fetching records...
<h1>DB Error: You have an error in your SQL syntax near 'USING entries, entry_attributes WHERE entries.record_id = '1' AND entry_attribut' at line 1</h1>Harvester2: DB Error: You have an error in your SQL syntax near 'USING entries, entry_attributes WHERE entries.record_id = '1' AND entry_attribut' at line 1


It happens to me the same when I try to execute flush metadata.

I have a Metadata Collector in a system:

OS platform Linux
PHP version 4.3.11
Apache version Apache/2.0.49 (Unix) mod_perl/1.99_17 Perl/v5.8.5 mod_ssl/2.0.49 OpenSSL/0.9.7e PHP/4.3.11 mod_jk/1.2.6
Database driver mysql
Database server version 3.23.58

Thanks in advance for your help,
Jordi Prats
 
Posts: 2
Joined: Tue Aug 29, 2006 4:39 am

Postby asmecher » Tue Aug 29, 2006 9:45 am

Hi Jordi,

The SQL statement that is causing the problem is in classes/record/RecordDAO.inc.php, in the deleteEntriesByRecordId function:
DELETE FROM entry_attributes USING entries, entry_attributes WHERE entries.record_id = ? AND entry_attributes.entry_id = entries.entry_id
I suspect the version of MySQL you're using is too old to support this kind of delete operation. I'd suggest upgrading your MySQL version; if this isn't possible, it's easy to re-implement this function to use a simpler delete. However, be warned that delete performance might be extremely poor with a simpler delete.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Postby Jordi Prats » Wed Aug 30, 2006 5:21 am

Hi Alec

Thank you very much for your "fast" answer.

We'll try to update our MySQL, but meanwhile we have been able to solve the problem.
Jordi Prats
 
Posts: 2
Joined: Tue Aug 29, 2006 4:39 am


Return to Open Harvester Systems Support and Development

Who is online

Users browsing this forum: No registered users and 0 guests