When updating the modules database tables through the tools page, Drupal output the following error messages:
- user warning: 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 'WHERE xn.nid IN (SELECT xnn.nid FROM dr6__xmlsitemap_node xnn ' at line 2 query: DELETE FROM dr6__xmlsitemap_node xn WHERE xn.nid IN (SELECT xnn.nid FROM dr6__xmlsitemap_node xnn LEFT JOIN dr6__node n ON n.nid = xnn.nid WHERE n.nid IS NULL) in Applications/MAMP/htdocs/dr6/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 420.
- user warning: Unknown column 'xn.last_changed' in 'where clause' query: SELECT COUNT(n.nid) FROM dr6__node n INNER JOIN dr6__xmlsitemap_node xn ON xn.nid = n.nid WHERE n.changed > xn.last_changed in /Applications/MAMP/htdocs/dr6/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 435.
Comments
Comment #1
avpadernoThe errors were caused from the use of a sub-query in the
DELETEoperation, and from an inconsistent use of the name of a database field.I have fixed this in CVS.
Comment #2
jolaa commentedi have the same error on line 420.
could you tell me how did you fix it :] i don't understand what you've done...
Comment #3
avpadernoSimply wait until Drupal creates the new tarball, and you will get the fixed code.
For development snapshots, Drupal creates a tarball archive everyday at 12:00 AM, and 12:00 PM GMT (if the code has been modified).
Comment #4
avpadernoThe error was the
WHERE xn.nid in (...).I simply split the query in two: the first part looks for the next
nidto delete, and the second one deletes the row with that value. The delete query becomes thenDELETE FROM {xmlsitemap_node} WHERE nid = %d.Comment #5
jolaa commentednow (after upgrading XML sitemap) I am getting different error:
when using xml tool:
user warning: Unknown column 'xn.changed' in 'where clause' query: SELECT COUNT(n.nid) FROM node n INNER JOIN xmlsitemap_node xn ON xn.nid = n.nid WHERE n.changed > xn.changed in /home/content/j/o/l/jolaa/html/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 453.
Comment #6
avpadernoDo you have access to the database tables? Can you verify the database fields for the xmlsitemap table, and report them here?
Comment #7
jolaa commentedYes I have an access to DB tables. But I have never changed anything there. So probably I will need some more info about what you require. I have 3 entries for xmlsitemap in my DB:
1. xmlsitemap 8 MyISAM utf8_general_ci 7.4 KiB -
structure:
Field Type Collation Attributes Null Default Extra Action
loc varchar(255) utf8_general_ci No
module varchar(255) utf8_general_ci No
type varchar(32) utf8_general_ci No
id int(10) UNSIGNED No 0
sid int(10) UNSIGNED No 0
lastmod int(10) UNSIGNED No 0
changefreq int(10) UNSIGNED No 0
priority float No 0.5
2. xmlsitemap_file 0 MyISAM utf8_general_ci 1.0 KiB -
3. xmlsitemap_node 8 MyISAM utf8_general_ci 2.2 KiB -
structure:
Field Type Collation Attributes Null Default Extra Action
nid int(10) UNSIGNED No 0
last_changed int(11) Yes NULL
previously_changed int(11) Yes NULL
last_comment int(11) Yes NULL
previous_comment int(11) Yes NULL
priority_override float No -2
Comment #8
avpadernoThe reason for me to asking is that the code I changed rename the last_changed field to changed but still your database contains the old name.
I now added a check more so the updating code execute the following lines:
If your database still contains the old field, then I would suggest you to:
If that doesn't resolve the problem, then I don't know what else suggest you. The code to update the database definition is present, and if your database doesn't get updated then it's not a bug of the project code.
Comment #9
avpadernoThe error was caused by a misspelled field name used by the update code.
Comment #10
avpadernoComment #11
jolaa commentednow I am having 520 error :)
user warning: 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 '' at line 1 query: ALTER TABLE xmlsitemap_file CHANGE fid `fid` INT unsigned NOT NULL DEFAULT 0, ADD in /home/content/j/o/l/jolaa/html/includes/database.mysql-common.inc on line 520.
Comment #12
avpadernoThat is a completely different issue that must be reported in a different report.