The following error message appears whenever the URL for the sitemap is accessed:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near 'DISTINCT(n.nid)), n.type, n.status, n.promote, s.comment_count,
n.changed, g.pre' at line 1 query: SELECT DISTINCT (DISTINCT(n.nid)), n.type, n.status, n.promote,
s.comment_count, n.changed, g.previously_changed, s.last_comment_timestamp, g.previous_comment,
g.priority_override FROM node n LEFT JOIN node_comment_statistics s ON n.nid = s.nid LEFT JOIN
gsitemap g ON n.nid = g.nid LEFT JOIN url_alias u ON src = CONCAT('node/', n.nid) WHERE n.status > 0
AND (g.priority_override >= 0 OR g.priority_override IS NULL) AND n.type NOT IN
('audio,blog,book,event,story,video') AND n.nid >= 0 AND n.nid < 10000 in
/drupal/includes/database.mysql.inc on line 121.

No XML output is seen in the root of the site. This occurs in two identically configured sites on two different servers.

Comments

mrbriano’s picture

I should have written:

There is no output for the site except for the top-level URL. This occurs in two identically configured sites on two different servers.

Instead of this:

No XML output is seen in the root of the site. This occurs in two identically configured sites on two different servers.

It doesn't matter how many pages get changed, the frequency of the changes, or changes to the priorities or overrides.
Nothing other than the top-level URL shows under the sitemap (.../gsitemap/0) URL except the top-level URL.

This issue seems to be referenced here also:

http://drupal.org/node/144589:

#4 submitted by Darren Oh on May 17, 2007 - 19:41 new

Actually, that's supposed to happen the first time the sitemap is viewed. I've worked on another site where that didn't
happen, and am trying to find out why.

Which concerns the 5.x-2.x-dev version. So it seems to happen here also, but probably not for the same reasons.

feedBooster’s picture

Hello,

I have exactly the same problem.
I've found that the problem comes from the query :

SELECT DISTINCT (n.nid), n.type, n.status, n.promote, n.changed, g.previously_changed, g.priority_override
FROM
node n
LEFT JOIN gsitemap g
ON n.nid = g.nid
LEFT JOIN url_alias u
ON src = CONCAT('node/',n.nid)
WHERE n.status > 0
AND (g.priority_override >= 0 OR g.priority_override IS NULL)
AND n.type NOT IN ('')
AND n.nid >= 0 AND n.nid < 10000

Mysql can not solve this, and I can't understand why. The message from mysql in unbelivable : #2006 - MySQL server has gone away

The Mysql version on my server is 5.0.32

Can someone help us ?

Thank's

darren oh’s picture

Status: Active » Closed (duplicate)

Duplicate of issue 190068.

mrbriano’s picture

Sorry, but this still is not fixed in 4.7.x-1.x-dev, version $Id: gsitemap.module,v 1.38.2.32 2007/11/11 19:09:38 darrenoh Exp $.