Query error: You have an error in your SQL syntax

Author Message

Will Collins

Tuesday 25 April 2006 3:26:56 pm

Recently I have been getting this error when posting a comment to an article on my site:

Fatal error: A database transaction in eZ publish failed.

The current execution was stopped to prevent further problems.
You should contact the System Administrator of this site with the information on this page.
The current transaction ID is TRANSID-d8b7bc8b63e35f29dd408b94d9a62cfc and has been logged.
Please include the transaction ID and the current URL when contacting the system administrator.

If I look in the error logs, I find the following:

[ Apr 25 2006 14:53:56 ] [207.46.98.128] Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version f$

and (ezcontentobject.id <> 9226)

and ((coverdate.contentclassattrib' at line 6. Query: SELECT COUNT(ezcontentobject.id) AS id_count, ezcontentobject.$

FROM ezcontentobject_attribute coverdate

INNER JOIN ezcontentobject ON (coverdate.contentobject_id = ezcontentobject.id) AND (coverdate.version = ezcontentob$

INNER JOIN ezcontentobject_link ON (ezcontentobject.id = ezcontentobject_link.from_contentobject_id) AND (ezcontento$

WHERE ((ezcontentobject_link.enhanced_contentclassattribute_id = 270)

and (ezcontentobject_link.to_contentobject_id IN ())

and (ezcontentobject.id <> 9226)

and ((coverdate.contentclassattribute_id = 183) and (coverdate.data_int < 1145991236))

and (ezcontentobject.published > 0))

GROUP BY ezcontentobject.id

ORDER BY id_count DESC, coverdate.data_int DESC LIMIT 5

(sorry about the spacing). Anyone have an idea why this query would fail?

Xavier Dutoit

Wednesday 26 April 2006 1:22:09 am

Hard to read the query as pasted.

I'd suggest to copy paste it and run it in your the shell from mysql> . Usually the error message is more explicit

X+

http://www.sydesy.com

Bertrand Dunogier

Wednesday 26 April 2006 1:24:02 am

Except the $ at the end of some lines, which I suppose are pasting mistakes, I can see this part wrong :

and (ezcontentobject_link.to_contentobject_id IN ())

IN() should not be empty

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 03:43:37
Script start
Timing: Jan 31 2025 03:43:37
Module start 'layout'
Timing: Jan 31 2025 03:43:37
Module start 'content'
Timing: Jan 31 2025 03:43:37
Module end 'content'
Timing: Jan 31 2025 03:43:37
Script end

Main resources:

Total runtime0.0236 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.2813151.2266
Module start 'layout' 0.00480.0033 739.5078220.7188
Module start 'content' 0.00800.0139 960.2266997.9609
Module end 'content' 0.02190.0016 1,958.187533.9922
Script end 0.0235  1,992.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002811.7071140.0002
Check MTime0.00114.5645140.0001
Mysql Total
Database connection0.00083.393310.0008
Mysqli_queries0.00197.981030.0006
Looping result0.00000.038410.0000
Template Total0.00125.110.0012
Template load0.00093.721010.0009
Template processing0.00031.403810.0003
Override
Cache load0.00062.617510.0006
General
dbfile0.00145.934980.0002
String conversion0.00000.025340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs