You have an error in your SQL syntax near 't INNER JOIN node n ON t.nid = n.nid SET t.awaiting_cron = 0 WHERE t.awaiting_cr' at line 1 query: UPDATE trackback_node t INNER JOIN node n ON t.nid = n.nid SET t.awaiting_cron = 0 WHERE t.awaiting_cron = 1 and n.status = 1

Getting the above error (in my logs) when the trackback module is set to run as a cron job..

Cheers
-K

Comments

smithmb’s picture

I also have this bug. The statement that is in error is:

UPDATE trackback_node t INNER JOIN node n ON t.nid = n.nid SET t.awaiting_cron = 0 WHERE t.awaiting_cron = 1 and n.status = 1

I haven't looked at the schema yet so I really can't debug this, but the inner join in the middle of an update style looks weird to me as someone with an Oracle background.

If it helps, I have no trackbacks in the db yet, although I doubt that matters as this is a syntactic issue.

Zen’s picture

I don't have any trackbacks either. And yes, it does seem to be a syntactic issue. My server uses MySQL 3.23 and I'm not sure if that supports multi-table queries in it's UPDATE statement.

-K

ankur’s picture

Assigned: Unassigned » ankur
ankur’s picture

Component: Other » Sending

A patch has been committed to HEAD, DRUPAL-4-6

The affected file is trackback.module.

For a diff to the previous version, please see
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/trackback/tra...

-Ankur

Zen’s picture

Issue doesn't seem to be resolved as I'm still getting a related error in my cron logs:

"You have an error in your SQL syntax near 't SET t.awaiting_cron = 0 WHERE t.nid = 504' at line 1 query: UPDATE trackback_node t SET t.awaiting_cron = 0 WHERE t.nid = 504"

The site is running trackback 1.33

Cheers
-K

ankur’s picture

Strange. I haven't been able to reproduce this error. I've been runing MySQL 4.0.24. I set up a scenario where a trackback was waiting to be cronned and then ran the cron job. I also tried pasting the query and directly executing it at the MySQL command-line...

Has anyone else had this happen?

Zen, in the meantime, do you think you can post back here with the version of MySQl you are using?

-Ankur

theneuralgourmet’s picture

I am also experiencing this bug with trackback.module version 1.34 and MySQL 3.23.58.

In my case it did not start until after I had deleted a trackback.

theneuralgourmet’s picture

Note: I just grabbed trackback.module 1.35 from CVS and the problem is still there. :-(

user error: You have an error in your SQL syntax near 't 
SET t.awaiting_cron = 0 WHERE t.nid = 5' at line 1 query: 
UPDATE trackback_node t SET t.awaiting_cron = 0 
WHERE t.nid = 5 in /var/www/html/includes/database.mysql.inc on line 66.
ankur’s picture

Just committed a fix to HEAD, DRUPAL-4-6

Now, I haven't been able to test the fix because I haven't been able to verify the problem. The query that above error messages spit out seem to work fine when I paste those queries into my MySQL command-line. Also, I haven't been able to reproduce the above SQL error with the two MySQL servers that I use for development. So, I'm only venturing to guess that this may be related to the "t" table alias I'm using for table "trackback_node" in the table. This was removed from the query. To see the changes to the trackback.module file, please see

http://cvs.drupal.org/viewcvs/drupal/contributions/modules/trackback/tra...

So, I'm going to request any of the parties that reported/confirmed this issue to mark this issus as "fixed" if the problem doesn't come up any more and to add a new comment to this thread if the problem continues to occur.

-Ankur

theneuralgourmet’s picture

Thanks! That does it.

huc’s picture